Problem with WSDL generation

J

J

Good Morning

When the WSDL.exe and/or webreference generates a proxy class for a webservice which receives/returns a custom object the class representation within the proxy class is incomplete. When the proxy class imports the object definition it leaves the root node attributes off the object root node which causes the code to blow up. (below is the example). Is there a way to foce the inclusion of the root node definition from the object class? Seems sloppy to have to modify the proxy class and/or include code to fix the root node (on very bottom). Any help would be very very appreciated

There are 2 ways to solve the problem I know of which neither I like and was wondering if anyone knew a better solution

Proxy class modification...

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://MySchema.Name")
[System.Xml.Serialization.XmlRoot(Namespace"http://MySchema.Name")] // <--- I HAD TO ADD THIS TO MAKE IT
public class Entities
// ..............


//-----------------------------------------------------------------------
// Code chang
//-----------------------------------------------------------------------
XmlRootAttribute xmlRoot = new XmlRootAttribute()
XmlAttributes attrs = new XmlAttributes()
XmlAttributeOverrides overrides = new XmlAttributeOverrides()
xmlRoot.Namespace = "http://MySchema.Name"
attrs.XmlRoot = xmlRoot
overrides.Add(typeof(KeyIDAccess.Entities), attrs)
serializer = new XmlSerializer(typeof(KeyIDAccess.Entities), overrides)
//
//-----------------------------------------------------------------------
 
D

Dino Chiesa [Microsoft]

Mr Anonymous, I'm betting that people are having trouble understanding what
you're after here.

Can you give us a simpler explanation?
Show us the ASMX.
Show us the WSDL that gets generated.

What do you get from wsdl.exe? What do you expect to get?

Show us the XML on the wire. What do you expect to get?

With this kind of info, you might shake something loose.

-Dino


J said:
Good Morning;

When the WSDL.exe and/or webreference generates a proxy class for a
webservice which receives/returns a custom object the class representation
within the proxy class is incomplete. When the proxy class imports the
object definition it leaves the root node attributes off the object root
node which causes the code to blow up. (below is the example). Is there a
way to foce the inclusion of the root node definition from the object class?
Seems sloppy to have to modify the proxy class and/or include code to fix
the root node (on very bottom). Any help would be very very appreciated.
There are 2 ways to solve the problem I know of which neither I like and
was wondering if anyone knew a better solution.
Proxy class modification....

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://MySchema.Name")
]
[System.Xml.Serialization.XmlRoot(Namespace"http://MySchema.Name")] //
<--- I HAD TO ADD THIS TO MAKE IT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top