473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

How to diagnose SoapHttpClientProtocol.Invoke() failures

We have run into a problem trying to build a client which works with a
web service implemented against the WSDL at [1]. We have successfully
created clients using other tools than the DotNet framework, and in fact
we were able to create a client using an earlier version of the
framework (1.1.4322.2032) without any problems. With the current
version of the framework (2.0.50727.42) it appears that the Invoke
method of the SoapHttpClientProtocol base class is returning a
one-element array of objects, and that element is Null. The service is
returning the same response (which we can confirm with the server logs),
but we have no idea how to find out why the new client doesn't know what
to do with this response. I would have expected an exception to be
thrown if the Invoke() method thought the response didn't look the way
it thought it should (hopefully with some diagnostic information
attached). So here's our question: what techniques are available for
trying to determine the cause of the failure? (Some way to turn on
trace logs for what the client thinks it's looking at, for example.)
Many thanks for any suggestions anyone has to offer.

[1] http://bach.nci.nih.gov/cgi-bin/aaciservicev1.py

Bob Kline
Dec 2 '05 #1
6 13550
Bob,

I profiled the call to that service from a .NET 2.0 application using
SoapScope www.mindreef.net . The data was coming back from the service.
Something's going wrong in deserialization.

I saved off the raw XML result from the service using SoapScope and
then tried to deserialize the XML into the Protocol type in
Reference.cs (generated from Web Reference) and it failed (validating a
serialization problem).

I removed the XmlSchemaForm.UnQualified from the XmlArray and
XmlArrayItem attributes decorating the "getProtocols" method and from
the XmlElement attributes decorating the properties of the "Protocol"
class and everything worked.

E-mail me if you want me to just send you my working Reference.cs file.
danmork *A*T* gmail dawt com.

Cheers,
~Mork
Bob Kline wrote:
We have run into a problem trying to build a client which works with a
web service implemented against the WSDL at [1]. We have successfully
created clients using other tools than the DotNet framework, and in fact
we were able to create a client using an earlier version of the
framework (1.1.4322.2032) without any problems. With the current
version of the framework (2.0.50727.42) it appears that the Invoke
method of the SoapHttpClientProtocol base class is returning a
one-element array of objects, and that element is Null. The service is
returning the same response (which we can confirm with the server logs),
but we have no idea how to find out why the new client doesn't know what
to do with this response. I would have expected an exception to be
thrown if the Invoke() method thought the response didn't look the way
it thought it should (hopefully with some diagnostic information
attached). So here's our question: what techniques are available for
trying to determine the cause of the failure? (Some way to turn on
trace logs for what the client thinks it's looking at, for example.)
Many thanks for any suggestions anyone has to offer.

[1] http://bach.nci.nih.gov/cgi-bin/aaciservicev1.py

Bob Kline


Dec 2 '05 #2
Mork wrote:
Bob,

I profiled the call to that service from a .NET 2.0 application using
SoapScope www.mindreef.net . The data was coming back from the service.
Something's going wrong in deserialization.

I saved off the raw XML result from the service using SoapScope and
then tried to deserialize the XML into the Protocol type in
Reference.cs (generated from Web Reference) and it failed (validating a
serialization problem).

I removed the XmlSchemaForm.UnQualified from the XmlArray and
XmlArrayItem attributes decorating the "getProtocols" method and from
the XmlElement attributes decorating the properties of the "Protocol"
class and everything worked.


Bingo! Thanks for your quick and helpful reply. I was able to get it
to work here, too, by replacing "Unqualified" with "Qualified"
everywhere in the code generated by the wsdl tool. Is this a bug in
wsdl.exe, or a gap in my understanding of how to use it? If the latter,
then it would be good to know why clients built with earlier versions of
the tool worked perfectly with this same service.

Reading the documentation for the XmlSchemaForm enumeriation, I see that
"Unqualified" is supposed to mean "Elements and attributes are not
required to be qualified with a namespace prefix." First, I would have
thought that this phrase meant something different than "Elements and
attributes are not allowed to be qualified with a namespace prefix."
Second, I'm puzzled as to why the tool would have made this assumption
(whichever meaning it intended), in light of the fact that the WSDL
specifies a target namespace.

Are we dealing with a known defect? If so, does anyone have a KB number
and/or a workaround (other than hacking code generated by the wsdl tool,
which isn't a solution available to someone trying to build a client
with the wizards in Visual Studio, as was the case for a developer in
one of our collaborating organizations)?

If this isn't a known problem, how did you know it was caused by the
Unqualified attribute?

Again, many thanks for your help.

Bob
Dec 3 '05 #3
hi Bob,

I think Mork may get the conclusion from comparing the SOAP message
captured with the proxy class's declaration. I've also tested on my side
and seems the VS2003 and VS2005 projects behavior are identical. However
,as you mentioned that the autogenerated proxy in .NET 1.1 (vs2003) worked
on your side?

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.)

--------------------
Date: Sat, 03 Dec 2005 16:48:41 -0500
From: Bob Kline <bk****@community.nospam>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Subject: Re: How to diagnose SoapHttpClientProtocol.Invoke() failures
References: <ui**************@TK2MSFTNGP11.phx.gbl>
<11**********************@z14g2000cwz.googlegroups .com>
In-Reply-To: <11**********************@z14g2000cwz.googlegroups .com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <uK**************@TK2MSFTNGP15.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: xp.rksystems.com 66.92.147.61
Lines: 1
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
microsoft.public.dotnet.framework.webservices:1292 9
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Mork wrote:
Bob,

I profiled the call to that service from a .NET 2.0 application using
SoapScope www.mindreef.net . The data was coming back from the service.
Something's going wrong in deserialization.

I saved off the raw XML result from the service using SoapScope and
then tried to deserialize the XML into the Protocol type in
Reference.cs (generated from Web Reference) and it failed (validating a
serialization problem).

I removed the XmlSchemaForm.UnQualified from the XmlArray and
XmlArrayItem attributes decorating the "getProtocols" method and from
the XmlElement attributes decorating the properties of the "Protocol"
class and everything worked.


Bingo! Thanks for your quick and helpful reply. I was able to get it
to work here, too, by replacing "Unqualified" with "Qualified"
everywhere in the code generated by the wsdl tool. Is this a bug in
wsdl.exe, or a gap in my understanding of how to use it? If the latter,
then it would be good to know why clients built with earlier versions of
the tool worked perfectly with this same service.

Reading the documentation for the XmlSchemaForm enumeriation, I see that
"Unqualified" is supposed to mean "Elements and attributes are not
required to be qualified with a namespace prefix." First, I would have
thought that this phrase meant something different than "Elements and
attributes are not allowed to be qualified with a namespace prefix."
Second, I'm puzzled as to why the tool would have made this assumption
(whichever meaning it intended), in light of the fact that the WSDL
specifies a target namespace.

Are we dealing with a known defect? If so, does anyone have a KB number
and/or a workaround (other than hacking code generated by the wsdl tool,
which isn't a solution available to someone trying to build a client
with the wizards in Visual Studio, as was the case for a developer in
one of our collaborating organizations)?

If this isn't a known problem, how did you know it was caused by the
Unqualified attribute?

Again, many thanks for your help.

Bob

Dec 5 '05 #4
Steven Cheng[MSFT] wrote:
hi Bob,

I think Mork may get the conclusion from comparing the SOAP message
captured with the proxy class's declaration. I've also tested on my side
and seems the VS2003 and VS2005 projects behavior are identical. However
,as you mentioned that the autogenerated proxy in .NET 1.1 (vs2003) worked
on your side?


It did, but I found an earlier version of the WSDL, from which the stub
that worked was generated. The only difference was that that version
had the elementFormDefault attribute of the schema element explicitly
set to "qualified"; when I restored this attribute and rebuilt the .Net
client, it worked again. So apparently although the MSDN documentation
says that 'unqualified' means "Elements and attributes are not required
to be qualified with a namespace prefix" the framework is behaving as if
it means "Elements and attributes are not allowed to be qualified with a
namespace prefix." As noted earlier, other toolsets don't appear to
have any problems with the service using either version of the WSDL, and
since clients built with .Net only work with one version, I'll work
around the problem by having the service use that version.

Again, thanks for everyone's help in diagnosing the problem.

Cheers,
Bob
Dec 5 '05 #5
Bob,

The problem was that the XML returned by their service did not conform
to their schema. In their schema (as of last Friday), the type
"Protocol" was defined in the "urn:uddi-aaci-org:protocols" namespace
and (*this is the important part*) the schema did not specify
"elementFormDefault" (therefore elementFormDefault was unqualified).

An "elementFormDefault" value of qualified means that an unqualified
element is in the default namespace defined on an ancestor. If it is
"unqualified" then an unqualified element is in the empty namespace
(xmlns=""). The default is "unqualified".

They returned a the following: "<Protocol>...</Protocol>". This is the
same as this: "<Protocol xmlns=''>...</Protocol>". Their schema said
that you should expect this: "<Protocol
xmlns='urn:uddi-aaci-org:protocols'>...</Protocol>". The processor does
not assume this unqualified "Protocol" element is in the default
namespace of 'urn:uddi-aaci-org:protocols' defined on
getProtocolsResult b/c of the elementFormDefault of unqualified.
Therefore, the proxy class was correct to give you null meaning that
there were no urn:uddi-aaci-org:protocols#Protocol elements in the
result XML. No bug.

I notice today that they've since fixed the problem in the XML schema
by adding elementFormDefault="qualified" so if you regenerate your
proxy ("Update Web Reference") in VS 2005 it should work beautifully
for you.

Cheers,
~Mork

Dec 5 '05 #6
Great explanation Mork,

Thanks for your knowledge sharing :-)

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
From: "Mork" <da*****@gmail.com>
Newsgroups: microsoft.public.dotnet.framework.webservices
Subject: Re: How to diagnose SoapHttpClientProtocol.Invoke() failures
Date: 5 Dec 2005 09:44:17 -0800
Organization: http://groups.google.com
Lines: 32
Message-ID: <11*********************@g14g2000cwa.googlegroups. com>
References: <ui**************@TK2MSFTNGP11.phx.gbl>
<11**********************@z14g2000cwz.googlegroups .com>
<uK**************@TK2MSFTNGP15.phx.gbl>
<OK**************@TK2MSFTNGXA02.phx.gbl>
<O#*************@TK2MSFTNGP12.phx.gbl>
NNTP-Posting-Host: 192.28.2.17
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1133804662 14839 127.0.0.1 (5 Dec 2005 17:44:22
GMT)
X-Complaints-To: gr**********@google.com
NNTP-Posting-Date: Mon, 5 Dec 2005 17:44:22 +0000 (UTC)
In-Reply-To: <O#*************@TK2MSFTNGP12.phx.gbl>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 us-ecdn-mn-stpinet243 (NetCache NetApp/6.0.1P2)
Complaints-To: gr**********@google.com
Injection-Info: g14g2000cwa.googlegroups.com; posting-host=192.28.2.17;
posting-account=PaTdRg0AAADA36dFZ_8Q2VJvudkD0iVm
Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.d ca.giganews.com!nntp.gigan
ews.com!postnews.google.com!g14g2000cwa.googlegrou ps.com!not-for-mail
microsoft.public.dotnet.framework.webservices:1294 1
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Bob,

