By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,086 Members | 1,919 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,086 IT Pros & Developers. It's quick & easy.

Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0

P: n/a
Hi,

I have a set of simple webservices calls that worked fine using .NET
Framework 1.0.
I am calling a Java/Apache based webservices, the calling side is not able
to supply a proper WSDL.

What it does is to call a webservice with two parameters, one being a
integer, the other one being a "String" which contains XML (not the best
practice, however that is the target interface and we cannot change that).
Our return parameter itself is a "String" containing XML.

In .NET 1.0 it worked fine and we got the XmlString back. In .NET 1.1 or
..NET 2.0 the framework only returns a "null" (running into exceptions then).
So I suspect that our proxy settings are not correct and in .NET 1.0 the
XmlSerializer maybe was not so strict in comparison to 1.1/2.0 .
We have the following proxy that worked in .NET 1.0 (I had to rename some
variable names and namespaces to protect the client's identity):
namespace Our.Name.Space.Here
{
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="TargetSystemSoap",
Namespace="urn://MyRoot/MyServices")]
public class Proxy : System.Web.Services.Protocols.SoapHttpClientProtoc ol
{
public Proxy
(
string sUrl
)
{
this.Url = sUrl;
}
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("urn://MyRoot/MyServices/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) {
object[] results = this.Invoke("MyWSCall", new object[] {
CallId,
XMLString});
return ((object)(results[0]));
}

public System.IAsyncResult BeginMyWSCall(int CallId, string XMLString,
System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("MyWSCall", new object[] {
CallId,
XMLString}, callback, asyncState);
}
public object EndMyWSCall(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((object)(results[0]));
}
}
}
Our "return" is essentially this:

<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns1:MyWSCallResponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;
&lt;Response xmlns=&quot;MyNameSpace/MyResponse&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-ins...;/Response&gt;
</return>
</ns1:MyWSCallResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

What do we need to adapt in the proxy to reflect the return structure in a
way that the .NET-Framework will give us the XmlString as it is?

(We tinkered already with "Qualified/Unqualified" settings - but with no
result yet).
Regards,

Andi
Nov 23 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
errata:

"MSDNAndi" wrote:
I am calling a Java/Apache based webservices, the calling side is not able
to supply a proper WSDL.

I meant:
"the called side" instead of "the calling side"
Nov 23 '05 #2

P: n/a
Hi,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 23 '05 #3

P: n/a
Hi Andi,

Regarding on the consuming java/RPC style webservcie in .net 1.1/2.0
problem. Based on my experience, such style webservice (return xml through
string parameter ) is not quite good and somewhat violate the webservice
interop recommendation. How did you used to create the .NET client proxy?
Through a dummy .NET webservice? I've just tried create a .NET webservice
which return a string value (contains XML data). Then, I created a .NET
client proxy through this service and got it working with the following
respones SOAP message:

====================
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns1:MyWSCallResponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;
&lt;Response xmlns=&quot;MyNameSpace/MyResponse&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-ins...;&gt;something
&lt;/Response&gt;
</return>
</ns1:MyWSCallResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
========================

Here is my dummy webservice's code:

=====================
[WebService(Namespace="urn://MyRoot/MyServices")]
[SoapRpcService()]
public class DummyService : System.Web.Services.WebService
{
//................

[WebMethod()]
[SoapRpcMethod()]
[return:XmlElement("return")]
public string MyWSCall()
{
return "<myXml><items><item>aaa</item><item>bbb</item></items></myXml>";
}

//................

}
========================
#Note that we mark the webMethod as "SoapRpcMethod" attribute so that the
generated webservcie client proxy will also contains such attribute.
Please have a test on your side to see whether it helps.

Thanks,

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: AcXsfZgX+XNm1tfMTNmCHhUl8OE8AQ==
X-WBNR-Posting-Host: 84.176.218.52
From: "=?Utf-8?B?TVNETkFuZGk=?=" <MS******@noemail.noemail>
References: <OO**************@TK2MSFTNGP11.phx.gbl>
Subject: RE: Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0
Date: Fri, 18 Nov 2005 12:21:01 -0800
Lines: 7
Message-ID: <82**********************************@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!TK2MSFTNGXA03.phx.gbl
microsoft.public.dotnet.framework.webservices:1278 2
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

errata:

"MSDNAndi" wrote:
I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL.

I meant:
"the called side" instead of "the calling side"

Nov 23 '05 #4

P: n/a
Hi Steven,

to summarize. I am on the client-side of the webservice communication.
The client-side proxy was initially created based on a WSDL that someone put
together trying to mimick an example response we got from the
server-webservice we are trying to call.
(Actually several proxies were then copy/pasted together to form one class
for a set of very similar webservices.)
I know that the idea to put XML-Data in a string is NOT good. However, the
webservice-call itself does not evaluate that data but handles it as a
string, only the calling component then processes the string as XML. The
"null" response happens before, so this should not be an issue. Plus: We have
no chance to alter the response we are getting in any way, we just need to be
able to process it.
Also we have no chance to get a WSDL supplied by the target webservice
server. So, we could engineer a working WSDL that then results in a working
proxy. However this would be no better than just fixing the proxy which I
would strongly prefer. I need to specifically make sure that the calls I make
are exactly the same (to the byte) than before, so I hope to be able to just
fix the "result" processing of the proxy.
I will see if I can recreate the problem with something you can reproduce
easily.

Regards,

Andi

"Steven Cheng[MSFT]" wrote:
Hi Andi,

Regarding on the consuming java/RPC style webservcie in .net 1.1/2.0
problem. Based on my experience, such style webservice (return xml through
string parameter ) is not quite good and somewhat violate the webservice
interop recommendation. How did you used to create the .NET client proxy?
Through a dummy .NET webservice? I've just tried create a .NET webservice
which return a string value (contains XML data). Then, I created a .NET
client proxy through this service and got it working with the following
respones SOAP message:

====================
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns1:MyWSCallResponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string"><?xml version="1.0"
encoding="UTF-8"?>
<Response xmlns="MyNameSpace/MyResponse"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">something
</Response>
</return>
</ns1:MyWSCallResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
========================

Here is my dummy webservice's code:

=====================
[WebService(Namespace="urn://MyRoot/MyServices")]
[SoapRpcService()]
public class DummyService : System.Web.Services.WebService
{
//................

[WebMethod()]
[SoapRpcMethod()]
[return:XmlElement("return")]
public string MyWSCall()
{
return "<myXml><items><item>aaa</item><item>bbb</item></items></myXml>";
}

//................

}
========================
#Note that we mark the webMethod as "SoapRpcMethod" attribute so that the
generated webservcie client proxy will also contains such attribute.
Please have a test on your side to see whether it helps.

Thanks,

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: AcXsfZgX+XNm1tfMTNmCHhUl8OE8AQ==
X-WBNR-Posting-Host: 84.176.218.52
From: "=?Utf-8?B?TVNETkFuZGk=?=" <MS******@noemail.noemail>
References: <OO**************@TK2MSFTNGP11.phx.gbl>
Subject: RE: Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0
Date: Fri, 18 Nov 2005 12:21:01 -0800
Lines: 7
Message-ID: <82**********************************@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!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1278 2
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

errata:

"MSDNAndi" wrote:
I am calling a Java/Apache based webservices, the calling side is not

able
to supply a proper WSDL.

I meant:
"the called side" instead of "the calling side"

Nov 23 '05 #5

P: n/a
Thanks for your quick response Andi,

Yes, I've got your actual scenario and the limitation you current met. So I
built the following dummy webservcie(pasted in my last message) which can
help generate a webservice client proxy (through VS.NET's add
webreference) and correctly parse the Soap message you mentioned:

====================
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns1:MyWSCallResponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">&lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&gt;
&lt;Response xmlns=&quot;MyNameSpace/MyResponse&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-ins...;&gt;something
&lt;/Response&gt;
</return>
</ns1:MyWSCallResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
========================

Have you tried creating a .net proxy through it and testing by your java
webservice? Anyway, here is the generated client proxy on myside which can
correctly accept the above SOAP response message:

=========================
namespace ServiceConsoleApp.DummyService {
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]

[System.Web.Services.WebServiceBindingAttribute(Nam e="DummyServiceSoap",
Namespace="urn://MyRoot/MyServices")]
public class DummyService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

/// <remarks/>
public DummyService() {
this.Url =
"http://localhost/StevenRoot/WebServices/TestService/DummyService.asmx";
}

/// <remarks/>

