469,645 Members | 1,971 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Problem with invoking web method

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(XmlAttri buteTokenInfo 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.SoapHttpClientProtoc ol.Invoke(String
methodName, Object[] parameters)
at XXX.YYY.ZZZ.WebService.HelloWorld(HelloWorldReques t 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
Mar 28 '07 #1
2 3490
Hello Marek,

From your description, you're getting the following exception when
consuming a certain webservice on a partiuclar client machine, correct?
>>>>>>>>>>>>>>
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/sho...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/subscripti...ult.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/subscripti...t/default.aspx.

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

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

Mar 29 '07 #2
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/subscripti...t/default.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Apr 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Beenish Sahar Khan | last post: by
3 posts views Thread by trialproduct2004 | last post: by
3 posts views Thread by cartoper | last post: by
3 posts views Thread by Rotsey | last post: by
3 posts views Thread by artev | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.