on 2016 Sep 25 11:17 PM
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..
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi Chandu,
Regards,
Praveen.
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.
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
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.
User | Count |
---|---|
69 | |
12 | |
11 | |
10 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.