<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Web+Services+Translator">Web Services Translator</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://docs.jboss.org/author/display/~van.halbert">Van Halbert</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="WebServicesTranslator-"></a><font color="#000000"><b>Web Services Translator</b></font></h1>

<p><font color="#333333">The Web Services translator, known by the type name&nbsp;</font><font color="#333333"><em>ws</em></font><font color="#333333">, 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.&nbsp; Results from this translator will commonly be used with the TEXTTABLE or XMLTABLE table functions to use CSV or XML formated data.</font></p>

<p><font color="#333333"><b>Execution Properties</b></font><font color="#333333">&nbsp;</font></p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> <font color="#000000">Name</font> </th>
<th class='confluenceTh'> <font color="#000000">Description</font> </th>
<th class='confluenceTh'> <font color="#000000">When Used</font><br class="atl-forced-newline" /> </th>
<th class='confluenceTh'> <font color="#000000">Default</font> </th>
</tr>
<tr>
<td class='confluenceTd'> <font color="#333333">DefaultBinding</font> </td>
<td class='confluenceTd'> <font color="#333333">The binding that should be used if one is not specified. Can be one of HTTP, SOAP11, or SOAP12</font> </td>
<td class='confluenceTd'> <font color="#333333">invoke&#42;</font><br class="atl-forced-newline" /> </td>
<td class='confluenceTd'> <font color="#333333">SOAP12</font> </td>
</tr>
<tr>
<td class='confluenceTd'> <font color="#333333">DefaultServiceMode</font> </td>
<td class='confluenceTd'> <font color="#333333">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</font> </td>
<td class='confluenceTd'> <font color="#333333">invoke&#42; or WSDL call</font><br class="atl-forced-newline" /> </td>
<td class='confluenceTd'> <font color="#333333">PAYLOAD</font> </td>
</tr>
<tr>
<td class='confluenceTd'> <font color="#333333">XMLParamName</font> </td>
<td class='confluenceTd'> <font color="#333333">Used with the HTTP binding (typically with the GET method) to indicate that the request document should be part of the query string.</font> </td>
<td class='confluenceTd'> <font color="#333333">invoke&#42;</font><br class="atl-forced-newline" /> </td>
<td class='confluenceTd'> <font color="#333333">null - unused</font> </td>
</tr>
</tbody></table>
</div>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><font color="#333333">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.</font></td></tr></table></div>
<p><font color="#333333">There are no ws importer settings, but it does provide metadata for dynamic VDBs.&nbsp; 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.</font></p>

<h3><a name="WebServicesTranslator-"></a><font color="#000000"><b>Usage</b></font></h3>

<p><font color="#333333">The WS translator exposes low level procedures for accessing web services. See also the twitter example in the kit.</font></p>

<h3><a name="WebServicesTranslator-"></a><font color="#000000"><b>Invoke Procedure</b></font></h3>

<p><font color="#333333">Invoke allows for multiple binding, or protocol modes, including HTTP, SOAP11, and SOAP12.</font></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">Procedure invoke(binding in STRING, action in STRING, request in XML, endpoint in STRING, stream in BOOLEAN) returns XML</pre>
</div></div>
<p><font color="#333333">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.</font></p>

<p><font color="#333333">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.</font></p>

<p><font color="#333333">Since multiple parameters are not required to have values, it is often more clear to call the invoke procedure with named parameter syntax.</font></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">call invoke(binding=&gt;'HTTP', action=&gt;'GET')</pre>
</div></div>
<p><font color="#333333">The request XML should be a valid XML document or root element.</font></p>

<p><font color="#333333">If the stream parameter is set the true, the resulting value document can only be read once. This is appropriate when directly passing the XML into XMLQUERY or XMLTABLE and only a single pass against the document is needed. If stream is null or false, then the engine may need to save a copy of the document for repeated use.</font></p>

<h3><a name="WebServicesTranslator-"></a><font color="#000000"><b>InvokeHTTP Procedure</b></font></h3>

<p><font color="#333333"><tt>invokeHttp</tt></font><font color="#333333">&nbsp;can return the byte contents of an HTTP(S) call.</font></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">Procedure invokeHttp(action in STRING, request in OBJECT, endpoint in STRING, stream in BOOLEAN, contentType out STRING) returns BLOB</pre>
</div></div>
<p><font color="#333333">Action indicates the HTTP method (GET, POST, etc.), which defaults to POST.</font></p>

<p><font color="#333333">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.</font></p>

<p><font color="#333333">Since multiple parameters are not required to have values, it is often more clear to call the invoke procedure with named parameter syntax.</font></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">call invokeHttp(action=&gt;'GET')</pre>
</div></div>
<p><font color="#333333">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.</font></p>

<p><font color="#333333">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.</font></p>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Native queries</b><br /><font color="#333333">Native or direct query execution is not supported on the Web Services Translator</font></td></tr></table></div>

<h3><a name="WebServicesTranslator-"></a><font color="#000000"><b>JCA Resource Adapter</b></font></h3>

<p><font color="#333333">Theresource adapter for this translator provided through "Web Service Data Source", Refer to Admin Guide for configuration.</font></p>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
       <a href="https://docs.jboss.org/author/display/TEIID/Web+Services+Translator">View Online</a>
              |
       <a href="https://docs.jboss.org/author/display/TEIID/Web+Services+Translator?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>