J
Joe
I have built a webservice which consumes and returns a custom object/class which was generated using XSD.exe from an XML schema. When WSDL.exe generates a proxy class describing the webservice the autogenerated proxy code (generated by WSDL.exe) leaves the namespace and root node definition of the custom object out. When I want to use the proxy class and/or the webreference an exception is thrown because there is no namespace on the root node of the object which is trying to serialize/deserialize to the webmethod. To successfully call the webmethod I have to add a line to the proxy class which is generated by WSDL.exe or via a webreference, it seems the custom object definition is imported into the proxy class and leaves the root node namespace off the object
Here is the example from within the proxy class, "Entities" is the name of the root node of the custom object generated using XSD.ex
This is what is auto-generated within the proxy clas
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://MySchema.Name"
public class Entities
I cannot call the webmethod successfully from a console applciation unless I add the following to it (second line)
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://MySchema.Name"
[System.Xml.Serialization.XmlRoot(Namespace"http://MySchema.Name"]
public class Entities
O
I can add the following piece of code to the console application and successfully call the webmetho
Thanks for the help let me know if you need more info, the basics of it is I cannot call a webmethod using a custom object
-Jo
Here is the example from within the proxy class, "Entities" is the name of the root node of the custom object generated using XSD.ex
This is what is auto-generated within the proxy clas
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://MySchema.Name"
public class Entities
I cannot call the webmethod successfully from a console applciation unless I add the following to it (second line)
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://MySchema.Name"
[System.Xml.Serialization.XmlRoot(Namespace"http://MySchema.Name"]
public class Entities
O
I can add the following piece of code to the console application and successfully call the webmetho
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)
Thanks for the help let me know if you need more info, the basics of it is I cannot call a webmethod using a custom object
-Jo