IBM WebSphere Studio and Microsoft .NET working together -- Part 1

Invoking a .NET Web service from a WebSphere Studio Client

This two-part article describes how to build Web services in both IBM WebSphere Studio and Microsoft Visual Studio .NET. It demonstrates the interoperability between WebSphere Studio and .NET. It also provides detailed deployment instructions for invoking Web services that return objects and nested objects. Part 1 describes how to invoke .NET Web services deployed in IIS from J2EE clients developed with WebSphere Studio. Part 2 describes how to invoke J2EE Web services deployed in the WebSphere Studio Test Environment from .NET clients developed with Visual Studio .NET.

Share:

Ope-Oluwa Soyannwo (soyannwo@uk.ibm.com), Software Engineer, Hursley Solution Test, IBM Hursley

Ope-Oluwa Soyannwo is a Web services tester at IBM Hursley Solution Test Department, IBM Hursley. She works on testing interoperability between IBM WebSphere products and Microsoft Visual Studio .NET. You can reach Ope at soyannwo@uk.ibm.com.



27 August 2003

Introduction

Web services can perform functions ranging from simple requests to complicated business interactions. Open standards and the focus on communication and collaboration among people and applications have created an environment where Web services are becoming the medium for application integration. They can be referred to as fundamental building blocks in the move towards distributed computing on the Internet. Applications are constructed using multiple Web services from various sources and allowed to work together regardless of where they reside or how they are implemented.

Java™ 2 Platform, Enterprise Edition (J2EE) is a Java platform that defines the infrastructure for enterprise applications. It supports Web services to enable development of secure, robust and interoperable business applications. J2EE technology and its component-based model is designed to simplify enterprise development and deployment. IBM® WebSphere® Studio Application Developer (hereafter called Application Developer) is a J2EE application development environment that supports development of Web services based on the J2EE 1.3 specification. It provides a built-in WebSphere Application Server Version 5.0 test environment for testing the J2EE applications.

Microsoft® .NET is the Microsoft software platform for developing Web services. The Web services used in this article are developed in Microsoft Visual Studio® .NET and deployed in Microsoft Internet Information Services (IIS) Version 5.0.

For information on the major differences between the Application Developer and Visual Studio .NET development environments, see How IBM WebSphere Studio Application Developer Compares with Microsoft Visual Studio .NET -- Part 1: Conceptual Differences, from the IBM WebSphere Developer Technical Journal.

The Extensible Markup Language (XML) description of a Web service is contained in Web Services Description Language (WSDL) files. These files, generated for J2EE Web services deployed in the Application Developer test server, are imported into Visual Studio .NET and used to develop .NET clients. Similarly, WSDL files generated for .NET Web services deployed in IIS are imported into Application Developer and used to develop J2EE clients there. This import/export of WSDL files and the subsequent successful invocation of the Web services between the two platforms demonstrate the interoperability of the Web services tools for these platforms.

This two-part article describes how to build Web services in both Application Developer and Visual Studio .NET. It demonstrates the interoperability between Application Developer and .NET. It also provides detailed deployment instructions for invoking Web services that return objects and nested objects. Part 1 describes how to invoke .NET Web services deployed in IIS from J2EE clients developed in Application Developer. Part 2 describes how to invoke J2EE Web services deployed in the Application Developer test server from .NET clients developed in Visual Studio .NET.

This article assumes some familiarity with Application Developer and Visual Studio and is designed for the following audiences:

  • Those who have basic knowledge of Web services
  • Those who want to test or demonstrate the interoperability between the .NET and Application Developer development environments and tools, focusing specifically on Web services development

The Credit Check Web service

For demonstration purposes, J2EE and .NET Credit Check Web services are deployed in the Application Developer test server and IIS respectively. The Web service takes as input a person's name, address and policyID and returns a credit quote depending on which method is called. This credit quote can be one of the following:

  • A string (credit score) indicating whether the person has passed or failed
  • An object (a person object) containing detailed information about the person, and a credit score
  • A nested object (a complexperson object) containing person details grouped into name details (name object) and address details (address object), and a credit score

