Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer web services - Bus enabled web services > Enable web services through the service integration bus > Pass SOAP messages with attachments through the service integration bus


Support bound attachments: WSDL examples

Use this task to see examples of WSDL fragments with Web Services-Interoperability (WS-I) Attachments Profile v1.0 encoding and SOAP Messages with Attachments encoding.

Web Services-Interoperability (WS-I) Attachments Profile v1.0 defines a convention for constructing the Content ID for a bound attachment. This convention encodes the message part name. Consequently, service integration technologies can recognize a bound attachment whether or not the SOAP body contains elements representing that message part. The convention for constructing a Content ID is as follows:

name=uuid@domain

where name is the name of the message part that is being encoded, uuid is a globally unique identifier, and domain is a domain identifier (for example my.example.com).

This approach differs from the SOAP Messages with Attachments encoding scheme, which does not define a conventions for the Content ID but does use elements within the SOAP body to indicate that the message part is encoded as an attachment.

In order to distinguish between the cases, service integration technologies assumes that if a message attachment follows the v1.0 convention for constructing the Content ID, then it is a v1.0 message.


Example

The following WSDL fragment is for a bound attachment, with message instances that follow both styles:

<wsdl:binding name="BoundSoapBinding" type="intf:BoundPortType">
<soap:binding style="rpc"
                  transport="http://schemas.xmlsoap.org/soap///publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/  "/>
<wsdl:operation name="bound">
<soap:operation soapAction=""/>
<wsdl:input>  
<mime:multipartRelated>    
<mime:part>      
<soap:body parts="stringIn" namespace="http://bound"
                       use="literal"/>    
</mime:part>    
<mime:part>      
<mime:content part="attachIn" type="text/xml"/>    
</mime:part>  
</mime:multipartRelated>
</wsdl:input>

The following WSDL fragment is for a SOAP instance that uses v1.0 encoding. In this fragment, the message body contains no mention of the attachIn part, and the Content ID of the attachment identifies the part that is being encoded.

--myBoundary
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-Id:
<myStartID>

<SOAP-ENV:Envelope
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns0:bound xmlns:ns0="http://bound">
<stringIn>some string data
</stringIn>
</ns0:bound>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--myBoundary
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-Id:
<attachIn=someUUID@some.domain.name>

<someOtherXMLElement/> --myBoundary--

The following WSDL fragment is for a SOAP instance that uses SOAP Messages with Attachments encoding. In this fragment, the message body does contain a reference to the bound attachment, and the Content ID of the attachment is not constrained.

--myBoundary
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-Id:
<myStartID>

<SOAP-ENV:Envelope
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns0:bound xmlns:ns0="http://bound">
<stringIn>some string data
</stringIn>
<attachIn href="cid:notTheStart"/>
</ns0:bound>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
--myBoundary
Content-Type: text/xml
Content-Transfer-Encoding: 7bit
Content-Id:
<notTheStart>

<someOtherXMLElement/> --myBoundary--

In the previous two cases there is sufficient information in the message to identify the bound attachment, and in both cases service integration technologies places a bound attachment entry in the attachments list, and places the data from the attachment into the body section of the data graph.
SOAP with attachments: A definition


Related


Map of SDO data graphs for web services messages

+

Search Tips   |   Advanced Search