Thanks for your followup Andi,
Answers for your further questions inline:
Question 1:
Why was the "SoapDocumentMe thodAttribute" with
"ParameterStyle =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped"
version working in .NET 1.0 and not in .NET 1.1/2.0?
Shouldn't the framework versions behave the same here?
Can you refer me to the appropriate documentation of this change so that we
can understand this?
=============== =============== ==========
From the test SOAP response message you provided, we can get that the
serverside(java webservice) is using RPC/encoded style Soap Message, so in
our .NET webservice proxy, we should also mark our webservcie webmethod
with SoapRpcMethodAt tribute. (Bydefault .net webservice service or proxy
both use SoapDocumentMet hodAttribute ) Document/Liberal style is the
recommended means for XML Webservice since that'll make the actual SOAP
message conforms to our XSD schema and WSDL document..... I think the
..NET 1.0 framework dosn't quite restrict on this so that the RPC/encoded
style message get parsed when using document/literal style declared
serivce/proxy....
Some useful reference:
#.NET Framework Support for SOAP Formats
http://msdn2.microsoft.com/en-us/library/4cxy91t2.aspx
#Reap the benefits of document style Web services
http://www-128.ibm.com/developerwork...-docstyle.html
Question 2:
Since you said you generated the proxy from a dummy-webservice... what did
you do first:
Write the WSDL for the dummy webservice and then create the webservice code
based on that or write the dummy-webservice and had the WSDL created based
on
the dummy webservice code?
(What was first - code or WSDL?)
=============== =============== ===========
Actually, since your test example SOAP message is quite simple, and I can
directly write a WebMethod in ASMX without defining WSDL first. First I
got that your webservice is a RPC/encoded style one, so I'm sure I should
name the webservcie method name the same as the xml element name for the
webservice call in SOAP, then, for inner return element, the runtime can
correctly parsing it through SOAP encoding rules , that's not what I can
quite control.... (also the drawback of rpc/encoded....).
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
Thread-Topic: Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0
thread-index: AcXuvf9dQsujBpT YTsugFeXOh0sQ4g ==
X-WBNR-Posting-Host: 84.167.230.47
From: "=?Utf-8?B?TVNETkFuZGk =?=" <MS******@noema il.noemail>
References: <OO************ **@TK2MSFTNGP11 .phx.gbl>
<82************ *************** *******@microso ft.com>
<7P************ **@TK2MSFTNGXA0 2.phx.gbl>
<BA************ *************** *******@microso ft.com>
<$n************ **@TK2MSFTNGXA0 2.phx.gbl>
Subject: RE: Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0
Date: Mon, 21 Nov 2005 09:07:05 -0800
Lines: 158
Message-ID: <1A************ *************** *******@microso ft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.publi c.dotnet.framew ork.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGXA03.phx .gbl
microsoft.publi c.dotnet.framew ork.webservices :12795
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.webservices
Hi Steven,
also thanks for this really quick and helpful response.
Actually from your example, I got it working in a testcase - I have to test
it with the full-blown application later (to see if all parameters get
through, my example was simplified of course).
I compared your posting to our original code and tinkered a little bit with
it... the main differences I can see are:
Your code (working in 1.1 and 2.0):
*snip*
[System.Web.Serv ices.Protocols. SoapRpcMethodAt tribute("urn://MyRoot/MyServic
es/MyWSCall",
RequestNamespac e="urn://MyRoot/MyServices",
ResponseNamespa ce="urn://MyRoot/MyServices")]
public string MyWSCall() {
*snip*
My old code (not working in 1.1, 2.0, but working in 1.0):
*snip*
[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("u rn://MyRoot/MyS
ervices/MyWSCall",
RequestNamespac e="urn://MyRoot/MyServices",
ResponseNamespa ce="urn://MyRoot/MyServices",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Encoded,
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
[return: System.Xml.Seri alization.XmlEl ementAttribute( "result")]
public object MyWSCall(int CallId, string XMLString) {
*snip*
I tried to see what are the minimal changes I have to apply and came up
with
this (tested to be working in 2.0):
*snip*
[System.Web.Serv ices.Protocols. SoapRpcMethodAt tribute("urn://MyRoot/MyServic
es/MyWSCall",
RequestNamespac e="urn://MyRoot/MyServices",
ResponseNamespa ce="urn://MyRoot/MyServices",
Use=System.Web. Services.Descri ption.SoapBindi ngUse.Encoded)]
[return: System.Xml.Seri alization.XmlEl ementAttribute( "result")]
public object MyWSCall(int CallId, string XMLString) {
*snip*
Differences:
1.
changed:
SoapDocumentMet hodAttribute
to
SoapRpcMethodAt tribute
and
2.
removed:
ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped
But it still beats me.
Question 1:
Why was the "SoapDocumentMe thodAttribute" with
"ParameterStyle =System.Web.Ser vices.Protocols .SoapParameterS tyle.Wrapped"
version working in .NET 1.0 and not in .NET 1.1/2.0?
Shouldn't the framework versions behave the same here?
Can you refer me to the appropriate documentation of this change so that we
can understand this?
Question 2:
Since you said you generated the proxy from a dummy-webservice... what did
you do first:
Write the WSDL for the dummy webservice and then create the webservice code
based on that or write the dummy-webservice and had the WSDL created based
on
the dummy webservice code?
(What was first - code or WSDL?)
Finally ("for information"):
The (simplified and with renamed method names) WSDL that we were supposed
to
use ( and which I suspected was "wrong" ) is posted below... your WSDL
differs quite a bit from it (yours is much simpler):
<?xml version="1.0" encoding="utf-8"?>
<definitions
xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/"
xmlns="http://schemas.xmlsoap .org/wsdl/"
xmlns:s0="http://MyRoot/MyServices"
targetNamespace ="http://MyRoot/MyServices"
<types>
<s:schema elementFormDefa ult="qualified"
targetNamespace ="http://MyRoot/MyServices">
<s:element name="MyWSCall" >
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AppId" />
<s:element minOccurs="0" maxOccurs="1" name="XMLString " />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="MyWSCallR esponse">
<s:complexTyp e>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="result" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="MyWSCallS oapIn">
<part name="parameter s" element="s0:MyW SCall" />
</message>
<message name="MyWSCallS oapOut">
<part name="parameter s" element="s0:MyW SCallResponse" />
</message>
<portType name="TargetSys temSoap">
<operation name="MyWSCall" >
<input message="s0:MyW SCallSoapIn" />
<output message="s0:MyW SCallSoapOut" />
</operation>
</portType>
<binding name="TargetSys temSoap" type="s0:Target SystemSoap">
<soap:binding transport="http ://schemas.xmlsoap .org/soap/http"
style="document " />
<operation name="MyWSCall" >
<soap:operati on soapAction="htt p://MyRoot/MyServices/MyWSCall"
style="document " />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="TargetSys tem">
<port name="TargetSys temSoap" binding="s0:Tar getSystemSoap">
<soap:address
location="http://localhost/Projects/TargetSystem/TargetSystem.as mx" />
</port>
</service>
</definitions>
Regards and thanks,
Andi