exception on Response Envelope, Error in XML-document

i am desparetely trying to consume a PHP Webservice in VB.NET 2005.
I can add the webreference, compile without errors and see the methods of
the webservice.
But on runtime it tells me {"There is an error in XML document (6, 62)."}.
Inner Exception:
{"Cannot assign object of type System.Xml.XmlNode[] to an object of type
System.String."}

Envelope that comes from the webservice:
_________________________________________

Relevant part of WSDL (no complex types because i did not get them to import
at all in .NET):
__________________________
<message name="getArticleDetailsRequest">
<part name="artId" type="xsd:int"/>
</message>

Advertisements

I agree with John that the problem is likely caused by the type mismatching
between the generated webservice client proxy and the corresponding object
member in the SOAP response message. As the following line indicates:

the webservice proxy class contains a string member while the SOAP response
message return an node list(array), at least the .net webservice
deserializer deserialize it into a nodelist which cause the type
mismatching problem.

Please feel free to post some further info(like WSDL document) so that we
can have a look and perform some test on it.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) athttp://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

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

> Hello!
>>
>> i am desparetely trying to consume a PHP Webservice in VB.NET 2005.
....
>>
>> Relevant part of WSDL (no complex types because i did not get them to
>> import at all in .NET):
>> __________________________
>> <message name="getArticleDetailsRequest">
>> <part name="artId" type="xsd:int"/>
>> </message>
>>
>> <message name="getArticleDetailsResponse">
>> <part name="details" type="xsd:ArrayOfString"/>
>> </message>
>> ____________
>>
>> Strange: I defined ArrayOfString, but .NET expects just string.
>
> Please post the WSDL, so we can see _how_ you defined ArrayOfString.
>
> Also, why did you define it in the "xsd" namespace? That's not your
> namespace, so you don't get to change it.
>
> Also, it doesn't look like the service is sending ArrayOfString, unless
> ArrayOfString is the same thing as ns2:Map.
> --
> John Saunders [MVP]
>

John and Steven,

thank you very much!
In Meantime i played so that the problem is slightly different.
PHP - Server works,
Can build proxy and can intellisense everything
But in VB.NET
Dim test As New de.myhandicapexpert.MyHandicapExperts

Dim res As New de.myhandicapexpert.ArticleDetailsResponse

res = test.GetArticleDetails("asdf", 3)

Return res.header

I get a nullreferenceException in the last line. So i think .NET does not
like something in the response envelope.

now i have an alternative response - envelope, but with exactly the same
result:
(It has tags for the element names instead of </xsd:string>)
What can i try to debug it in VB.NET? Where can i see what the proxy-class
does? BTW: I do not find the proxy class in my project. I can create my own
with wsdl.exe but i do not find the one created on adding the webservice...
Please can anybody help? I'm working on this since 60 hours now and could
not get one step further.
Dirk

one more silly thing:
Please can somebody explain, why i get no Exception
in first line
and after invoking GetArticleDetails i get an exception in third line?
- - - - - - - - - - - - - - - - -
'This is OK:
myHash = resType.GetHashCode

then there is no exception
I do not need GetHashCode. I try to say that I can't do anything with
resType anymore after i called the function GetArticleDetails(). This works
too. But if i try to get one of its members afterwards (and even if it is
the trivial GetHashCode), I get that exception at runtime.

Yes, as John said, would you show us the relationship between the resType
and the proxy object(test), from the code snippet it really unexpected to
get such a result.

Also, for the proxy class code question you mentioned earlier, have you
found it? For the proxy generated by "Add WebReference in VS IDE", you can
view it as below:

** if the proxy class is generated in winform or console or class library
project, you can select and click the certain webreference node in solution
explorer(or expand the node) to find the autogenerated xxx.designer.cs(or
vb) file. The code of the proxy is in it.

** For ASP.NET web project(not web application project), the proxy code is
dynamically generated and compiled, so you can not find any pregenerated
code in project folder at design-time. Also, the autogenerated code mainly
contains some class and method definition and does not contain any info
about the underlying XML processing.

BTW, is there an external URL we can visit and test?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

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

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!