PB11.5 Creating and invoking WebService

Source: Internet
Author: User
Tags wsdl

I did this "PB Create and call WebService" small job, below I share my entire practice process and the problems I encountered, I hope to help you, this small job is divided into the following three parts to complete:

First, build WebService

① created workspace,workspace named: Your_webservice

② build. NET Web Service Target, this step requires just one next

The final production project file contains at least three items, one WEBSERVICE2 application, one P_WEBSERVICE2 deployment, and one N_webservice2 user object:

③ then writes its own public function in this n_webservice2 object (just double-clicking the N_webservice2 will appear the following interface ):

Save the function you have written, and you will find that it appears in the functions list of the N_webservice2 object:

Ii. release of WebService

① Deploy Web service and open P_webservice2, you can see a few property pages with a "objcet" page where you can see a list of functions you want to publish. Tick in front of the function name you want to publish, then click Menu Design->deploy Project to deploy WebService, but only if you have IIS and. Net.

If there are IIS or. NET related errors, fail to Deploy of P_webservice2, please refer to the relevant information: http://jingyan.baidu.com/article/b2c186c8ccc670c46ef6ff91.html

If the deployment is successful, your webservice is basically no problem, you can enter the browser in the link shown to check your WebService deployment is successful?

Deployment success is like this: theadd function is the public function you previously wrote in the N_webservice2 object

Exporting the WebService configuration (take Http://localhost/webservice2/n_webservice2.asmx?WSDL as an example)
Enter "Http://localhost/webservice2/n_webservice2.asmx?WSDL" in the URL this is the file we want to export, such as

We then store the page as a WSDL file (note: The file is in the same directory as your webservice), so the configuration file is set up.

Third, call WebService

Whether it's a. NET-based WebService developed with VS, or a Java-developed webservice, or a. NET Web SERVICE,PB that is developed with PB itself, the principle of calling WebService is the same. are accessed through the WSDL webservices.

① Build Environment

1) Place "N_WEBSERVICE2.WSDL" in the program directory (this step can be ignored if the file is in the correct location in the previous step),

2) Copy the "pbsoapclient115.pbd" file in the PB installation directory to the program directory (pb9.0 corresponds to the pbsoapclient90.pbd,pb11.5 corresponding to the PBWSCLIENT115.PBD)

②PB Program Calls

1) Refer the PBSOAPCLIENT115.PBD to the PB program in the following steps:

2) also need to add a. pbd format file, this file name is:webservice2.pbd, this library in the subsequent encoding call function will give you a hint , if not add the item, the subsequent window run error, this step is critical

Add a WebService reference (follow the steps and I'll just label where I need attention)

In the second step, the following interface appears, selecting the WSDL file, as

The following interface, select your own published services can:

The following interface, do not need to fill out (if you fill in soap, then the name is Soapservice2soap, the name is fixed, not only show the red content)

Press the default button below,

Select the class library you are storing here:

After completion, such as:

3) Select p_webservice2_wsproxy, select Designe->deploy Project in the menu bar, generate the N_webservice2soap file,

4) Build method call N_webservice2soap, add "Custom Class"

function Body:

After the function is saved, such as:

5) The final step, create a new application form in the same space, and add the WEBSERVICE2.PBL class library (adding class libraries is important, I am stuck in this step, do not know how to call the WebService, call the class library is a very concise method)

After creating the new Application,window, pull a button in the window layout interface, pull a text box, write the following code in the button's Click event, WebService the call succeeds:

To invoke a successful result diagram:

PB11.5 Creating and invoking WebService

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.