================ XML Standards ================ (37) Default 1 för minOccur (38) A namespace is used to qualify an XML element. (Det är inte möjligt att byta bort ett prefix mot fulla namnspace.) (39) It is possible to namespace qualify XML attributest (with a prefix). ================ Security ================ (15) Liberty 1. Providing open standard for identity assertion, authentication & access control. 2. Multiple security standards for lowering costs and accelerating commercial opportunities. (16) XACML 1. Provides XML vocabulary for defining and managing access to resources. 2. Provides language & platform agnostic policy management rules. (19) SAML: 1. Define syntax & semantix of security assertion messages. 2. Defines communication protocol for security info. 3. Can be used to impl. Single Sign On. (23) : 1. Contains ciphertext of an elements content or the element itself. (24) XPointer 1. Used to ref an XML fragment that would be encrypted. (20) Transport level security (SSL) 1. It guarantees both message integrity and confidentiality. 2. It can authenticate the client using certificates. ================ XML Parsing ================ (7) JAXB is good when: 1. XML tree processed many times. 2. Binding XML must be automatic. 3. XML element accessed at randomly. (10) Supports building Java objects from XML. Yes: JAXB, SAX No:XSLT, JAXR (11) Supports modifying content of XML documents in memory: Yes: DOM, JAXB, SAAJ No: XSLT (Bara transformering, ej ändra innehåll), SAX (13) JAXB binding compiler input is A. XML Schema B. XML-2-Java cust binding declaration. ================ SAAJ ================ (57) SOAPEnvelope contains SOAPHeader. (58) SOAPHeader.examineHeaderElements( SOAPConstants.URI_SOAP_ACTOR_NEXT) ================ SOAP 1.1 ================ (2) SOAP Attachment with content type "application/xml" maps to javax.xml.transform.Source (4) Server SOAP fault code indicates that the was a problem processing a mess rather than its content. (40) DIRECT ELEMENT CHILD of SOAP header MUST be namespace qualified. (41) Body elemetns can not have SOAP actor. (42) Only DIRECT ELEMENT CHILD of SOAP header can have MUST UNDERSTAND attr. (43) faultactor= Used to indicate who caused a fault (in the message path). (68) Mime maps to Java image/gif = java.awt.Image images/jpg = java.awt.Image text/plain = java.lang.String text/xml = javax.xml.transform.Source application/xml = javax.xml.transform.Source ================ HTML ================ (44) Post måst användas. (45) 500= Server error & SOAP fault. ================ WS-I ================ (22) Conformance claim: A. SOAP mess can have many conformance claims. B. Claim must not have mustUnderstand. (51) Claims can be done in documentation elements of the following elements: A: port B: binding C: portType D: operation ================ JAX-RPC ================ (1) javax.xml.rpc.Call is used to invoke WS dynamically. (9) These requires and WSDL-file to be specified: javax.xml.rpc.Service.getPort(Class servieIntf) javax.xml.rpc.Service.getWSDLDocumentLocation() (12) Service.getPort() can return: A: Generated Stub. B: Dynamic Proxy. (60) Servlet endpoint at SMPT protocol will cast javax.xml.rpc.JAXRPCException when ServletEndpointContext.getHttpSession() is called. (61) ServletEndpointContext.isUserInRole() will give the calling users role. (62) Service.createCall() is the only createCall() method that can be called if no WSDL specified. ================ Handler ================ (6) Handler gets handleFault() backwards after Exception. (8) When handler throws RuntimeException, destroy() is called. (18) Handler.handleRequest() can return: A: True, if the next handler can be invoked B: False, if the next handler cannot be invoked. C: What exceptions are thrown? (62) Header element with actor="../next" will be processed by next. webservices.xml: xxx ... MyHandler xxx ms:MyHeader ================ J2EE WS ================ (52) WS-Transaction= is the embryo for WS calls with transactions. (53) JAX-RPC= Only API with support for invoking ws dynamically. (69) Match: javax.xml.bind= JAXB javax.xml.transform.sax= JAXP javax.xml.soap= SAAJ javax.xml.rpc.handler = JAX-RPC javax.xml.registry.infomodel = JAXR ================ Patterns ================ (28) Service Locator= often used with businessDelegate. (30) Session Facade= Coarse grained API. Reduces teh number of RPC calls. (29) Service Locator= Removes the burden of making JNDI lookups. ================ Endpoint Design ================ (21) Weakness of RPC-style: A: Client strongly coupled. B: Expressive power of the info return is limited. (33) (34) (35) (36) (66) ================ Develop WS ================ (6) elements of webservices.xml modified by "WS Assembler": , , (14) webservie.xml: Must be specified: A: Fully qualified name of SEI. B: All needed servlet mappings. (25) Exactly 1 mapping.xml per WSDL-file. (26) Service operation with many input parameters will result in many part-elements in WSDL. (27) (64) (65) ================ WSDL ================ (46) Import= tagetNamespace of definitions of the imported WSDL-document must match the namespace of the import element. ================ UDDI ================ (55) FederatedConnection = Distributed connection representing a collection of existing Connections to different registries. (67) UDDI binding Template= ServiceBinding tModel = Concept publisherAssertion= Association businessEntity = Organization businessService = Service ================ JAXR ================ (54) J2EE connection: InitialContext ctx= new InitialContext(); ConnectionFactory fac = (ConnectionFactory) ctx.lookup("java:comp/env/jaxr/UDDIRegistry"); Connection conn= fac.createConnection(); (56) Limit search results by setting prop on JAXR ConnectionFactory.