A random number (credit weight) is generated each time the methods are called. This number determines whether the credit score is a pass or a fail. Therefore the credit score is a random prediction of the person's credit quote.


Invoking a .NET Web service from an Application Developer client

To invoke a .NET Web service from an Application Developer client, you must add a .NET Web service reference to the client. The Web reference is the .NET WSDL URL. The WSDL file is the key for a client to invoke the Web service. From this WSDL, Application Developer can generate a Web service Proxy. The proxy acts as an intermediary between the workstation and the Internet. Client programs use the proxy to interact with the Web service. The proxy therefore acts as a client on behalf of the user and requests a page from the server on the Internet. When the page is returned, it relates the page to the original request and forwards it to the Application Developer client. The .NET Web service resides in IIS, which acts as the server.

Invoking a .NET Web service from an Application Developer client involves the following steps:

  1. Create the .NET Web service. This can be done in either of two ways:
  2. Invoke the .NET Web service from an Application Developer client.

Step 1: Creating a .NET Web service

This section describes how to create a .NET Web service and then invoke the service from an Application Developer client. After the service is created, it resides in the IIS of your workstation.

Creating a .NET Web service from scratch

The following is a list of prerequisite software:

  • WebSphere Studio Application Developer version 5.0
  • Internet Information Services (IIS) version 5.0
  • .NET Framework version 1.0 or later
  • Microsoft Visual Studio .NET Professional 2002 or later

The code is provided in the with this article in the DiskA folder of the samplecode.zip file, which you can download at the bottom of this article.

First, create a new class library for the Web service.

  1. Open Visual Studio .NET by double-clicking on its icon Visual Studio .NET icon
    or by selecting Start Menu => Programs => Microsoft Visual Studio .NET => Microsoft Visual Studio .NET.
  2. Create a new class library to store object definitions (Person object).
  3. Select File => New => Project .
  4. Select Visual C# Project (on the left frame) and Class Library (on the right frame).
  5. Change the Name field from ClassLibrary1 to CreditCheckLib and click OK .
    Figure 1. Creating a new class library
    Figure 1. Creating a new class library
  6. In the Solution Explorer (right frame), right-click on Class1.cs, select Rename, and type Person.cs.
  7. View the code for Person.cs by right-clicking on Person.cs and selecting View Code.
  8. Delete all its contents.
  9. Copy and paste code from the CreditCheckLib.txt file in the DiskA folder of the zip file.

    This piece of code contains the class library that defines the Person and Complex Person Object. Person object consists of nine strings (title, surname, forename, address1, address2, postcode, country, policyID, creditScore) and an integer value (creditWeight). Complex Person consists of a Name object, an Address Object, one string (creditScore) and an integer (creditWeight). See code comments for details.

  10. Build the solution by selecting Build => Build Solution. Save by selecting File => Save All.
  11. Close by selecting File => Close Solution.

Create a new Active Server Page (ASP) .NET Web service Project. This is the actual Web service project that makes use of the class library created above (Person.cs). To create an ASP .NET Web service Project, do the following:

  1. Open a new Project by selecting File => New => Project.
  2. In the left frame, select Visual C# Projects. In the right frame select ASP .NET Web service.
  3. Change location to http://machinename:port/CreditCheck, where machinename is the name of your machine and port is the port number on which Web services listen. See Hints and tips for instructions on how to check machine names and port numbers. Click OK.
  4. In the Solution Explorer (right frame), right-click Service1.asmx, select Rename, and type CreditCheckWService.asmx.
  5. View the code for CreditCheckWService.asmx by right-clicking CreditCheckWService.asmx and selecting View Code.
  6. Delete all the code.
  7. Copy and paste code from the file CreditCheckWS.txt in the DiskA folder of the .zip file into the code area. This piece of code contains the Web service.

