Web Services can be invoked:
For testing Data Services: This method allows you to check that your data services are running correctly. See Setting Up Data Services for more information.
In packages using the SnpsInvokeWebService tool: This tool allows you to invoke any third party web service, and save the response in a XML file that can be processed with Oracle Data Integrator.
A specific graphical interface exists to help you create Web Service requests.
The graphical interface for Web Services appears as shown below:
At the top, the basic properties: Step name, WSDL location and port.
At bottom left, the list of operations for the selected port. A second tab displays the HTTP request options.
At the bottom right, the SOAP editor displays the web service request and response.
The basic properties are:
Step Name: The name of the package step.
Web Service Description File (WSDL) URL: This file describes the Web Service and the format of the requests and responses.
Port: If the WSDL defines several ports on which Web Services can be accessed, the list of ports appears here.
In the Options tab, the HTTP requests options appear:
Timeout: The web service request waits for a reply for this time before considering that the server will not provide a response and an error is produced.
HTTP Authentication: If you check this box, you should provide a user and password to authenticate on your HTTP server.
The toolbar provides the following features:
Invoke Web Service: Invokes immediately the current Web Service, displaying the response in the SOAP editor.
Switch Panel Position: Tiles vertically or horizontally the SOAP editor.
Export Response XSD: Saves the current response XML schema description to a file.
Restore Default Request: Discards the current request and reverts to a default, blank request structure.
Delete Empty Optional Components: Removes all blank optional elements from the query. This may be necessary to construct a valid query.
: Automatically delete empty optional elements in the SOAP request when the Invoke Web Service button is used. This checkbox has no effect on package steps at run-time.
: Uses a SOAP request stored in a file instead of the contents of the SOAP editor.
: Specifies a maximum period of time to wait for the request to complete.
The SOAP Editor allows you to graphically build the SOAP request for the Web Service and display the response.
If creating a SnpsInvokeWebService step, this SOAP request filled in the editor is saved with the step.
The upper part of the editor shows the hierarchical structure of the
query, the lower part shows the structure of the response. This arrangement
can be changed using the Switch
Panel Position button.
The raw XML source of the SOAP request and response are shown on the Source tab.
In the editor, you can fill in the Value (and optionally the Attributes) for each element of your request.
Warning: An empty element
is passed as is to the Web service. For strings, this corresponds to an
empty string. For numbers or date types, this may cause an error to occur.
If you want to send a null string, number or date, it is recommended to
use the nil="true"
attribute.
To remove empty elements, use the Delete
Empty Optional Components option.
Optional elements are displayed in italic. Repeatable elements are labelled with ...(n*) after the name.
Right-click any element to perform one of the following operations, if possible:
Duplicate content - copies the structure and content of the element.
Duplicate structure - copies the structure but leaves all fields blank.
Delete - deletes the element.
Export Request - exports the entire soap request to an XML file.
This part of the interface appears only when using a SnpsInvokeWebService step in a package, to control how the response is written to a XML file.
File Mode (-RESPONSE_MODE): One of NEW_FILE, FILE_APPEND, NO_FILE
Result File (-RESPONSE_FILE): The name of the result file to write.
XML Charset (-RESPONSE_XML_ENCODING): The name of the character encoding to write into the XML file.
Java Charset (-RESPONSE_FILE_CHARSET): The name of the character encoding used when writing the file.
See SnpsInvokeWebService for more information on these parameters.
Note: The result file parameters are only taken into account at run-time. No result file is generated when using the Invoke Web Service button.
To create a Web Service request:
Create a SnpsInvokeWebService tool step in a package, or right-click a datastore and select Test Web Service in the popup menu.
Fill in the location of the WSDL. You can use either:
A URL for a WSDL that has been deployed to a server (e.g. http://host:8080/axis2/services/WSCustomer?wsdl)
A local file location (e.g. file:///C:/DataServices/WSCustomer.wsdl )
Choose a Port, if more than one is available. If no ports are available, there is a problem with the WSDL.
Choose an Operation from the list on the left.
Fill in request in the SOAP Editor. You can also use an external request file instead.
(Optional) Click the Delete empty optional elements button to remove optional elements which have not been filled in. Some Web Services treat blank elements as invalid.
Click the Invoke Web Service button to immediately invoke the
Web Service.
The response is shown in the SOAP Editor.
If you are creating a SnpsInvokeWebService tool step, define the result file parameters then click Apply to save your step.
When using SnpsInvokeWebService to call a web service, the response is written to an XML file.
Processing this file can be done with Oracle Data Integrator, using the following guidelines:
Invoke the web service once and use the Export Response XSD option to export the XML schema.
Create an XML model for the SOAP response, based on this XML schema file and reverse-engineer the XSD to have your model structure. See Creating and Reverse-Engineering a Model for an XML file for more information.
You can now on process the information from your responses using regular Oracle Data Integrator interfaces. See Choosing the Right KMs for XML files for more information.
Note: Each XML file is defined as a model in Oracle Data Integrator. It is recommended to use model folders to arrange them. See Organizing Models into Model Folders for more information.