When you create a Web service application, you must have access to where that service resides on the Internet. UA allows you to identify Web services that you want to use in an application 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 independent of protocol or location.
Creating a Web service element
Use this procedure to create a Mobile 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 by opening the global.properties.xml file located in:
Tomcat %SYBASE%\tomcat\webapps\onepage\config
Locate the WebServiceRoot property in the UWP property group and modify the default value if necessary. There are two ways to specify the location of generated Web service files:
Enter the absolute location; for example, if you enter d:\work\service\ws, 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, the system adds files to the location relative to the current Web application. Ensure the location can be accessed from a URL, such as http://localhost:8085/onepage/service/ws.
Select Build | Applications. Right-click in the detail view and select New Aggregated Application.
In the Application Builder, click the down arrow beside the Add button, and select Web Service Element. You see the Web Service Element Definition window.
In the Web Service Element Definition window, enter:
Service Type – select from:
WSDL
UDDI Key – enter the UDDI key.
Use Standardization XSLT – indicates whether to use an XSLT file.
Standardization XSLT – search for the XSLT file to use.
UDDI Registry – select the UDDI Registry from the drop-down list.
WSDL URL – enter a Web service WSDL location. 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.
Method – when you click Get Method, 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 and click Input to see a list of the input parameters of the selected Web service method in the bottom pane.
If you select a method where the Web service requires session information in the SOAP header, you must also select Define Login Method.
Enable Grid Rules – shows the output in grid format.
If you want the Web service application to be viewable
on a mobile device, you must check the Enable Grid Rules box, define content
XSLT, and provide input parameters before going to the next step.
Define Login Method – select this option if you select a method, where the Web services require session information in the SOAP header.
When you select this option, two new fields appear:
Login Method – select from the list of methods.
Login Param – enter the user name and password to use with the selected login method.
Enable Basic Authentication – allows you to enter a user name and password for basic authentication when working with authentication protected URLs. When you select this option, two new fields appear:
User Name
Password
The user name and password you enter are used internally by the Web services element for basic authentication of HTTP requests of SOAP calls.
Content XSLT – search for and select a content XML-to-XSLT transformation file, or create content XSLT.
In UA Web services, UA uses cached information for the templates.
If you make changes to the cached Content XSLT template, the changes
do not take effect until the next Tomcat server restart.
UI XSLT – search for and select a UI XML-to-XSLT transformation file.
Click Next.
If you selected Enable Grid Rules, you see the Define, and Filter windows. Provide the input for each window, and click Next.
In the Finish window, in Element Name, enter an element name, and click Finish.
Save the application. Regardless of the element type, save the element and application as described in “Saving applications”.
Creating a Web service element using a service key
In this procedure, 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 www.bindingpoint.com 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
Select Build | Applications. Right-click in the detail view and select New Aggregated Application.
When the Application Builder displays, click the down arrow beside the Add button, and select Web Service Element.
You see the Web Service Element Definition window.
In the Web Services Element Definition window:
Service Type – select UDDI Key.
UDDI Registry – select the UDDI registry that specified where to look for the key definition.
UDDI Key – enter the Web services key. 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 Method drop-down list.
Click Preview. The system extracts the input parameters of the selected Web service method and lists them in the preview pane.
Click Next.
In the Finish window, enter an element name in Element Name, and click Finish.
Save the application.
Regardless of the element type, the procedure to save the element and application is the same. See “Saving applications” for instructions.
Publishing an application to a UDDI registry as a Web service
Log in to Mobile Web Studio and select Build | Applications.
In the Application Manager, select Approved, then from the detail view, select the application that you want to publish as a Web service.
On the Application Manager toolbar, click Publish to UDDI. You see the Publish to UDDI window.
Complete the fields in the Publish to UDDI window:
Service Name – enter the name by which this application is to be published; for example, “Welcome.”
Provider Name – select or define a new Web service provider under whose name the application 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 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 – receive a response in HTML rather than an XML format.
Remember Settings – 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.