[System.Web.Services.Protocols.SoapRpcMethodAttribu te("urn://MyRoot/MyServic
es/MyWSCall", RequestNamespace="urn://MyRoot/MyServices",
ResponseNamespace="urn://MyRoot/MyServices")]
public string MyWSCall() {
object[] results = this.Invoke("MyWSCall", new object[0]);
return ((string)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BeginMyWSCall(System.AsyncCallback
callback, object asyncState) {
return this.BeginInvoke("MyWSCall", new object[0], callback,
asyncState);
}

/// <remarks/>
public string EndMyWSCall(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
}
}
=============================

I tested it on my windows 2003 server with VS.NET 2003.

Thanks,

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: AcXumGpzvcxx4Z7qSke92dZ1rYTsFA==
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>
Subject: RE: Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0
Date: Mon, 21 Nov 2005 04:38:03 -0800
Lines: 134
Message-ID: <BA**********************************@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 0
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven,

to summarize. I am on the client-side of the webservice communication.
The client-side proxy was initially created based on a WSDL that someone
put
together trying to mimick an example response we got from the
server-webservice we are trying to call.
(Actually several proxies were then copy/pasted together to form one class
for a set of very similar webservices.)
I know that the idea to put XML-Data in a string is NOT good. However, the
webservice-call itself does not evaluate that data but handles it as a
string, only the calling component then processes the string as XML. The
"null" response happens before, so this should not be an issue. Plus: We
have
no chance to alter the response we are getting in any way, we just need to
be
able to process it.
Also we have no chance to get a WSDL supplied by the target webservice
server. So, we could engineer a working WSDL that then results in a working
proxy. However this would be no better than just fixing the proxy which I
would strongly prefer. I need to specifically make sure that the calls I
make
are exactly the same (to the byte) than before, so I hope to be able to
just
fix the "result" processing of the proxy.
I will see if I can recreate the problem with something you can reproduce
easily.

Regards,

Andi

"Steven Cheng[MSFT]" wrote:
Hi Andi,

Regarding on the consuming java/RPC style webservcie in .net 1.1/2.0
problem. Based on my experience, such style webservice (return xml through string parameter ) is not quite good and somewhat violate the webservice
interop recommendation. How did you used to create the .NET client proxy? Through a dummy .NET webservice? I've just tried create a .NET webservice which return a string value (contains XML data). Then, I created a .NET
client proxy through this service and got it working with the following
respones SOAP message:

====================
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<ns1:MyWSCallResponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string"><?xml version="1.0"
encoding="UTF-8"?>
<Response xmlns="MyNameSpace/MyResponse"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">something
</Response>
</return>
</ns1:MyWSCallResponse>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
========================

Here is my dummy webservice's code:

=====================
[WebService(Namespace="urn://MyRoot/MyServices")]
[SoapRpcService()]
public class DummyService : System.Web.Services.WebService
{
//................

[WebMethod()]
[SoapRpcMethod()]
[return:XmlElement("return")]
public string MyWSCall()
{
return "<myXml><items><item>aaa</item><item>bbb</item></items></myXml>"; }

//................

}
========================
#Note that we mark the webMethod as "SoapRpcMethod" attribute so that the
generated webservcie client proxy will also contains such attribute.
Please have a test on your side to see whether it helps.

Thanks,

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: AcXsfZgX+XNm1tfMTNmCHhUl8OE8AQ==
X-WBNR-Posting-Host: 84.176.218.52
From: "=?Utf-8?B?TVNETkFuZGk=?=" <MS******@noemail.noemail>
References: <OO**************@TK2MSFTNGP11.phx.gbl>
Subject: RE: Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0
Date: Fri, 18 Nov 2005 12:21:01 -0800
Lines: 7
Message-ID: <82**********************************@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!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.webservices:1278 2
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

errata:

"MSDNAndi" wrote:
I am calling a Java/Apache based webservices, the calling side is not

able
to supply a proper WSDL.

I meant:
"the called side" instead of "the calling side"


Nov 23 '05 #6

P: n/a
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/MyServices/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/MyServices/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/MyServices/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

Nov 23 '05 #7

P: n/a
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
Nov 23 '05 #8

P: n/a
Hi Steven

Excellent work.
Too bad I did not post it via the web-interface initially with marking it as
a question, so I cannot mark this as "does this post answer your question:
yes".

Case closed (let's hope it is not just "for now" :) ).

Thanks a lot.

Regards,

Andi
Nov 23 '05 #9

P: n/a
You're welcome Andi,

Also, hope more and more webservice can begin utilizing the
Document/Literal style so that we can avoid many interop issues.

Good luck!

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: AcXvPl/lRdVnqWeqQM62r9lzL5phcQ==
X-WBNR-Posting-Host: 84.167.250.6
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>
<1A**********************************@microsoft.co m>
<7K*************@TK2MSFTNGXA02.phx.gbl>
Subject: RE: Ws Proxy: working in .NET 1.0, null return in .NET 1.1 or 2.0
Date: Tue, 22 Nov 2005 00:26:02 -0800
Lines: 14
Message-ID: <64**********************************@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:1280 4
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Hi Steven

Excellent work.
Too bad I did not post it via the web-interface initially with marking it
as
a question, so I cannot mark this as "does this post answer your question:
yes".

Case closed (let's hope it is not just "for now" :) ).

Thanks a lot.

Regards,

Andi

Nov 23 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.