Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > error when passing XML doc to web service

Reply
Thread Tools

error when passing XML doc to web service

 
 
Marlon Baskin
Guest
Posts: n/a
 
      08-19-2003
I built a web service that accepts an XML document of type
System.XML.XMLDocument and returns an XML document of the
same type. But when I pass the XML document to the web
service from a client app it throws an
InvalidCastException:

An unhandled exception of
type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll

Additional information: Server was unable to read
request. --> There is an error in XML document (1, 375). --
> Specified cast is not valid.


Is the System.XML.XMLDocument class not a valid type for
passing to web services? Is there a better way to pass
weak-typed XML to the web service (other than just passing
it as a string)? Any help would be appreciated. Thanks!
 
Reply With Quote
 
 
 
 
Daniel Johansson
Guest
Posts: n/a
 
      08-20-2003
Hello

Have you tried to put the xmlDocument inside a dataset instead?
DataSet.ReadXml("nameofxml");
or pass the document as an XmlElement
XmlDocument.DocumentElement;
// Daniel
"Marlon Baskin" <(E-Mail Removed)> skrev i meddelandet
news:0e2701c36661$155e7a80$(E-Mail Removed)...
> I built a web service that accepts an XML document of type
> System.XML.XMLDocument and returns an XML document of the
> same type. But when I pass the XML document to the web
> service from a client app it throws an
> InvalidCastException:
>
> An unhandled exception of
> type 'System.Web.Services.Protocols.SoapException'
> occurred in system.web.services.dll
>
> Additional information: Server was unable to read
> request. --> There is an error in XML document (1, 375). --
> > Specified cast is not valid.

>
> Is the System.XML.XMLDocument class not a valid type for
> passing to web services? Is there a better way to pass
> weak-typed XML to the web service (other than just passing
> it as a string)? Any help would be appreciated. Thanks!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby Socket: I found a misstake in the doc. Can someone confirm itand who's gonna fix this doc-error? kazaam Ruby 3 10-06-2007 01:46 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
String[] files = {"a.doc, b.doc"}; VERSUS String[] files = new String[] {"a.doc, b.doc"}; Matt Java 3 09-17-2004 10:28 PM
Converting a org.jdom DOC to org.w3c DOC Praveen Chhangani XML 2 08-07-2003 08:22 AM
Parsing MS Word client doc into server-side doc... John Wallace ASP .Net 0 07-22-2003 06:49 PM



Advertisments