473,729 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.Diagnost ics;
using System.Xml.Seri alization;
using System;
using System.Web.Serv ices.Protocols;
using System.Componen tModel;
using System.Web.Serv ices;
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]
[System.Web.Serv ices.WebService BindingAttribut e(Name="TargetS ystemSoap",
Namespace="urn://MyRoot/MyServices")]
public class Proxy : System.Web.Serv ices.Protocols. SoapHttpClientP rotocol
{
public Proxy
(
string sUrl
)
{
this.Url = sUrl;
}
[System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("u rn://MyRoot/MyServices/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) {
object[] results = this.Invoke("My WSCall", new object[] {
CallId,
XMLString});
return ((object)(resul ts[0]));
}

public System.IAsyncRe sult BeginMyWSCall(i nt CallId, string XMLString,
System.AsyncCal lback callback, object asyncState)
{
return this.BeginInvok e("MyWSCall", new object[] {
CallId,
XMLString}, callback, asyncState);
}
public object EndMyWSCall(Sys tem.IAsyncResul t asyncResult)
{
object[] results = this.EndInvoke( asyncResult);
return ((object)(resul ts[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:MyWSCallRe sponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
<return xsi:type="xsd:s tring">&lt;?xml version=&quot;1 .0&quot;
encoding=&quot; UTF-8&quot;?&gt;
&lt;Response xmlns=&quot;MyN ameSpace/MyResponse&quot ;
xmlns:xsi=&quot ;http://www.w3.org/2001/XMLSchema-ins...;/Response&gt;
</return>
</ns1:MyWSCallRes ponse>

</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
9 3217
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
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
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:MyWSCallRe sponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
<return xsi:type="xsd:s tring">&lt;?xml version=&quot;1 .0&quot;
encoding=&quot; UTF-8&quot;?&gt;
&lt;Response xmlns=&quot;MyN ameSpace/MyResponse&quot ;
xmlns:xsi=&quot ;http://www.w3.org/2001/XMLSchema-ins...;&gt;something
&lt;/Response&gt;
</return>
</ns1:MyWSCallRes ponse>

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

Here is my dummy webservice's code:

=============== ======
[WebService(Name space="urn://MyRoot/MyServices")]
[SoapRpcService( )]
public class DummyService : System.Web.Serv ices.WebService
{
//............... .

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

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

}
=============== =========
#Note that we mark the webMethod as "SoapRpcMet hod" 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+XNm1tf MTNmCHhUl8OE8AQ ==
X-WBNR-Posting-Host: 84.176.218.52
From: "=?Utf-8?B?TVNETkFuZGk =?=" <MS******@noema il.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************ *************** *******@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 GXA03.phx.gbl
microsoft.publi c.dotnet.framew ork.webservices :12782
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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
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:MyWSCallRe sponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
<return xsi:type="xsd:s tring"><?xml version="1.0"
encoding="UTF-8"?>
<Response xmlns="MyNameSp ace/MyResponse"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">somet hing
</Response>
</return>
</ns1:MyWSCallRes ponse>

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

Here is my dummy webservice's code:

=============== ======
[WebService(Name space="urn://MyRoot/MyServices")]
[SoapRpcService( )]
public class DummyService : System.Web.Serv ices.WebService
{
//............... .

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

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

}
=============== =========
#Note that we mark the webMethod as "SoapRpcMet hod" 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+XNm1tf MTNmCHhUl8OE8AQ ==
X-WBNR-Posting-Host: 84.176.218.52
From: "=?Utf-8?B?TVNETkFuZGk =?=" <MS******@noema il.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************ *************** *******@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 GXA03.phx.gbl
Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :12782
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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
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(past ed 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:MyWSCallRe sponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
<return xsi:type="xsd:s tring">&lt;?xml version=&quot;1 .0&quot;
encoding=&quot; UTF-8&quot;?&gt;
&lt;Response xmlns=&quot;MyN ameSpace/MyResponse&quot ;
xmlns:xsi=&quot ;http://www.w3.org/2001/XMLSchema-ins...;&gt;something
&lt;/Response&gt;
</return>
</ns1:MyWSCallRes ponse>

</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 ServiceConsoleA pp.DummyService {
using System.Diagnost ics;
using System.Xml.Seri alization;
using System;
using System.Web.Serv ices.Protocols;
using System.Componen tModel;
using System.Web.Serv ices;
/// <remarks/>
[System.Diagnost ics.DebuggerSte pThroughAttribu te()]
[System.Componen tModel.Designer CategoryAttribu te("code")]

[System.Web.Serv ices.WebService BindingAttribut e(Name="DummySe rviceSoap",
Namespace="urn://MyRoot/MyServices")]
public class DummyService :
System.Web.Serv ices.Protocols. SoapHttpClientP rotocol {

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

/// <remarks/>

[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() {
object[] results = this.Invoke("My WSCall", new object[0]);
return ((string)(resul ts[0]));
}

/// <remarks/>
public System.IAsyncRe sult BeginMyWSCall(S ystem.AsyncCall back
callback, object asyncState) {
return this.BeginInvok e("MyWSCall", new object[0], callback,
asyncState);
}

/// <remarks/>
public string EndMyWSCall(Sys tem.IAsyncResul t asyncResult) {
object[] results = this.EndInvoke( asyncResult);
return ((string)(resul ts[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: AcXumGpzvcxx4Z7 qSke92dZ1rYTsFA ==
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>
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************ *************** *******@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 :12790
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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:MyWSCallRe sponse xmlns:ns1="urn://MyRoot/MyServices"
SOAP-ENV:encodingSty le="http://schemas.xmlsoap .org/soap/encoding/">
<return xsi:type="xsd:s tring"><?xml version="1.0"
encoding="UTF-8"?>
<Response xmlns="MyNameSp ace/MyResponse"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">somet hing
</Response>
</return>
</ns1:MyWSCallRes ponse>

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

Here is my dummy webservice's code:

=============== ======
[WebService(Name space="urn://MyRoot/MyServices")]
[SoapRpcService( )]
public class DummyService : System.Web.Serv ices.WebService
{
//............... .

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

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

}
=============== =========
#Note that we mark the webMethod as "SoapRpcMet hod" 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+XNm1tf MTNmCHhUl8OE8AQ ==
X-WBNR-Posting-Host: 84.176.218.52
From: "=?Utf-8?B?TVNETkFuZGk =?=" <MS******@noema il.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************ *************** *******@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 GXA03.phx.gbl
Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.webservices :12782
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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
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/MyServices/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/MyServices/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/MyServices/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

Nov 23 '05 #7
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
Nov 23 '05 #8
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
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/lRdVnqWeqQM62r9 lzL5phcQ==
X-WBNR-Posting-Host: 84.167.250.6
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>
<1A************ *************** *******@microso ft.com>
<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************ *************** *******@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 :12804
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11825
by: demonhunter | last post by:
Hi, I am trying to fetch a web content using LWP and HTTP modules behind corp firewall. I set proxy server as shown in my internet explorer connection setup. When i run the script, i got successful response, but the return content is not the webpage i requested at all. It shows something like: ------------------------------------------------- function FindProxyForURL(url,host) { me=myIpAddress();
1
2938
by: Lentdave67t | last post by:
Thank you in advance for any help you can provide. I am writing a C# program that checks to see if the URLs of favorites/bookmarks are still good. The problem I am having is that while the program is checking the URLs, the text in a label on the current window will not update until after all URLs are checked. I think the Form/Window is frozen while the http requests are occuring. Does anyone know of a way I can update the Form in real...
0
4196
by: Leonid | last post by:
Hello, Please help me to resolve next problem: I have Web service installed on the network and I can communicate with it via WSDL file from several applications including VC++6 application using SOAP Toolkit 2. After that I installed VC++ .NET 2003 and tried to generate proxy class using 'Add Web Reference .' menu (SProxy.exe). This wizard just failed to generate right proxy class because it always returns S_OK error code, but can't...
5
3564
by: Farooque Khan | last post by:
Hi, I am consuing a web service in a VC7 application. I included the web service as a 'web reference' and calling it's method. Now I want my application to connect to the web service through a proxy server. Is this possible? if yes, how? I have searched but only found proxy use through C# (WebProxy class), nothing about VC++ 7.
0
1844
by: Xavier - www.andeol.com | last post by:
Hi, My first post on this newsgroup as I have a very strange problem with a WSE client trying to access a .NET WS through a secured HTTP Proxy : it is woking with HTTPS but not with HTTP ?! I am really talking about the same code and only changing the server url. The problem is due to the HTTP proxy authentification but we don't understand why. Using EtherReal, we can see in both cases that the WS client is trying to access the server and...
0
5112
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below the wsdl). This complex type is a collection of another complex type(elementType), and the Reference.cs has an array of these rather than the single returnedElementsType. If If I want to be able to obtain these elements from the SOAP response I...
3
14221
by: Joseph Geretz | last post by:
System.InvalidOperationException: WebServiceBindingAttribute is required on proxy classes. My environment: Visual Studio 2005, targeting FX 2.0; I've developed a Web Service which uses DIME to transfer file attachments to and from the server. I'm using WSE 2.0 SP3 which is supposed to support FX 2.0, as far as I know. (We will soon move on to MTOM, however I'm stuck with DIME for now; the solution was originally written for FX 1.1, and I...
2
5679
by: =?Utf-8?B?U2ltb25EZXY=?= | last post by:
Hi I have a utility class, called MailHandler, that I wrote to read and operate on emails on an Exchange server using WebDAV. The WebDAV SQL statements are sent using an HttpWebRequest object. This worked fine in a .NET 1.1 project. I have copied the same Mailhandler class into a .NET 2.0 project. This, too, worked fine when I initially tested it, running as a Windows Forms app on my machine (running under my network account). ...
7
16165
by: jeddiki | last post by:
Hi, As I am in Turkey at present, I can not see vidoes on youtube. So I have tried a few proxies but keep finding them slow or not working. So I have installed myphpProxy on my server under the domain name www.blog-start.com Unfortuantely it is not not working correctly
0
8913
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8761
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9280
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4525
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.