You offer the SOAP request generated by .NET,
And then a different version of XML that you say "you are expecting from
.NET". Any reason WHY you are expecting .NET to generate a message
like that? I don't see a good reason for your expectation. According to
the WSDL, the XML you get from .NET is correct, and should be expected.
Maybe instead of "the XML you are expecting from .NET" you mean "the
XML you WOULD LIKE TO GET from .NET."
Yes, you can do that. Essentially it appears that you want an additional
element wrapper. This is not a .NET thing; it's a WSDL thing.
In the WSDL you would replace getDummyBean defn:
<element name="getDummyBean">
<complexType>
<sequence>
<element name="VOILA" type="tns2:InputBean"/>
</sequence>
</complexType>
</element>
With this:
<element name="getDummyBean">
<complexType>
<sequence>
<element name="VOILA" type="tns2:InputBeanWrapper"/>
</sequence>
</complexType>
</element>
And then add a new InputBeanWrapper type:
<s:complexType name="InputBeanWrapper">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DummyBean"
type="s1:InputBean" />
</s:sequence>
</s:complexType>
...in the schema for targetNamespace="http://ws.as.com/schema/typesws"
BUT,
I think your schema is confusing, and could use some clarification. You
have a getDummyBean method into which you pass ... VOILA? And it wraps
an element named "DummyBean"? It all makes for confusion.
-Dino
-----Original Message-----
From: babloosony [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 05, 2005 11:41 AM
To: [email protected]; [email protected]
Subject: How to customize the soap message generated by .NET
Hi All,
I have included all the relevant files in this mail. Basically I have
below soap message generated by .NET (installed Microsoft .NET 1.1
Framework and am running the exe that I got from this url
http://www.gotdotnet.com/Community/UserSamples/Download.aspx?SampleGuid=
65A1D4EA-0F7A-41BD-8494-E916EBC4159C)
using a WSDL generated by AXIS 1.2 RC2.
Originally request soap message generated by .NET Client
------------------------------------------------------------------------
----------------
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getDummyBean xmlns="http://ws.as.com/wsdl/typesws">
<VOILA>
<j xmlns="http://ws.as.com/schema/typesws">100</j>
<st xmlns="http://ws.as.com/schema/typesws">ram</st>
<i xmlns="http://ws.as.com/schema/typesws">99</i>
</VOILA>
</getDummyBean>
</soap:Body>
</soap:Envelope>
Originally response soap message generated by AXIS 1.2 RC2 Server
------------------------------------------------------------------------
--------------------------------
ResponseCode: 200 (OK)
Server:WebSphere Application Server/5.1
Content-Type:text/xml; charset=utf-8
Content-Language:en-US
Transfer-Encoding:chunked
<?xml version="1.0" encoding="utf-16"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getDummyBeanResponse xmlns="http://ws.as.com/wsdl/typesws">
<getDummyBeanReturn>
<i>100</i>
<st>dummystring</st>
</getDummyBeanReturn>
</getDummyBeanResponse>
</soapenv:Body>
</soapenv:Envelope>
The soap request message I am expecting from .NET Client
------------------------------------------------------------------------
------------------
<?xml version="1.0" encoding="utf-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<getDummyBean xmlns="http://ws.as.com/wsdl/typesws">
<VOILA>
<DummyBean xmlns="http://ws.as.com/schema/typesws">
<j
xmlns="http://ws.as.com/schema/typesws">100</j>
<st
xmlns="http://ws.as.com/schema/typesws">ram</st>
<i
xmlns="http://ws.as.com/schema/typesws">99</i>
</DummyBean>
</VOILA>
</getDummyBean>
</soap:Body>
</soap:Envelope>
WSDL
----------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ws.as.com/wsdl/typesws"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://ws.as.com/wsdl/typesws"
xmlns:intf="http://ws.as.com/wsdl/typesws"
xmlns:tns1="http://ws.as.com/wsdl/typesws"
xmlns:tns2="http://ws.as.com/schema/typesws">
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://ws.as.com/schema/typesws"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="DummyParentBean">
<sequence>
<element name="j" type="xsd:int"/>
</sequence>
</complexType>
<complexType name="InputBean">
<complexContent>
<extension base="tns2:DummyParentBean">
<sequence>
<element name="st"
nillable="true" type="xsd:string"/>
<element name="i"
type="xsd:int"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="DummyBean">
<sequence>
<element name="i" type="xsd:int"/>
<element name="st" nillable="true"
type="xsd:string"/>
</sequence>
</complexType>
</schema>
<schema elementFormDefault="qualified"
targetNamespace="http://ws.as.com/wsdl/typesws"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://ws.as.com/schema/typesws"/>
<element name="getDummyBean">
<complexType>
<sequence>
<element name="VOILA"
type="tns2:InputBean"/>
</sequence>
</complexType>
</element>
<element name="getDummyBeanResponse">
<complexType>
<sequence>
<element
name="getDummyBeanReturn" type="tns2:DummyBean"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="getDummyBeanResponse">
<wsdl:part element="tns1:getDummyBeanResponse"
name="parameters"/> </wsdl:message> <wsdl:message
name="getDummyBeanRequest">
<wsdl:part element="tns1:getDummyBean" name="parameters"/>
</wsdl:message> <wsdl:portType name="Types">
<wsdl:operation name="getDummyBean">
<wsdl:input message="impl:getDummyBeanRequest"
name="getDummyBeanRequest"/>
<wsdl:output message="impl:getDummyBeanResponse"
name="getDummyBeanResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TypesServiceSoapBinding" type="impl:Types">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getDummyBean">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getDummyBeanRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getDummyBeanResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TypesService">
<wsdl:port binding="impl:TypesServiceSoapBinding"
name="TypesService">
<wsdlsoap:address
location="http://10.236.235.213:9999/IRSCProj04022005Axis12Rc2Web/servic
es/TypesService"
/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Can anybody please tell me how can I get the soap message that I have
explained above under the heading "The soap request message I am
expecting from .NET Client". Is there anything I can change in my WSDL.
Please suggest.
- Kumar.