Consuming ASP. NET 2.0 web services in Delphi for Win32

Source: Internet
Author: User
Tags wsdl

From: http://www.bobswart.nl/weblog/Blog.aspx? Rootid = 5: 798

ACouple of years ago I wrote an article consuming C # web services with Delphi 7 Professional, and while the information in the article is still correct, it's no longer complete, because ASP. NET 2.0 changed the rules a little bit.
Even if you follow the examples exactly on creating the Web service in C # and in creating the consuming application in Delphi for Win32, no matter what you try to echo, the result will always come back as 0 for numbers or as an empty string for strings.

This is due to the fact that the C # Web Service is deployed on an ASP. NET 2.0 machine (which changed some of the ways WSDL was published compared to. NET 1.1 ).

The problem is caused by the fact that any. NET web service is using the document | literal binding. with ASP. NET 1.x web services, this was specified using Element, but with ASP. NET 2.0 Microsoft has changed that and now specifies the style in the Operation input and output nodes instead of the binding element. the Delphi Win32 WSDL importer is not able to recognize this, and as a result the generated import unit is using the (for Delphi default) binding type of RPC instead of. net document | literal binding type.
Codegear is aware of the situation, and is already working on fixing the problem in the Win32 WSDL importer. in the meantime, there is a workaround available that you can use, namely manually specifying the iodocument as invokeoptions for the soap interface type, as follows:

 
Invregistry. registerinvokeoptions (typeinfo (XXX), iodocument );

Where xxx is the name of your soap interface type.

This line of code needs to be added to the initialization section of the generated Win32 import unit, and will make sure the parameters and result types are no longer empty when Win32 clients are talking to ASP. NET 2.0 web services.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.