SOAP mismatch? Delphi 2010 (Win32) Server and .NET Client replace "out-parameter" and "result"

Can someone shed light on this behavior? It seems that Delphi SOAP sets the result of the function as the last argument, but WSDL.exe reads the first argument as the result of the function.

I have the following method in a Delphi SOAP service, where the resulting string is used for basic error handling:

function LoadCustomer(CustomerID: Double; out CustomerName: String): String;

The generated WSDL is as follows:

<message name="LoadCustomer2Request">
  <part name="CustomerID" type="xs:double"/>
</message>
<message name="LoadCustomer2Response">
  <part name="CustomerName" type="xs:string"/>
  <part name="return" type="xs:string"/>
</message>

For some reason, WSDL.exe creates the below C # code, which swaps the CustomerName and Result strings:

public string LoadCustomer(double CustomerID, out string @return) {
        WindowsFormsApplication1.ServiceReference1.LoadCustomerRequest inValue = new WindowsFormsApplication1.ServiceReference1.LoadCustomerRequest();
        inValue.CustomerID = CustomerID;
        WindowsFormsApplication1.ServiceReference1.LoadCustomerResponse retVal = ((WindowsFormsApplication1.ServiceReference1.ISKiWebInterface)(this)).LoadCustomer(inValue);
        @return = retVal.@return;
        return retVal.CustomerName;
    }
+5
source share
1 answer

SOAP rpc, . , (). Delphi [, , ] "" . (?) , . , , .

SOAP. . parameterOrder ( rpc: SOAP). WSDL, . , WSDL.EXE . :

http://www.w3.org/TR/wsdl#_parameter

WSDL, Delphi, ; , parameterOrder (*). , , , portType, :

  <portType name="InterfaceName">
    <operation name="LoadCustomer" parameterOrder="CustomerId, CustomerName">
      <input message="tns:LoadCustomer2Request"/>
      <output message="tns:LoadCustomer2Response"/>
    </operation>
  </portType>

WSDL WSDL.EXE - :

  public string LoadCustomer(out string CustomerName, double CustomerID) {
    object[] results = this.Invoke("LoadCustomer", new object[] {
                CustomerID});
    CustomerName = ((string)(results[1]));
    return ((string)(results[0]));
  }

, , "return" - :

 [return: System.Xml.Serialization.SoapElementAttribute("return")]

QC, , Order Delphi WSDL.

,

PS: (*) WSDL, Order. loooong , , ( :)

+10

All Articles