To associate the Class library (Person.cs) just created with the Web service to be created, you must create a reference to Person.cs.

  1. Right-click References (in the Solution Explorer) and select Add a reference.
  2. In the Add Reference Dialog Box, click on the Projects tab, then click Browse.
  3. Double-click the CreditCheckLib.dll previously created. This file should be in My Documents\Visual Studio Projects\CreditCheckLib\bin\debug\CreditCheckLib.dll.
  4. CreditCheckLib.dll should appear in the Selected Components part of the dialog box. Select OK.
  5. From the tool bar, run the Web service by selecting Debug => Start without Debugging.

Figure 2 is a sample Web-based application client that serves as a front-end to the .NET Web service.

Figure 2. Sample Web-based application client
Figure 2. Sample Web-based application client

The URL for the Web service client is in the address box. It is http://machinename:port/CreditCheck/CreditCheckWService.asmx.

The WSDL URL is http://machinename:port/CreditCheck/CreditCheckWService.asmx?wsdl.

Figure 3. Contents of the URL for the WSDL file

<?xml version="1.0" encoding="utf-8" ?>
- <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://tempuri.org/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="http://tempuri.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
  - <types>
   - <s:schema elementFormDefault="qualified"
	targetNamespace="http://tempuri.org/">
    - <s:element name="returnSimpleQuote">
      - <s:complexType>
        - <s:sequence>
	   <s:element minOccurs="0" maxOccurs="1" name="title" type="s:string" />
	   <s:element minOccurs="0" maxOccurs="1" name="surname" type="s:string" />
	   <s:element minOccurs="0" maxOccurs="1" name="forename" type="s:string" />
	   <s:element minOccurs="0" maxOccurs="1" name="houseNo" type="s:string" />
	   <s:element minOccurs="0" maxOccurs="1" name="address1" type="s:string" />
	   <s:element minOccurs="0" maxOccurs="1" name="postcode" type="s:string" />
	   <s:element minOccurs="0" maxOccurs="1" name="country" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    - <s:element name="returnSimpleQuoteResponse">
      - <s:complexType>
        - <s:sequence>
	   <s:element minOccurs="0" maxOccurs="1" name="returnSimpleQuoteResult" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
    - <s:element name="returnComplexQuote">
      - <s:complexType>
        - <s:sequence>
	...

Test the Web service by clicking on the links for each method and entering values. Click Invoke. The expected results of each method are shown in Figures 5, 7, and 9.

Figure 4 shows the expected input parameters for the returnComplexQuote method.

Figure 4. .NET client input form for complex quote
Figure 4. .NET client input form for complex quote

This method returns a complex type (Person object) as shown in Figure 5.

Figure 5. Results for complex quote from the Web service

<?xml version="1.0" encoding="utf-8" ?>
- <Person xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">
 	<title>Miss</title>
 	<surname>Collins</surname>
	<forename>Sarah</forename>
 	<address1>Farmhouse Mews</address1>
 	<address2>New waltham</address2>
 	<postcode>DN36 7HJ</postcode>
 	<country>UK</country>
 	<policyID>55637</policyID>
 	<creditScore>Sorry you have FAILED the Credit Check</creditScore>
 	<creditWeight>101</creditWeight>
  </Person>

Figure 6 shows the expected input parameters for the returnSimpleQuote method.

Figure 6 .NET client input form for simple quote
Figure 6 .NET client input form for simple quote

This method returns a string value (creditScore) as shown in Figure 7.

Figure 7. Results for simple quote from the Web service

<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">Sorry you have FAILED the Credit Check
</string>

Figure 8 shows the expected input parameters for the returnMComplexQuote method.

Figure 8 .NET client input form for a more complex quote
Figure 8 .NET client input form for a more complex quote

This method returns a Complex type (Person object) consisting of Address and Name objects, one string value (creditScore), and one integer value (creditWeight) as shown in Figure 9.

Figure 9. Results for more complex quote from the Web service

<?xml version="1.0" encoding="utf-8" ?>
- <complexPerson xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://tempuri.org/">
- <name>
  	<title>Miss</title>
  	<surname>Collins</surname>
  	<forename>Sarah</forename>
  </name>
- <address>
  	<houseNo>1</houseNo>
 	<address1>Farmhouse Mews</address1>
 	<address2>New waltham</address2>
 	<postcode>DN36 7HJ</postcode>
  	<country>UK</country>
  </address>
  <creditScore>Sorry you have FAILED the Credit Check</creditScore>
  <creditWeight>65</creditWeight>
 </complexPerson>

A closer look at the XML tags reveals that the more complex quote has the name and address tags indented. These are the objects within the Person object making it different from the complex quote result, where none of the tags are indented.

A .NET Web service has been generated such that it can return a simple type (a string) or two types of complex types. One is a simple object (Person object) and the other a nested object (Person object consisting of Address and Name object, a string and an integer value). The Web service resides in IIS which serves as the .NET server. You should have a folder called CreditCheck in My Documents/ Visual Studio Projects/ as well as a virtual folder called CreditCheck in C:/inetpub/wwwroot/.


Installing the .NET Web service provided with this article

This section describes how to install an example Credit Check .NET Web service provided with this article. After installation (performed by running an executable file), the .NET Web service resides in the IIS of the workstation. Depending on which methods are called from the Application Developer client, the Web service can return either a simple type (string value), indicating the credit score, or a complex type (object), containing detailed information about a person.

The following is a list of prerequisite software:

  • WebSphere Studio Application Developer version 5.0
  • Internet Information Services (IIS) version 5.0
  • .NET Framework version 1.0 or later
  • .NET Web service provided with this article

Visual Studio .NET creates projects so that they can be deployed on another workstation. It creates an executable file that can install the project on the workstation server. In this case, the example Credit Check Web service project written in .NET is to be installed onto the IIS of the workstation. The file installed (CreditCheckSetup), is stored in C:\inetpub\wwwroot\CreditCheckSetup\CreditCheckWService. You do not need to have Visual Studio .NET installed on your computer to use this Web service but you must install the .NET Framework.

To install the example Credit Check Web service, use the code included in DiskC folder of the .zip file.

  1. Open the folder called CreditCheckSetup.
  2. Open the folder called Debug.
  3. Run the Setup.exe file by double-clicking on the icon:
    Setup.exe icon
  4. Click Next on the Setup Wizard Welcome screen. An Installation Address prompt screen opens.
  5. Accept defaults or change the port number to the desired port number. See Hints and tips for how to check port numbers.
  6. Click Next on the Confirm Installation screen and click Close on the Installation Complete screen.

The URL for the provided Web service is http://machinename:port/CreditCheckSetup/CreditCheckWService.asmx. The WSDL URL needed to test this Web service in Application Developer is http://machinename:port/CreditCheckSetup/CreditCheckWService.asmx?wsdl.

Read the following to understand the installed Web service and what it does:

  • The Web service resides in a virtual folder in IIS located at C:\inetpub\wwwroot\CreditCheckSetup\CreditCheckWService.
  • The Web service sample client application to be imported into Application Developer can be viewed by typing the following URL into a browser: http://localhost/CreditCheckSetup/CreditCheckWService.asmx. The variable localhost can be replaced by machinename:port.
  • To test a Web service, the WSDL must be provided. The .NET Web service WSDL URLs are usually of the form http://machinename:port/<servicename>/<serviceasmx>?wsdl. Notice that it is the URL of the sample client application with ?wsdl appended.

Figure 10 is a sample Web-based application client that serves as a front end to the .NET Web service. Click on any of the links to test the Web methods.

Figure 10. Sample Web-based application client
Figure 10. Sample Web-based application client

Fill in the required fields and click Invoke to activate the Web service.

Figure 11. Input form for sample .NET client
Figure 11. Input form for sample .NET client

The Web service consists of three methods described below:

returnSimpleQuote: This method takes seven parameters: the person's title, surname, forename, house number, address1, postcode and country. It returns a string value (creditScore). An example is as follows:

< string xmlns =" http://tempuri.org/"> Sorry you have FAILED
    the Credit Check
</ string >

returnComplexQuote: This method takes nine parameters: the person's title, surname, forename, house number, address1, address2, postcode, country and PolicyID. It returns a complex type (Person object) consisting of nine string values (title, surname, forename, address1, address2, postcode, country, PolicyID, creditScore), and an integer value (creditWeight). creditScore is the "Pass" or "Fail" result from the Web service and is derived from a random integer value, creditWeight. An example is shown in Figure 12.

Figure 12. returnComplexQuote

<?xml version="1.0" encoding="utf-8" ?>
    - <Person xmlns:xsd ="http://www.w3.org/2001/XMLSchema"
              xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
              xmlns ="http://tempuri.org/">
            <title>Miss</title>
            <surname>Miller</surname>
            <forename>Kate</forename>
            <address1>Miller Crescent</address1>
            <address2>The Polygon</address2>
            <postcode>SO 14 5Rf</postcode>
            <country>UK</country>
            <policyID>XXTY987</policyID>
            <creditScore>You have PASSED the Credit Check</creditScore>
            <creditWeight>694</creditWeight>
    </Person>

returnMComplexQuote: This method takes nine parameters: the Person's title, surname, forename, house number, address1, address2, postcode, country and PolicyID. It returns a complex type consisting of two complex types, one string value, and one integer value. The complex type Person Object consists of an Address object, a Name object, the string value creditScore, and the integer value creditWeight. An example is shown in Figure 13.

Figure 13. returnComplexMQuote

<?xml version="1.0" encoding="utf-8" ?>
    <complexPerson xmlns:xsd ="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns ="http://tempuri.org/">
               <name>
                 <title>Miss</title>
                 <surname>Miller</surname>
                 <forename>Kate</forename>
               </name>
               <address>
                 <houseNo>1</houseNo>
                 <address1>Miller Crescent</address1>
                 <address2>The Polygon</address2>
                 <postcode>SO 14 5Rf</postcode>
	         <country>UK</country>
               </address>
               <creditScore>Sorry you have FAILED the Credit Check </creditScore>
               <creditWeight>140</creditWeight>
     </complexPerson>

Step 2: Invoking a .NET Web service from an Application Developer client

The procedure in this section makes use of the Web service URL that has just been created in Visual Studio .NET. If you have not made note of the URL, do the following:

  1. Open Visual Studio by selecting Start Menu => Programs => Microsoft Visual Studio .NET => Microsoft Visual Studio .NET.
  2. In the Microsoft Development Environment, select File => Open => Project.
  3. Double-click the CreditCheckWService folder, then double-click the CreditCheckWService.asmx file.
  4. When the project opens, select Debug => Start without Debugging.
  5. Copy the URL in the address box. The URL should be http://machinename:port/CreditCheck/CreditCheckWService.asmx.
  6. Add ?wsdl to the end of the URL, for example, http://machinename:port/CreditCheck/CreditCheckWService.asmx?wsdl. This is the WSDL URL.
  • For the Web service installed, the WSDL URL is:
    http://machinename:port/CreditCheckSetup/CreditCheckWService.asmx?wsdl, where machinename is the machine on which the service resides.
  • For the Web service written from scratch, the WSDL URL is: http://machinename:port/CreditCheck/CreditCheckWService.asmx?wsdl, where machinename is the machine on which the service resides.

