Hi,
I'm been trying like crazy but I'm not able to specify the correct WSDL
type definitions for the following:
i.e. the SOAP request XML is:
<status code="100">All Fine</status>
How do we write the WSDL definition for this XML?
I started by defining the status type.
So,
<xsd:element name="status" type="typens:statusType"/>
Then, i define the statusType to have an attribute
<xsd:complexType name="statusType">
<xsd:attribute name="code" type="xsd:string"/>
</xsd:complexType>
But I'm stuck at how to specify that the status element also would need
to have a string data.
Thanks,
Rohan
Josh Twist - 21 Feb 2006 08:02 GMT
Hi Rohan,
In c# the type might look like this:
[XmlRoot("status")]
public class Status
{
[XmlAttribute("code")]
public int Code;
[XmlText]
public string Value;
}
Which wsdl.exe turns into
<s:complexType name="Status">
<s:simpleContent>
<s:extension base="s:string">
<s:attribute name="code" type="s:int" use="required" />
</s:extension>
</s:simpleContent>
</s:complexType>
Josh
http://www.thejoyofcode.com/