The problem was that the XML returned by their service did not conform
to their schema. In their schema (as of last Friday), the type
"Protocol" was defined in the "urn:uddi-aaci-org:protocols" namespace
and (*this is the important part*) the schema did not specify
"elementFormDefault" (therefore elementFormDefault was unqualified).

An "elementFormDefault" value of qualified means that an unqualified
element is in the default namespace defined on an ancestor. If it is
"unqualified" then an unqualified element is in the empty namespace
(xmlns=""). The default is "unqualified".

They returned a the following: "<Protocol>...</Protocol>". This is the
same as this: "<Protocol xmlns=''>...</Protocol>". Their schema said
that you should expect this: "<Protocol
xmlns='urn:uddi-aaci-org:protocols'>...</Protocol>". The processor does
not assume this unqualified "Protocol" element is in the default
namespace of 'urn:uddi-aaci-org:protocols' defined on
getProtocolsResult b/c of the elementFormDefault of unqualified.
Therefore, the proxy class was correct to give you null meaning that
there were no urn:uddi-aaci-org:protocols#Protocol elements in the
result XML. No bug.

I notice today that they've since fixed the problem in the XML schema
by adding elementFormDefault="qualified" so if you regenerate your
proxy ("Update Web Reference") in VS 2005 it should work beautifully
for you.

