Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 542555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:27:33+00:00 2026-05-13T10:27:33+00:00

Could someone please shed some light on this behaviour? It looks like Delphi SOAP

  • 0

Could someone please shed some light on this behaviour? It looks like Delphi SOAP sets the function result as the last argument, but WSDL.exe reads the first argument to be the function result.

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

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

The generated WSDL looks like this:

<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 generates 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;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:27:33+00:00Added an answer on May 13, 2026 at 10:27 am

    When SOAP was predominantly rpc-oriented issues like these came up often. There’s no specific order to determine which part is the function’s (operation’s) result. Delphi’s own importer used to [and probably still does??] identify the ‘result’ by the part’s name. And you could (can??) specify a comma-delimited list of names to use. If none of the parts match the names, then if there’s a single out, it’s the result.

    The SOAP spec. did eventually include additions to solve this issue. The relevant one in your case is the ‘parameterOrder’ attribute (there’s also rpc:result for the actual SOAP data). However, you hardly see WSDLs that use the attribute. But, I believe that WSDL.EXE does pay attention to that attribute. You can find out more about parameterOrder here:

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

    What I would suggest you do is to save the WSDL generated by Delphi to a file; and update the later to include the parameterOrder attribute(*). For example, in the case you provided, you’ll want to find the portType that maps to the interface and update the operation as follows:

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

    Then, importing that updated WSDL with WSDL.EXE should give you something along the lines of:

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

    You should also see the following attribute above the method to confirm that ‘return’ is the indeed result:

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

    I would suggest opening a QC requesting that the parameterOrder be generated by Delphi’s WSDL logic.

    Cheers,

    Bruneau

    PS: (*) It’s also easy to update the WSDL generation logic to emit parameterOrder. It’s been a loooong time since I’ve been in that code but it’s fairly straight-forward (if I remember correctly:)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could someone shed some light on where this code is incorrect please <script> chrome.browserAction.onClicked.addListener(function(window)
Could someone please shed some light on the workings of A-sort (not asort()), which
I'm not sure why am I getting this strange result. Can someone please shed
Could someone please help me with this scenario, [Some text] [Some text] Device ID:
Could someone please demystify interfaces for me or point me to some good examples?
Could someone please explain what the for loop in this class does? Specifically the
Could someone please tell me what is wrong with this code? It works fine
Could someone please help me understand that why am I getting this error at
Could someone please tell me which objects types can be tested using Regular Expressions
Could someone please explain the best way to connect to an Interbase 7.1 database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.