SXI Forum

A place to collect usefull tips, tricks and implementation strategies.

You are not logged in.

#1 21-11-2018 15:51:35

SeanR
Administrator
Registered: 20-11-2018
Posts: 148

Consuming a complex SOAP Web Service with X-ServiceBroker

There are 2 types of requests that can be sent to a SOAP Web Service.

  • Simple requests.

  • Complex requests.

Simple Request

A simple request is defined such, as all the data passed for the operation is passed as a child element of the operation in question.  For example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://bin/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
        <ns0:processDoc>
            <documentData>This is the data</documentData>
            <messageParameters>ClientName</messageParameters>
            <messageParameters>ACME</messageParameters>
        </ns0:processDoc>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

In the example above the operation (method) being called by the request is <ns0:processDoc>. All the attributes passed to the the processDoc,  that is <documentData>, and the <messageParameters> are children of the <ns0:processDoc> element. In this case you would configure X-ServiceBroker to construct the request in the same way as you would do for any other connector by using an XLayer DataDefinition node.

Complex Request

A complex request requires the data to be passed to the operation as further dependants, i.e. children, grandchildren, great grandchildren etc. For example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ns0="http://bin/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
        <ns0:processDoc>
            <documentData>
                <Lines>
                    <Line1>This is line 1</Line1>
                    <Line2>This is line 2</Line2>
                    <Line3>This is line 3</Line3>
                    <Line4>This is line 4</Line4>
                </Lines>
            </documentData>
            <messageParameters>ClientName</messageParameters>
            <messageParameters>ACME</messageParameters>
        </ns0:processDoc>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

In the example above the operation (method) being called by the request is <ns0:processDoc>. But unlike the simple request described earlier not all the attributes passed are children of the <ns0:processDoc> element and we have some grandchildren i.e. <Line1>, <Line2>, <line3>, and <Line4>. In some extreme cases the envelop required by the SOAP Web Service you are consuming may even require different name spaces, so in these instances we certainly would not be in a position to simply configure the request using the normal Xlayer DataDefinition.

How would we configure X-ServiceBroker to generate a complex request as illustrated above?

Offline

Board footer

Powered by FluxBB