[PB] PB calls WebService

Source: Internet
Author: User

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! :)

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.