When you click the “Add Reference” button, Visual Studio will read the WSDL document and automatically generate the class definitions required to invoke the Web service from your project. Of course your port number and host name will vary. Here are sample values to plug into the prompts:
#VB NET 2010 CODE#
NET code and should be a name that is representative of one or more Web service operations that are present in the given WSDL document (i.e., InventoryServices or FinanceServices).įigure 1–The “Add Web Reference” dialog in Visual Studio is used to define a Web service for the application and generate the required code to access it. When the “Add Web Reference” dialog appears, enter the URL to your Web service’s WSDL document and a friendly “Web reference name.” (See Figure 1.) The friendly name will be referred to in the. If this option isn’t available from the Project menu, you can alternatively right-click on the project name in the Visual Studio Solution Explorer and choose it there. Once you have a Visual Studio project, add a Web service reference to your project by choosing Project→Add Web Reference. NET client using either a Web Service Reference or a WCF Service Reference.
#VB NET 2010 HOW TO#
You’ll want to know the URL to each Web service WSDL document you’ve published so that you can supply them to clients that access the Web service.Īnd now on to the brief tutorial demonstrating how to access the CustListR RPG program (defined as a Web service) from a. Visual Studio simply reads the WSDL file and automatically creates code based on the parameter names, etc., it finds in the WSDL document.Īs discussed in the prior article, the WSDL document (and its URL) generated for a Web service published on an IWS server can be accessed from the IBM http server administration page. This WSDL document (published in XML format) defines the parameters for the Web service and the operation(s) to be executed. How does Visual Studio do this? Recall that each IWS Web service is published with a corresponding WSDL (Web Services Description Language) document. Either way, the good news is that Visual Studio does most of the heavy lifting for developers by automatically creating classes that can consume a Web service written in RPG or any other language. Here, I’ll simply demonstrate how to use each to consume the RPG Web service. Which one you’ll use in your projects depends on a number of factors.
#VB NET 2010 WINDOWS#
Microsoft offers two methods for consuming Web services: using Windows Communication Foundation (WCF) or the original Web service reference implementation. As discussed in that tip, deploying an RPG program as a Web service on an IWS server is as simple as a walking through a few steps in the deployment wizard.Ī Little Background on. This RPG program was then deployed as a “Web service” using the new IWS server so that just about any client written in just about any language and deployed on just about any platform can access it. Table 1–Parameters for the CustListR program. The program’s parameter list is shown below:Ī set of rows holding the requested customer master data The idea will be to see the results of the Web service call (a list of customers from RPG program CustListR in tabular format) on a Web page.Īs a brief recap, the last article revolved around RPG program CustListR, which was designed to receive an SQL Where clause string, build a SQL statement to retrieve customer information based on the received Where clause, execute the SQL statement, and return a list of customers as an output parameter. I then added a Web page called DEFAULT.ASPX and dropped a GridView control on it called GridView1. For demonstration purposes, I created a simple VisualBasic ASP.NET Web Application Project. This tip assumes you know the basics of creating and editing Visual Studio projects.
#VB NET 2010 PROFESSIONAL#
This tip’s example will be done using Visual Studio 2008 Professional Edition (although other editions should work). There is also an important discussion on some of the current limitations that may persuade you against publishing Web services using IWS. If you haven’t already reviewed the tip on how to publish a result, please review it now. NET client in the context of an ASP.NET Web page. This potentially makes your i data and business logic accessible from anywhere! This tip will continue where the prior one left off by demonstrating how to consume the sample CUSTLISTR Web service using a. The benefit of using RPG to publish data as a Web service is that any number of clients can consume the Web service, regardless of OS platform or language.
![vb net 2010 vb net 2010](https://i.ytimg.com/vi/LUUofvN7NI0/maxresdefault.jpg)
In my article Publish Result Sets Using Web Services and IWS, I demonstrated how to write an RPG program that can return a result set (i.e., multiple rows of data) to a Web service client using an Integrated Web Services (IWS) server instance. Note: Source code for RPG program CustListR can be downloaded here. Consume an IWS Web Service From a VB.NET Client