cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous Scenario

former_member581827
Participant
0 Kudos

Hi,

We have a requirement where we send Request to Webservice and we get response out of 2 Individual different schema.

As this is synchronous scenario where we cant handle 2 different schema's in single response.

Let us know if any one has done this kind of requirement.

Thanks..

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member581827
Participant
0 Kudos

Harish,

Based on the request validation we will get either of the 2 schema's in response.

There is no action been defined in any of the responses. These are standard Schema's been provided by Webservice receiver team.

Thanks.

Harish
Active Contributor
0 Kudos

Hi,

In this scenario you can opt for the solution i gave in my response.

One option is two have both the schema in one structure

response

     schema 1 node (0..1 or 0..n)

     schema 2 node (0..1 or 0..n)

Now you need to add the response node before performing the message mapping.Use the XSLT mapping in the channel/ESR to add the response tag from XML or use java mapping in ESR.

regards.

Harish

former_member581827
Participant
0 Kudos

Harish,

How can we have 2 External definitions in one Structure?

Thanks..

Harish
Active Contributor
0 Kudos

Hi,

you can create a new structure/external definition and refer the type for node 1 to your schema 1 and type for node 2 for schema 2.

If you want to create combine XSD/WSDL then you can use the import xsd to refer to schema 1 and schema 2 external definition.

reference -

regards,

Harish

former_member182412
Active Contributor
0 Kudos

Hi Chandu,

  • Include Envelope in your request and response structure.
  • In the request mapping include Envelope that means when you send the request message to web service the payload must be with soap envelope
  • Create the response structure like below which means envelope with two response structure with occurrence 0..1 so only one structure will be present in the response message and do the response mapping based one your requirement.

  • Dont forget to select Do Not Use SOAP Envelope in receiver soap adapter.

Regards,

Praveen.

former_member581827
Participant
0 Kudos

Praveen,

I am still wondering how will you create custom structure in Extenal Defnition, it can only take import XSD or WSDL or from DTD..

How will you embed SOAP Envelope for Request and Response?

Thanks,

former_member182412
Active Contributor
0 Kudos

Hi Chandu,

Can you attach your WSDL's here so that i can edit them for you.

Regards,

Praveen.

former_member581827
Participant
0 Kudos

We dont have WSDL's

We have only Xsd's.

Thanks,

Harish
Active Contributor
0 Kudos

Hi,

WSDL is also contains the XSD with other details like port type, binding etc.

Please attach your XSD so you can get a combine structure with soap envelop.

XSD (XML schema definition) defines the element in an XML document. It can be used to verify if the elements in the xml document adheres to the description in which the content is to be placed. While wsdl is specific type of XML document which describes the web service. WSDL itself adheres to aXSD.

former_member581827
Participant
0 Kudos

I am aware of what is WSDL... But we dont have wsdl from customer ... We have only XSD's.

Do we need to use any external tool to add the two responses to SOAP Envelope XSD?

Harish
Active Contributor
0 Kudos

Hi,

you can use the xml spy or similar tool to add the XSD.

other option is to add them notepad or notepad++. You need to create soap envelop and soap body in the structure, then use the import or include XSD function to refer to this two schema.

One issue with do not use soap envelop is you need to create soap envelop in mapping for request message as well.

regards,

Harish

former_member182412
Active Contributor
0 Kudos

Hi Chandu,

I have created the soap envelope like below which refers the individual XSD's. You can take this as example.

Envelope.xsd


<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:ns1="http://mycompany.org/one" xmlns:ns2="http://mycompany.org/two" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:import namespace="http://mycompany.org/one" schemaLocation="WebServiceResponseOne.xsd" />

  <xsd:import namespace="http://mycompany.org/two" schemaLocation="WebServiceResponseTwo.xsd" />

  <xsd:element name="Envelope" type="Envelope" />

  <xsd:complexType name="Envelope">

    <xsd:sequence>

      <xsd:element name="Header" form="qualified" />

      <xsd:element name="Body" form="qualified">

        <xsd:complexType>

          <xsd:sequence>

            <xsd:element ref="ns1:WebServiceResponseOne" minOccurs="0"/>

           <xsd:element ref="ns2:WebServiceResponseTwo" minOccurs="0"/>

          </xsd:sequence>

        </xsd:complexType>

      </xsd:element>

    </xsd:sequence>

  </xsd:complexType>

</xsd:schema>

WebServiceResponseOne.xsd


<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema targetNamespace="http://mycompany.org/one" xmlns:ns1="http://mycompany.org/one" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:complexType name="WebServiceResponseOneType">

    <xsd:sequence>

      <xsd:element name="Element1" type="xsd:string" />

      <xsd:element name="Element2" type="xsd:string" />

    </xsd:sequence>

  </xsd:complexType>

   <xsd:element name="WebServiceResponseOne" type="ns1:WebServiceResponseOneType" />

</xsd:schema>

WebServiceResponseTwo.xsd


<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema targetNamespace="http://mycompany.org/two" xmlns:ns2="http://mycompany.org/two" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:complexType name="WebServiceResponseTwoType">

    <xsd:sequence>

      <xsd:element name="Element1" type="xsd:string" />

      <xsd:element name="Element2" type="xsd:string" />

    </xsd:sequence>

  </xsd:complexType>

  <xsd:element name="WebServiceResponseTwo" type="ns2:WebServiceResponseTwoType" />

</xsd:schema>

Regards,

Praveen.

Harish
Active Contributor
0 Kudos

Hi,

Can you please provide more information/details for your scenario. The response schema must depend on the request message and the different action triggered based on the request message.

One option is two have both the schema in one structure

response

     schema 1 node (0..1 or 0..n)

     schema 2 node (0..1 or 0..n)

Now you need to add the response node before performing the message mapping.Use the XSLT mapping in the channel/ESR to add the response tag from XML or use java mapping in ESR.

But the best way to identify the operation type in the request and hit the different operation with multiple operation interface or separate receiver interface (using interface determination condition)

regards,

Harish