h1. {*}Web Services Translator{*} |
h1. *Web Services Translator* |
|
The Web Services translator, known by the type name {_}ws{_}, name _ws_, exposes stored procedures for calling web services backed by a Teiid WS resource adapter. The WS resource adapter may optionally be configured to point at a specific WSDL. Results from this translator will commonly be used with the TEXTTABLE or XMLTABLE table functions to use CSV or XML formated data. |
|
{*}Execution Properties{*} |
*Execution Properties* |
|| Name || Description || When Used \\ || Default ||
| DefaultBinding | The binding that should be used if one is not specified. Can be one of HTTP, SOAP11, or SOAP12 | invoke\* \\ | SOAP12 |
| DefaultServiceMode | The default service mode. For SOAP, MESSAGE mode indicates that the request will contain the entire SOAP envelope and not just the contents of the SOAP body. Can be one of MESSAGE or PAYLOAD | invoke\* or WSDL call \\ | PAYLOAD |
| XMLParamName | Used with the HTTP binding (typically with the GET method) to indicate that the request document should be part of the query string. | invoke\* \\ | null - unused | |
{note} Setting the proper binding value on the translator is recommended as it removes the need for callers to pass an explicit value. If your service is actually uses SOAP11, but the binding used SOAP12 you will receive execution failures.{note} There are no ws importer settings, but it does provide metadata for dynamic VDBs. If the connection is configured to point at a specific WSDL, the translator will import all SOAP operations under the specified service and port as procedures. |
h3. {*}Usage{*} *Usage* |
The WS translator exposes low level procedures for accessing web services. See also the twitter example in the kit. |
h3. {*}Invoke Procedure{*} |
h3. *Invoke Procedure* |
Invoke allows for multiple binding, or protocol modes, including HTTP, SOAP11, and SOAP12. |
... |
The request XML should be a valid XML document or root element. |
h3. {*}InvokeHTTP Procedure{*} |
h3. *InvokeHTTP Procedure* |
|
{{{}invokeHttp{}}} can {{invokeHttp}} can return the byte contents of an HTTP(S) call. |
{code}Procedure invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, stream in BOOLEAN, contentType out STRING) returns BLOB{code} Action indicates the HTTP method (GET, POST, etc.), which defaults to POST. |
... |
Native queries or a direct query execution procedure is not supported on the Web Services Translator.{info} |
h3. {*}Streaming Considerations{*} |
h3. *Streaming Considerations* |
|
If the stream parameter is set the true, the resulting value document can only be read once. If stream is null or false, then the engine may need to save a copy of the result for repeated use. |
|
If the stream parameter is set to true, then the resulting lob value may only be used a single time. If stream is null or false, then the engine may need to save a copy of the result for repeated use. Care must be used as some operations, such as casting or XMLPARSE may perform validation which results in the stream being consumed. |
|
h3. {*}JCA Resource Adapter{*} |
h3. *JCA Resource Adapter* |
|
Theresource adapter for this translator provided through "Web Service Data Source", Refer to Admin Guide for configuration. |
The resource adapter for this translator provided through [Web Service Data Source|TEIID:Web Service Data Sources]. |
The Web Services translator, known by the type name ws, exposes stored procedures for calling web services backed by a Teiid WS resource adapter. The WS resource adapter may optionally be configured to point at a specific WSDL. Results from this translator will commonly be used with the TEXTTABLE or XMLTABLE table functions to use CSV or XML formated data.
Execution Properties
Name | Description | When Used |
Default |
---|---|---|---|
DefaultBinding | The binding that should be used if one is not specified. Can be one of HTTP, SOAP11, or SOAP12 | invoke* |
SOAP12 |
DefaultServiceMode | The default service mode. For SOAP, MESSAGE mode indicates that the request will contain the entire SOAP envelope and not just the contents of the SOAP body. Can be one of MESSAGE or PAYLOAD | invoke* or WSDL call |
PAYLOAD |
XMLParamName | Used with the HTTP binding (typically with the GET method) to indicate that the request document should be part of the query string. | invoke* |
null - unused |
Setting the proper binding value on the translator is recommended as it removes the need for callers to pass an explicit value. If your service is actually uses SOAP11, but the binding used SOAP12 you will receive execution failures. |
There are no ws importer settings, but it does provide metadata for dynamic VDBs. If the connection is configured to point at a specific WSDL, the translator will import all SOAP operations under the specified service and port as procedures.
The WS translator exposes low level procedures for accessing web services. See also the twitter example in the kit.
Invoke allows for multiple binding, or protocol modes, including HTTP, SOAP11, and SOAP12.
Procedure invoke(binding in STRING, action in STRING, request in XML, endpoint in STRING, stream in BOOLEAN) returns XML
The binding may be one of null (to use the default) HTTP, SOAP11, or SOAP12. Action with a SOAP binding indicates the SOAPAction value. Action with a HTTP binding indicates the HTTP method (GET, POST, etc.), which defaults to POST.
A null value for the binding or endpoint will use the default value. The default endpoint is specified in the WS resource adapter configuration. The endpoint URL may be absolute or relative. If it's relative then it will be combined with the default endpoint.
Since multiple parameters are not required to have values, it is often more clear to call the invoke procedure with named parameter syntax.
call invoke(binding=>'HTTP', action=>'GET')
The request XML should be a valid XML document or root element.
invokeHttp can return the byte contents of an HTTP(S) call.
Procedure invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, stream in BOOLEAN, contentType out STRING) returns BLOB
Action indicates the HTTP method (GET, POST, etc.), which defaults to POST.
A null value for endpoint will use the default value. The default endpoint is specified in the WS resource adapter configuration. The endpoint URL may be absolute or relative. If it's relative then it will be combined with the default endpoint.
Since multiple parameters are not required to have values, it is often more clear to call the invoke procedure with named parameter syntax.
call invokeHttp(action=>'GET')
The request can be one of SQLXML, STRING, BLOB, or CLOB. The request will be sent as the POST payload in byte form. For STRING/CLOB values this will default to the UTF-8 encoding. To control the byte encoding, see the to_bytes function.
Native queries Native queries or a direct query execution procedure is not supported on the Web Services Translator. |
If the stream parameter is set to true, then the resulting lob value may only be used a single time. If stream is null or false, then the engine may need to save a copy of the result for repeated use. Care must be used as some operations, such as casting or XMLPARSE may perform validation which results in the stream being consumed.
The resource adapter for this translator provided through Web Service Data Source.