First, create a Web project. The Web project contains the client that invokes the .NET Web service.

  1. Open Application Developer and click Application Developer icon, or select Start => Programs => IBM WebSphere Studio => Application Developer.
  2. Specify the directory to be used for the session, for example, C:\WSAD v5 Projects\TestDotNet\workspace.
  3. On first use, Application Developer starts with an empty workspace and with the J2EE Perspective open. If it does not, Select Window => Open Perspective => J2EE.
  4. Select File => New => Other. Select Web (on the left frame) and Web Project (on the right frame). Click Next.
    Figure 14. Creating a new Web Project
    Figure 14. Creating a new Web Project
  5. On the Define Web Project screen, give the Web Project a name by typing TestDotNet as the New project name. Click Next.
  6. On the J2EE Settings Page, use the defaults. Under Web Project Features, the items "J2EE Web Project" and "Create a default CSS file" should be selected.
  7. On the Create Web Project window (J2EE Settings Page), check New, then type in the new project name of CreditCheckWebProject.
  8. Leave context root as the Web Project name, that is, TestDotNet.
  9. Leave J2EE level as 1.3 and then click Finish.

Next, create the Web service client.

  1. Select File => New => Other.
  2. Select Web services (on the left frame) and select Web service Client (on the right frame). Click Next.
    Figure 15. Accessing an existing XML Web service
    Figure 15. Accessing an existing XML Web service
  3. Create a Java Client Proxy to allow communication between your Application Developer client and the .NET Web service. On the Review Web services options, the default Client Proxy type should be Java Proxy. Check Create folders when necessary and then click Next.
  4. Specify the location of the .NET Credit Check Web service on the Web Service Client Window. The variable machinename is the machine on which the service resides.

    The WSDL for the Web service installed is http://machinename:port/CreditCheckSetup/CreditCheckWService.asmx?wsdl.

    The WSDL for the Web service written from scratch is http://machinename:port/CreditCheck/CreditCheckWService.asmx?wsdl.

    Click Next.
  5. On the Web Service Binding Proxy Generation screen, accept the defaults (Generate Proxy, Soap binding "returnQuoteServiceSoap" of "returnQuoteServiceSoap").
  6. Click Next and then click Finish on the Web Service Test window.

Test the Web service

To test the Web service, generate a sample client in Application Developer. This sample client generates an input form and displays the results from the Web service.

  1. In the J2EE Navigator, expand TestDotNet/Java Source/proxy.soap and right-click CreditCheckWServiceProxy.java.
  2. Select Web Service - Generate Sample Application.
  3. Select the methods that you would like to test. By default, all methods are selected.
  4. Accept the defaults and click Finish . A browser opens in Application Developer with methods listed in the Methods section of the page.
  5. In the Methods section, click on a method link to test that method. The methods are:
    • returnSimpleQuote (org.tempuri.ReturnSimpleQuoteElement)
    • returnComplexQuote (org.tempuri.ReturnComplexQuoteElement)
    • returnMComplexQuote (org.tempuri.ReturnMComplexQuoteElement)
    Figure 16. Results browser for Web service Test
    Figure 16. Results browser for Web service Test
  6. Click Invoke. The results are displayed in the results panel under the Inputs section.

Expected Results

The following list describes the expected results:

  • The returnSimpleQuote method accepts string values in all the input fields and returns a string that could be either "Sorry you have FAILED the Credit Check" or "You have PASSED the Credit Check".
  • The returnComplexQuote method accepts string values in all the input fields as does returnSimpleQuote. However, it returns a Person object that contains nine strings (title, surname, forename, address1, address2, postcode, country, policyID, and creditScore) and an integer value (creditWeight). creditWeight is a random number assigned to the person and is used to decide whether the person has a passed or failed creditScore (the credit check result).
  • The returnMComplexQuote method accepts string values in all the input fields and returns a complex Person object that consists of an Address object, a Name object, one string value (creditScore) and one integer value (creditWeight).

The proxy class is responsible for calling the Web service and invoking its methods. This class is stored in the TestDotNet project, under Java Source/proxy.soap. The sample application is stored in the TestDotNet project, under Web Content/sample.

