When you create a Web service portlet, you must have access to where that service lives on the Internet. EP allows you to identify Web services that you want to use in a portlet either of two ways—using a service key or using WSDL.
Service key – is a globally unique identifier that refers to a service published in a UDDI Business Registry.
WSDL – a normalized description of disparate software that allows users to access the software in a manner independent of protocol or location.
Creating a Web service element using WSDL
Use this procedure to create a Web Studio element that uses the standard Web Services Description Language (WSDL).
Specify the location in which the Web service files will be generated and from where they are exposed.
Open global.properties.xml in WordPad on Windows or in any text editor on UNIX.
Locate the WebServiceRoot property in the UWP property group and modify the default value if necessary. There are two ways to specify where to put the generated Web service files:
Enter the absolute location; for example, if you enter d:\work\service\ws on Windows or /work0/service/ws on UNIX, the system adds files directly to the specified location. Ensure that the location can be accessed from a URL, such as http://localhost:8085/onepage/ws.
Enter the relative location. For example, if you enter service\ws on Windows or service/ws on UNIX, the system adds files to the location relative to the current Web application; specifically, \work0\tomcat\webapps\onepage\service\ws on Windows or /work0/tomcat/webapps/onepage/service/ws on UNIX. Ensure that the location can be accessed from a URL, such as http://localhost:8085/onepage/service/ws.
Log in to Web Studio and select Build | Portlets from the left pane.
Click the down arrow beside the New icon and select New Aggregated Portlet.
When the Portlet Builder displays, click the down arrow beside the Add button, and select Web Service Element.
You see the Web Service Element Definition window.
Create a Web service element using WSDL URLs:
UDDI Operator – accept the default. This field is not used when you are using WSDL.
Services – select WSDL, then enter a Web service WSDL location in the provided text field and press Enter; for example:
http://www.xmethods.net/wsdl/query.wsdl
This is a sample Web service that provides a SOAP remote procedure
call (RPC) interface to the xmethods.net Web site for query operations.
xmethods.net provides a listing of publicly available Web services.
Click GetMethod. The system retrieves the WSDL XML. The list of defined services is extracted from the WSDL file and populates the Method drop-down list.
Select a method from the drop-down list.
Click Preview. The system lists the input parameters of the selected Web service method in the preview pane.
Click Next and enter an element name.
Click Finish.
Creating a Web service element using a service key
This procedure lets you use a globally unique identifier (service key) to reference a Web service in the UDDI Registry. Service keys are hexadecimal strings generated when a Web service is registered with a UDDI registry. For example, when you search the Web service provider for UDDI Web services registries, you see the service key in addition to other information about the service.
Search Rated UDDI Description: Search UDDI using rated and validated information only. This service looks at all UDDI entries and allocates a weighting to each record depending on validity and completeness. You can then search UDDI registry and retrieve only valid records. Service Key: 5ad60ec4-846a-4517-b391-724bcbddbe26 Provider: Lucin Date Added: Aug 12, 2002 Average response time: 0.32 seconds Price (per transaction): Free
Log in to Web Studio.
Open Internet Explorer, enter the Web Studio URL in the Address entry field, and press Enter.
When the Web Studio Login window displays, enter your user name and password, then click Login.
You see the Web Studio Welcome window.
Select Build | Portlets from the Web Studio left pane.
Select New from the Portlet manager toolbar to create an Aggregated Web services element.
When the Choose Portlet Type window displays, select Web services, then click Next.
At the Web Services Element Definition window, create a Web service element using a service key.
UDDI Registry – from the drop-down list, select the UDDI registry that specifies where to look for the key definition.
Services – select Key, then enter the Web services key in the provided text field and press Enter; for example:
8BD03750-BBE2-11D6-B8B8-000629DC0A7B
You obtain this key from the UDDI Registry where the associated Web service is published.
Click GetMethod. The system retrieves the WSDL XML. From the WSDL, the list of defined services is extracted and populates the Method drop-down list.
Select a method from the drop-down list.
Click Preview. The system extracts the input parameters of the selected Web service method and lists them in the preview pane.
Publishing a portlet to a UDDI registry as a Web service
Log in to Web Studio and select Build | Portlets.
In the detail window, select the Approved status, then select the portlet that you want to publish as a Web service.
Click Publish to UDDI on the Portlet Manager toolbar. You see the Publish to UDDI window.
Complete the fields in the Publish to UDDI window:
Service Name – enter the name by which this portlet is to be published; for example, “Welcome.”
Provider Name – select or define a new Web service provider under whose name the portlet Web service is to be published. To update or create a new provider, click Details.
When you define a new provider, you see the window where you can enter or update the information about the provider.
Enter or update the information on the Provider Details window:
Provider Name – the provider of the Web service.
Person Name – the contact person.
E-mail Address – the provider’s e-mail address.
Provider Description – optional description of the provider.
Click OK.
Complete the remaining fields on the Publish to UDDI window:
Category – select a category from the drop-down list for the Web service.
UDDI Registry – select from a list of preconfigured UDDI Registries. See “Creating new UDDI registry entries” on page 49 for instructions on adding new entries to the registry list.
User name – enter the user name used to access the UDDI registry.
Password – enter the password used to access the UDDI registry.
Respond with HTML – select this option to receive a response in HTML rather than an XML format.
Remember Settings – select this option to have the system remember the settings on this page for this session.
Click OK.
The system generates the Web service definition interface, the implementation WSDL files, and the deployment file in the directory specified for the WebServiceRoot property entry in global.properties.xml. You may have to wait for several seconds before the system responds.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |