TIBCO Software Inc. 2009 Confidential Author: Carlo Milono

TIBCO Software Inc. 2009 Confidential Author: Carlo Milono

<p>TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Simulating WS-Addressing Structures for BusinessWorks 5.7.X</p><p>Axis2 Echo Example</p><p>Introduction TIBCO ActiveMatrix BusinessWorks does not natively support WS-Addressing as of version 5.7.x. The underlying XML engines are flexible, however, and you can create WS-Addressing compatible WSDLs and map in-to and out-of the WS-Addressing elements and attributes. Creating a new listener will not be automatic and any of the underlying functions will have to be architected into a solution. This document only covers the WS-Addressing schema structure within BusinessWorks. This document covers the specific case of testing BusinessWorks against the Axis2 (v1.4.1) WsaMappingTest, which is basically an ‘echo’ model. This approach can be used to build out other Web Services functions as well, such as SAML or Web Services Security. One issue is that you cannot easily manipulate the attributes of the <soap:body>, but this is not a concern of WS-Addressing, but rather is relevant to WSSE.</p><p>Axis2 1.4 Client Request (via SoapUI) POST /axis2/services/WsaMappingTest.WsaMappingTestHttpSoap11Endpoint/ HTTP/1.1 Content-Type: text/xml;charset=UTF-8 SOAPAction: "urn:echo" User-Agent: Jakarta Commons-HttpClient/3.1 Host: 127.0.0.1:9091 Content-Length: 748</p><p><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exam="http://example3.userguide"> <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:Action soapenv:mustUnderstand="1">urn:echo</wsa:Action> <wsa:ReplyTo soapenv:mustUnderstand="1"> <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address> </wsa:ReplyTo> <wsa:MessageID soapenv:mustUnderstand="1">fc41df58-b1dc-49cf-ba81- 4b3b644b8224</wsa:MessageID> <wsa:To soapenv:mustUnderstand="1"></p><p><wsa:Address>http://10.105.150.234:9091/axis2/services/WsaMappingTest.WsaMappingTestHt tpSoap11Endpoint/</wsa:Address> </wsa:To> </soapenv:Header> <soapenv:Body> <exam:echo>SOAP 1.1 this time</exam:echo> </soapenv:Body></soapenv:Envelope> TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Axis2 1.4 Service Response</p><p>HTTP/1.1 200 OK Date: Thu, 19 Nov 2009 22:35:13 GMT Server: Simple-Server/1.1 Transfer-Encoding: chunked Content-Type: text/xml; charset=UTF-8 1b0 <?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:Action>urn:echoResponse</wsa:Action> <wsa:RelatesTo>fc41df58-b1dc-49cf-ba81-4b3b644b8224</wsa:RelatesTo> </soapenv:Header> <soapenv:Body> <exam:echo xmlns:exam="http://example3.userguide">SOAP 1.1 this time</exam:echo> </soapenv:Body> </soapenv:Envelope>0</p><p>BW 5.7.2 Client Request (just copy the WSDL exposed by Svc)</p><p>NOTE: no <imports> in the WSDL POST /axis2/services/WsaMappingTest.WsaMappingTestHttpSoap11Endpoint/ HTTP/1.1 Connection: close SoapAction: "urn:echo" content-type: text/xml; charset="utf-8" User-Agent: Jakarta Commons-HttpClient/3.0.1 Host: 127.0.0.1:9091 Content-Length: 264</p><p><?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ns0:echo xmlns:ns0="http://example3.userguide"> <ns0:echo>This is a message</ns0:echo> </ns0:echo> </SOAP-ENV:Body> </SOAP-ENV:Envelope> TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Axis2 Service Response No headers in, so no headers out</p><p>HTTP/1.1 200 OK Date: Thu, 19 Nov 2009 22:37:48 GMT Server: Simple-Server/1.1 Transfer-Encoding: chunked Content-Type: text/xml; charset=utf-8 Connection: close 103 <?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns0:echo xmlns:ns0="http://example3.userguide"> <ns0:echo>This is a message</ns0:echo> </ns0:echo> </soapenv:Body> </soapenv:Envelope>0 TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Coersion in BW – adding Headers Import ws-addr-wsdl.xsd and/or ws-addr.xsd, along with the right SOAP schema (v1.1 shown )depending on your needs.</p><p>Create Messages for the WSDL to include:</p><p> wsa:MessageID</p><p> wsa:To</p><p> wSA:ReplyTo</p><p> wsa:Action</p><p> wsa:From</p><p> wsa:RelatesTo TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Add the namespaces and <imports>: <?xml version = "1.0" encoding = "UTF-8"?> <wsdl:definitions targetNamespace = "http://example3.userguide" xmlns:http = "http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime = "http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns = "http://example3.userguide" xmlns:ns1 = "http://org.apache.axis2/xsd" xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12 = "http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa = "http://www.w3.org/2005/08/addressing" xmlns:wsaw = "http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/" xmlns:xs = "http://www.w3.org/2001/XMLSchema"> <wsdl:import location = "soap-envelope-1.1.xsd" namespace = "http://schemas.xmlsoap.org/soap/envelope"/> <wsdl:import location = "ws-addr-wsdl.xsd" namespace = "http://www.w3.org/2006/05/addressing/wsdl"/> <wsdl:import location = "ws-addr.xsd" namespace = "http://www.w3.org/2005/08/addressing"/></p><p>Add <soap:header> entries to <wsdl:input> and <wsdl:output>: <wsdl:operation name = "echo"> <soap:operation soapAction = "urn:echo" style = "document"/> <wsdl:input> <soap:body use = "literal"/> <soap:header message = "ns:MessageID" part = "MessageID" use = "literal"/> <soap:header message = "ns:To" part = "To" use = "literal"/> <soap:header message = "ns:From" part = "From" use = "literal"/> <soap:header message = "ns:ReplyTo" part = "ReplyTo" use = "literal"/> <soap:header message = "ns:Action" part = "Action" use = "literal"/> </wsdl:input> <wsdl:output> <soap:body use = "literal"/> <soap:header message = "ns:Action" part = "Action" use = "literal"/> <soap:header message = "ns:RelatesTo" part = "RelatesTo" use = "literal"/> </wsdl:output> TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Populate the elements and attributes as needed:</p><p>Note: special reserved URI anonymous means that ReplyTo is effectively ignored.</p><p> http://www.w3.org/2005/08/addressing/anonymous</p><p>Here is the Output from a successful test: TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Modified BW Client SOAP Message after coercion POST /axis2/services/WsaMappingTest.WsaMappingTestHttpSoap11Endpoint/ HTTP/1.1 Connection: close SoapAction: "urn:echo" content-type: text/xml; charset="utf-8" User-Agent: Jakarta Commons-HttpClient/3.0.1 Host: 127.0.0.1:9091 Content-Length: 1766</p><p><?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <ns:MessageID xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" ns0:mustUnderstand="1">fc41df58- b1dc-49cf-ba81-4b3b644b8224</ns:MessageID> <ns:To xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" ns0:mustUnderstand="1">http://10.105.150.234:9091/axis2/services/WsaMappingTest.WsaMap pingTestHttpSoap11Endpoint/</ns:To> <ns:From xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"> <ns:Address>http://www.youbetcha.com/anonymous</ns:Address> </ns:From> <ns:ReplyTo xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono xmlns:ns="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" ns0:mustUnderstand="1"> <ns:Address>http://www.w3.org/2005/08/addressing/anonymous</ns:Address> </ns:ReplyTo> <ns:Action xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns="http://www.w3.org/2005/08/addressing" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" ns0:mustUnderstand="1">urn:echo</ns:Action> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns0:echo xmlns:ns0="http://example3.userguide"> <ns0:echo>This is a message</ns0:echo> </ns0:echo> </SOAP-ENV:Body> </SOAP-ENV:Envelope> TIBCO Software Inc. – © 2009 Confidential Author: Carlo Milono</p><p>Response from Axis2 HTTP/1.1 200 OK Date: Fri, 20 Nov 2009 00:58:47 GMT Server: Simple-Server/1.1 Transfer-Encoding: chunked Content-Type: text/xml; charset=utf-8 Connection: close</p><p>1c1 <?xml version='1.0' encoding='utf-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsa:Action>urn:echoResponse</wsa:Action> <wsa:RelatesTo>fc41df58-b1dc-49cf-ba81-4b3b644b8224</wsa:RelatesTo> </soapenv:Header> <soapenv:Body> <ns0:echo xmlns:ns0="http://example3.userguide"> <ns0:echo>This is a message</ns0:echo> </ns0:echo> </soapenv:Body> </soapenv:Envelope>0</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us