Whether it is a. Net-based WebService developed by Vs, a WebService developed by Java, or a. Net developed by petabytes.
The principles of WebService calling by web service and Pb are the same, and WebServices are accessed through WSDL. The specific steps are as follows:
1. Compile WebService
2. Create a PB Web Service Proxy
3. Create Pb web service client
1. Compile WebService
I will not go into details here. You can refer to the relevant documents for compiling WebService.
2. Create a PB Web Service Proxy
1) first create a project and then create a Web Service proxy. Web Service Proxy
Both wizard and Web Service proxy are supported. The difference is that the former is a wizard type, and the latter is manually entered.
2) Select whether to use the. NET engine ). If this option is not selected, easysoap is used by default.
Engine. We recommend that you do not use it if you do not have any special requirements. net engine, although. net engine supports many attributes and data types (such. net dataset, etc.), but relatively large, must be. net
The efficiency of the Framework SDK is affected.
3) enter the position of the WSDL.
4) web services and ports contained in the WSDL file.
5) You can add a prefix to the proxy name. If no prefix is added, the proxy name is wsdemoservicehttpport.
6)
7)
8)
9)
10) Deploy the Web Service proxy project.
11) after the deployment, you can see the WebService.
3. Create Pb web service client
Create an application, create a form, place a button on the form, and click the button to call web service.
To add pbsoapclient120.pbd to the application library (the Pb version is different and the name is slightly different), pbsoapclient120.pbd contains soapconnection and soapexception objects.
Note: int in Java/C # Corresponds to long and long in powerscript.
Long.
Compile powerscript In the Click Event of the button:
Here, the Web service only has one method string showmessage (string message), and returns a string.
PublicStringshowmessage (string message ){
ReturnMessage + ", welcome to WebService! ";
}
Run application and click the button. The result is as follows:
Web service called successfully! :)