all groups > dotnet web services > march 2007 >
You're in the

dotnet web services

group:

Problem with invoking web method


Problem with invoking web method Marek Suski
3/28/2007 10:46:44 PM
dotnet web services:
Hi all,

I am getting following error while a user is trying to execute web method
from proxy class (proxy class inhertis from WebServicesClientProtocol class)

System.Xml.XmlException: There is an unclosed literal string. Line 1,
position 129.
at System.Xml.XmlScanner.ScanLiteral()
at System.Xml.XmlTextReader.SetLiteralValues(XmlAttributeTokenInfo fld)
at System.Xml.XmlTextReader.SetAttributeValues()
at System.Xml.XmlTextReader.ParseElement()
at System.Xml.XmlTextReader.Read()
at Microsoft.Web.Services2.Xml.XmlSkipDTDReader.Read()
at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean
preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at Microsoft.Web.Services2.SoapEnvelope.Load(Stream stream)
at Microsoft.Web.Services2.OutputStream.Close()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at XXX.YYY.ZZZ.WebService.HelloWorld(HelloWorldRequest helloWorldRequest)

This happens only on one of the users machine and I cannot use VisualStudio
to debug it :(. I am able to save to a file parameters of that web method
and they looks fine. Further more I have create a soap extension that
(SoapLogger : SoapExtension) that should help me with logging what I am
sending and recieving. For that purpose I have overridden ProcessMessage
function where I am serializing message stream to a file. That code works
fine on my machine but on user fails :(. I am still getting same error as
above.

Does anybody knows what I should do to be able to log some debug inforation
that will help me to find solution for above error?

Best regards

Marek S

RE: Problem with invoking web method stcheng NO[at]SPAM online.microsoft.com
3/29/2007 12:00:00 AM
Hello Marek,

From your description, you're getting the following exception when
consuming a certain webservice on a partiuclar client machine, correct?

[quoted text, click to view]
System.Xml.XmlException: There is an unclosed literal string. Line 1,
<<<<<<<<<<<<<<

Based on my experience, such exception is normally caused by some
parameters passed in webmethod contains invalid string. For example, when
you directly pass string parameter that contains XML reserved
characters(such as < > & ), it will make the SOAP xml message
corrupted. Here is a web thread discussing on this:

http://forums.microsoft.com/msdn/showpost.aspx?postid=14221&siteid=1

Also, from your test, you mentioned that the error occured even before soap
extension be able to log the message ,correct? That means the problem
occurs at the very begining (at client) when the runtime try parsing the
serialized soap XML content. Based on the code snippet you provided, the
webmethod's signature is as below:

==============
HelloWorld(HelloWorldRequest helloWorldRequest)
==============

So the only possible cause if the HelloWorldRequest class(regardless of
any environment &platform problem), would you provide detail definiation of
this body class. And is that particular problem client always pass some
particular string data into the HelloWorldRequest instance?

In addition, for that problem machine, you can check its .net framework
version and latest service pack install status, compare it with other
working client to see whether there is any difference.

Please feel free to let me know if you have any other finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



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

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



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) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

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



RE: Problem with invoking web method stcheng NO[at]SPAM online.microsoft.com
4/2/2007 11:17:09 AM
Hello Marek,

How are you doing on this issue, have you got any further progress? Based
on the nature of this issue, it may require complex and low level
throubleshooting and debugging skills to inspect further into it, I would
suggest you contact CSS for further assistance if you feel it an urgent
issue:

http://msdn.microsoft.com/subscriptions/support/default.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


AddThis Social Bookmark Button