If, after closing the Web browser, you choose to re-test the Web services, the sample client can be run manually as follows:

  1. Select the project in the J2EE Navigator, expand TestDotNet and open WebContent => Sample => project name (in this case, CreditCheckWService).
  2. Right-click Test Client, select Run on Server and click Finish.

As shown, Application Developer invokes the .NET Web service and automatically generates a proxy and a sample client application. This is a typical demonstration of interoperability where the .NET Web service has successfully been invoked from Application Developer. The Java proxy class can be used to incorporate this .NET Web services into an application. You can create a servlet or JSP front-end or you can call the Web services straight from a Java client.


Hints and tips

This section contains instructions on how to perform some general tasks not covered in detail in the rest of this article.

How to check a machine name

To check a machine name, do the following:

  1. Right-click My Computer and select Properties.
  2. Click the Network Identification tab. The machine name is the full computer name.

How to check proxy settings

To check proxy settings, do the following:

  1. Select Start => Settings => Control panel.
  2. Double-click Internet options.
  3. Click the Connections Tab.
  4. Click Lan Settings. Proxy settings are shown in the Proxy server section.

How to check the port number on which the .NET Web services listen

To check the port number on which the .NET Web services listen, do the following:

  1. Right-click on My Computer and select Manage.
  2. Expand Services and Applications, and then expand Internet Information Services.
  3. Right-click Default Web Site, and select Properties.
    Figure 17. Accessing Web site properties
    Figure 17. Accessing Web site

    The TCP port number, IP address and description are shown on the Web Site Identification tab.

Resolving errors in Visual Studio .NET

The following error can occur when creating a reference to the Web service in the Visual Studio .NET Web service client:

c:\inetpub\wwwroot\CreditCheckApp2\CCheckForm3.aspx.cs(93): 
The type or namespace name 'creditCheckBeanService' does not exist in the class or 
namespace 'CreditCheckApp2.serviceRef' (are you missing an assembly reference?)

If you receive this error, do the following:

  1. Check that the method exists in the list of methods that can be invoked from the Web service. A blue zigzag line appears beneath the line of code that caused the error.
  2. Delete the line of code after the full stop. In the example in Figure 18 (serviceRef.person), person is underscored with a blue zigzag line. Delete person.
  3. Place the cursor after serviceRef. Press the Control key and the spacebar together to display a menu of the methods that can be invoked from the service.
  4. Double-click the correct method to select it. In this example, the person method does not exist in the list, but the Person (uppercase P) method does.
    Figure 18. Resolving errors in Visual Studio .NET
    Figure 18. Resolving errors in Visual Studio .NET
  5. If the method does not exist on the list, check if you have added the reference to the correct Web service or class library.
  6. Rebuild the project.

Conclusion

Interoperability is the success factor of Web services. Web services clients developed in WebSphere Studio Application Developer can successfully invoke .NET C# Web services. Similarly, .NET Web services clients can successfully invoke Application Developer Web services. Both simple and complex Web services can interoperate regardless of the technology used (J2EE or .NET) and the server infrastructure (WebSphere Application Server or IIS) on which they reside.

This article demonstrated invoking a .NET Web service (deployed on IIS) from an Application Developer client. Part 2 demonstrates invoking an Application Developer Web service (deployed on WebSphere Application Server) from a .NET client.

Acknowledgments

The author thanks Kieran Scott for his help at the early stages of this project and for providing a title for this article. Kieran Scott is a Solution Test Specialist working for WebSphere Platform System House in IBM Hursley Solution Test team. He works on developing solutions to test interoperability between IBM products, specializing in Web services. You can reach Kieran at kierans@uk.ibm.com.


Download

DescriptionNameSize
Code samplesamplecode.zip  ( HTTP | FTP )3.6 MB

Resources

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=13263
ArticleTitle=IBM WebSphere Studio and Microsoft .NET working together -- Part 1
publish-date=08272003