Hi there, I have a web service written in C++ using gSoap. One of the methods of the webservice is
int HS__TBusinessComponentGetContents( xsd__positiveInteger pSession,
xsd__positiveInteger pComponentType,
xsd__string pPath,
xsd__string pFilter,
xsd__string pChangedAfter,
xsd__positiveInteger pFlags,
xsd__string &rResult);
Using these typedefs:
typedef double xsd__double;
typedef wchar_t *xsd__string;
typedef bool xsd__boolean;
typedef int xsd__int;
typedef unsigned long long xsd__positiveInteger;
typedef wchar_t *xsd__datetime;
I generate a wsdl file using this definition which has this (correct) part:
However, when I generate a Proxy class using the Visual Studio 2008 wsdl.exe tool to create a class which I can use from C#, the definition of the above methods is as follows:
[System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="urn:tango04-hydra-server", ResponseNamespace="urn:tango04-hydra-server")]
[return: System.Xml.Serialization.SoapElementAttribute("rResult")]
public string TBusinessComponentGetContents([System.Xml.Serialization.SoapElementAttribute(DataType="positiveInteger")] string pSession, [System.Xml.Serialization.SoapElementAttribute(DataType="positiveInteger")] string pComponentType, string pPath, string pFilter, string pChangedAfter, [System.Xml.Serialization.SoapElementAttribute(DataType="positiveInteger")] string pFlags) {
object[] results = this.Invoke("TBusinessComponentGetContents", new object[] {
pSession,
pComponentType,
pPath,
pFilter,
pChangedAfter,
pFlags});
return ((string)(results[0]));
}
The WSDL is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="Publisher"
targetNamespace="http://127.0.0.1:18084/Publisher.wsdl"
xmlns:tns="http://127.0.0.1:18084/Publisher.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:HS="urn:tango04-hydra-server"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="urn:tango04-hydra-server"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:HS="urn:tango04-hydra-server"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
</schema>
</types>
<message name="SessionOpenRequest">
<part name="vCredentials" type="xsd:string"/>
</message>
<message name="SessionOpenResponse">
<part name="rResult" type="xsd:positiveInteger"/>
</message>
<message name="SessionCloseRequest">
<part name="rSession" type="xsd:positiveInteger"/>
</message>
<message name="SessionCloseResponse">
<part name="rResult" type="xsd:boolean"/>
</message>
<message name="SoapTestRequest">
</message>
<message name="SoapTestResponse">
<part name="rResult" type="xsd:boolean"/>
</message>
<message name="TBusinessComponentGetContentsRequest">
<part name="pSession" type="xsd:positiveInteger"/>
<part name="pComponentType" type="xsd:positiveInteger"/>
<part name="pPath" type="xsd:string"/>
<part name="pFilter" type="xsd:string"/>
<part name="pChangedAfter" type="xsd:string"/>
<part name="pFlags" type="xsd:positiveInteger"/>
</message>
<message name="TBusinessComponentGetContentsResponse">
<part name="rResult" type="xsd:string"/>
</message>
<portType name="PublisherPortType">
<operation name="SessionOpen">
<documentation>Service definition of function HS__SessionOpen</documentation>
<input message="tns:SessionOpenRequest"/>
<output message="tns:SessionOpenResponse"/>
</operation>
<operation name="SessionClose">
<documentation>Service definition of function HS__SessionClose</documentation>
<input message="tns:SessionCloseRequest"/>
<output message="tns:SessionCloseResponse"/>
</operation>
<operation name="SoapTest">
<documentation>Service definition of function HS__SoapTest</documentation>
<input message="tns:SoapTestRequest"/>
<output message="tns:SoapTestResponse"/>
</operation>
<operation name="TBusinessComponentGetContents">
<documentation>Service definition of function HS__TBusinessComponentGetContents</documentation>
<input message="tns:TBusinessComponentGetContentsRequest"/>
<output message="tns:TBusinessComponentGetContentsResponse"/>
</operation>
</portType>
<binding name="Publisher" type="tns:PublisherPortType">
<SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="SessionOpen">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="SessionClose">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="SoapTest">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="TBusinessComponentGetContents">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:tango04-hydra-server" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="Publisher">
<documentation>Tango/04 Computing Group - Publisher </documentation>
<port name="Publisher" binding="tns:Publisher">
<SOAP:address location="http://127.0.0.1:18084"/>
</port>
</service>
</definitions>
My question is: why is this happening? Shouldn't the parameters be integers, or long long values instead of strings for the parameters that in the wsdl are marked as xsd:positiveInteger? What am I doing wrong here?
Thanks!