cyberninja
May 23rd, 2002, 12:25 PM
C# Web Service/Modify instance name in SOAP
In C# Web Service, if we define a String list like:
[WebMethod]
public void QuerySupportedRegValueType(out String[] supportedTypes)
{
supportedTypes = new String[2];
supportedTypes[0] = "Supports type 1";
supportedTypes[1] = "Supports type 2";
}
The SOAP interface generated is:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<QuerySupportedRegValueTypeResponse xmlns="urn:www.intrinsyc.com:service:RegistryManager:1">
<supportedTypes>
<string>string</string>
<string>string</string>
</supportedTypes>
</QuerySupportedRegValueTypeResponse>
</soap:Body>
</soap:Envelope>
What I want is changing <string>string</string> to <SupportedType>string</SupportedType> (The instance name is "SupportedType" and the type is still string ). How should I modify C# source code?
Thanks,
Ming
In C# Web Service, if we define a String list like:
[WebMethod]
public void QuerySupportedRegValueType(out String[] supportedTypes)
{
supportedTypes = new String[2];
supportedTypes[0] = "Supports type 1";
supportedTypes[1] = "Supports type 2";
}
The SOAP interface generated is:
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<QuerySupportedRegValueTypeResponse xmlns="urn:www.intrinsyc.com:service:RegistryManager:1">
<supportedTypes>
<string>string</string>
<string>string</string>
</supportedTypes>
</QuerySupportedRegValueTypeResponse>
</soap:Body>
</soap:Envelope>
What I want is changing <string>string</string> to <SupportedType>string</SupportedType> (The instance name is "SupportedType" and the type is still string ). How should I modify C# source code?
Thanks,
Ming