Cheers,
~Mork
Dec 6 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Capt. Stinky | last post by:
Newbie question here... Is there any way to get a wsdl.exe generated proxy to dump the outbound XML it sent ( or will send ) to a web service? Thanks for any info... CS
1
by: Gregory Hassett | last post by:
Hi, I have a web service called GetComputerNameAndDescription which I can call from the main thread of my app. If I call it from a separate thread, however, it hangs on the call to Invoke() -- but...
0
by: Kim | last post by:
Hi, I am calling a web service from a hand held terminal (running Pocket pc 2002) using the SoapHttpClientProtocol class. Sometimes the terminal gets out of network coverage - in that case I want...
0
by: Samuel | last post by:
Hi, I am trying to access a java webservice. I know the method's signature. I used 'SoapHttpClientProtocol.Invoke' method. This method is builds its own soap message and sends it to the web...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the...
4
by: Jit Prasad | last post by:
I have a working client-side Vb.Net (.net v1.0) app that talks to a Webspere webservice on a windows 2000 server. The client side app runs on a citrix server, also a Windows 2000 server. The app...
0
by: Max M. Power | last post by:
I'm getting an InvalidOperationException calling Invoke with a method parameter object array that contains a two dimentional string array. More stack trace output below: // Create two...
1
by: scott mcfadden | last post by:
I am experiencing intermittent errors upon invoking my web service method. Exception Type: System.InvalidOperationException Exception Source: System.Xml Exception Message: There is an error in...
4
by: cGemm11 | last post by:
Hello. I am having a problem with the SoapHttpClientProtocol recognizing a class hierarchy defined in my WSDL and schema. I am using VC#2008Express to import a WSDL from my SOAP server and build a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.