How to cooperate with WebService under Delphi and .NET

xiaoxiao2021-03-06  71

How to cooperate with WebService under Delphi and .NET

This article should also be feasible for Java, but I have not tried it, so if I have a problem, please give me feedback in time, I will modify it in time.

This article assumes that you have created your own WebService on .NET, and have been tested and applied. It is now just to implement calls on our own webservice interface on Delphi.

1 In your project, new-> Other Select WebServices page

2 Select the WSDL IMPORTER item

3 Fill in the WDSL address you already know in WSDL Source, here I fill in my address is

http://192.168.0.123:81/hello/tijiaosj.asmx?wsdl

After 4 Next, a unit is automatically generated.

5 This unit contains all available interfaces in the URL address you provide.

Where getxxxxxxsoap this function returns the Class of these interfaces

You can write getxxxxxxsoap.xxxfunction in business code.

6. Immediately below, when the function is to operate Chinese, remember to modify getxxxxxxSoAP

This function adds the following statement

Rio.httpwebnode.useutf8inheader: = true; // Solve Chinese garbled problems

Oh, very simple, right

转载请注明原文地址:https://www.9cbs.com/read-88817.html

New Post(0)