Thanks for your followup Andi,
Answers for your further questions inline:
Question 1:
Why was the "SoapDocumentMethodAttribute" with
"ParameterStyle=System.Web.Services.Protocols.Soap ParameterStyle.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 SoapRpcMethodAttribute. (Bydefault .net webservice service or proxy
both use SoapDocumentMethodAttribute ) 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: AcXuvf9dQsujBpTYTsugFeXOh0sQ4g==
X-WBNR-Posting-Host: 84.167.230.47
From: "=?Utf-8?B?TVNETkFuZGk=?=" <MS******@noemail.noemail>
References: <OO**************@TK2MSFTNGP11.phx.gbl>
<82**********************************@microsoft.co m>
<7P**************@TK2MSFTNGXA02.phx.gbl>
<BA**********************************@microsoft.co m>
<$n**************@TK2MSFTNGXA02.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**********************************@microsoft.co m>
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.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
microsoft.public.dotnet.framework.webservices:1279 5
X-Tomcat-NG: microsoft.public.dotnet.framework.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.Services.Protocols.SoapRpcMethodAttribu te("urn://MyRoot/MyServic
es/MyWSCall",
RequestNamespace="urn://MyRoot/MyServices",
ResponseNamespace="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.Services.Protocols.SoapDocumentMethodAt tribute("urn://MyRoot/MyS
ervices/MyWSCall",
RequestNamespace="urn://MyRoot/MyServices",
ResponseNamespace="urn://MyRoot/MyServices",
Use=System.Web.Services.Description.SoapBindingUse .Encoded,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("resu lt")]
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.Services.Protocols.SoapRpcMethodAttribu te("urn://MyRoot/MyServic
es/MyWSCall",
RequestNamespace="urn://MyRoot/MyServices",
ResponseNamespace="urn://MyRoot/MyServices",
Use=System.Web.Services.Description.SoapBindingUse .Encoded)]
[return: System.Xml.Serialization.XmlElementAttribute("resu lt")]
public object MyWSCall(int CallId, string XMLString) {
*snip*
Differences:
1.
changed:
SoapDocumentMethodAttribute
to
SoapRpcMethodAttribute
and
2.
removed:
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped
But it still beats me.
Question 1:
Why was the "SoapDocumentMethodAttribute" with
"ParameterStyle=System.Web.Services.Protocols.Soap ParameterStyle.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="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://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="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:s0="http://MyRoot/MyServices"
targetNamespace="http://MyRoot/MyServices"
<types>
<s:schema elementFormDefault="qualified"
targetNamespace="http://MyRoot/MyServices">
<s:element name="MyWSCall">
<s:complexType>
<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="MyWSCallResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="result" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="MyWSCallSoapIn">
<part name="parameters" element="s0:MyWSCall" />
</message>
<message name="MyWSCallSoapOut">
<part name="parameters" element="s0:MyWSCallResponse" />
</message>
<portType name="TargetSystemSoap">
<operation name="MyWSCall">
<input message="s0:MyWSCallSoapIn" />
<output message="s0:MyWSCallSoapOut" />
</operation>
</portType>
<binding name="TargetSystemSoap" type="s0:TargetSystemSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="MyWSCall">
<soap:operation soapAction="http://MyRoot/MyServices/MyWSCall"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="TargetSystem">
<port name="TargetSystemSoap" binding="s0:TargetSystemSoap">
<soap:address
location="http://localhost/Projects/TargetSystem/TargetSystem.asmx" />
</port>
</service>
</definitions>
Regards and thanks,
Andi