Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Services Error: There was an error generating the XML document

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
CA
Hi,

I have a web service that returns an object (User), which consists of other user defined objects (UserAttribute).

If i consume the web service in a web form within the same package as the web service, the app works perfectly.

If i consume the web service from another web app, i get a SoapException: Server was unable to process request. --> There was an error generating the XML document. --> The type ActiveDirectoryServices.UserAttribute[] may not be used in this context.

I kinda think it has something to do with making my user object serializable but I tried:

Code:
<XmlIncludeAttribute(GetType(UserAttribute))> Public Class User
 ....
End Class

and that didn't work.

Any suggestions? Thanks!!
 
Nevermind, I've figured it out.

Instead of using the <XmlIncludeAttribute(GetType(UserAttribute))> attribute on the User class, i used it on the web method, and for a UserAttribute ARRAY, not object)

Code:
<WebMethod() ,XmlIncludeAttribute(GetType(UserAttribute()))> Get...

Thanks anyway!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top