This will invoke the specified SOAP service.
2advanced mode : output will consist of vector of 5 items as:
The function will return a XML tree of the SOAP response in simple mode. Also if one-way message is sent and no body from the SOAP server, then NULL will be returned. When advanced mode is set i.e. 'style' have second bit set, then response will be as described earlier in 'style' parameter description.
When users going to do operation with an HTTPS endpoint the following are requirments to the PKCS#12 file. The file specified in parameter 'ticket' MUST contain: valid x509 certificate, certificate chain and private key. The password for opening the private key must be specified in the 'passwd' parameter. How client and server certificates and private keys are created are not subject of this document. Also see Web server documentation about how to run an HTTPS listener.
References: tutorial/services WS-S-2 (tripple-des), WS-S-3 (RSA), WS-S-4 (X.509 signing)
The following is an excerpt from the WS-S-2 Services tutorial to make encoded SOAP message with a shared key.
resp := SOAP_CLIENT ( url=>'http://localhost:8890/SecureWebServices', operation=>'AddInt', parameters=>vector (vector ('a', 'int'), 3, vector ('b', 'int'), 4), auth_type=>'key', ticket=>xenc_key_inst_create ('WSDK Sample Symmetric Key'), security_type=>'encrypt', target_namespace=>'http://temp.uri/', soap_action=>'"http://temp.uri/#AddInt"', style=>6);
This will produce following SOAP message:
The encoded SOAP request
------------ REQUEST ------------------ <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" encodingType="http://schemas.xmlsoap.org/soap/encoding/" > <Header xmlns="http://schemas.xmlsoap.org/soap/envelope/" > <Security xmlns="http://schemas.xmlsoap.org/ws/2002/07/secext" > <ReferenceList xmlns="http://www.w3.org/2001/04/xmlenc#" > <DataReference xmlns="http://www.w3.org/2001/04/xmlenc#" URI="#Id-6831bf5c-f4dc-d611-bb59-90b4c67d3be5" /> </ReferenceList> </Security> </Header> <Body xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Content" Id="Id-6831bf5c-f4dc-d611-bb59-90b4c67d3be5" > <EncryptionMethod xmlns="http://www.w3.org/2001/04/xmlenc#" Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" /> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#" > <KeyName xmlns="http://www.w3.org/2000/09/xmldsig#" >WSDK Sample Symmetric Key</KeyName> </KeyInfo> <CipherData xmlns="http://www.w3.org/2001/04/xmlenc#" > <CipherValue xmlns="http://www.w3.org/2001/04/xmlenc#" >s8YHzbGSxsgfslN6 eJu7UeiTExKeqwCHrqFml24C6mY8SLxhNE0Vy6xBuS50uchjbupjE4Z8EtkSuyljR8mkpmrW GCfUQEvrW7iu1ji0j4XR7m5P4dgxh7RYwqxqoprwTnCZ9b6X9D/UpN0aAYVdNs+S6l2Rw56d s5Gf4sv2f/sTYpEHTYPReqyo+9LSm9CsbtlPXia9djkH+75PUtsKZXZvHnVfHICQGjBJPpsh eE7Dq7mt8AkKVQ==</CipherValue> </CipherData> </EncryptedData> </Body> </Envelope> ---------------------------------------
Server approves the request and returns an unencrypted message. This shows one-way encoding only.
------------ RESPONSE ----------------- <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > <Body xmlns="http://schemas.xmlsoap.org/soap/envelope/" > <AddIntResponse xmlns="http://temp.uri/" > <CallReturn type="http://www.w3.org/2001/XMLSchema:int" >7</CallReturn> </AddIntResponse> </Body> </Envelope> ---------------------------------------
This example makes call to the interop round4 test echoVoidSoapHeader (exists in the demo DB). Request and response wire dumps are listed below PL code excerpt.
... resp := soap_client (url=>url, operation=>'echoVoidSoapHeader', parameters=>vector(), headers=>vector( vector('echoMeStringRequest', 'http://soapinterop.org/:echoMeStringRequest', 1, 'http://schemas.xmlsoap.org/soap/actor/next') , vector('String')), style=>7, soap_action=>'"http://soapinterop.org"', target_namespace=>'http://soapinterop.org' ); ...
This will produce the following SOAP message:
The SOAP request
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://soapinterop.org/echoheader/" xmlns:ns0="http://soapinterop.org/"> <SOAP:Header> <ns0:echoMeStringRequest SOAP:mustUnderstand='1' SOAP:actor='http://schemas.xmlsoap.org/soap/actor/next'> <ns1:varString>String</ns1:varString> </ns0:echoMeStringRequest> </SOAP:Header> <SOAP:Body> <echoVoidSoapHeader xmlns='http://soapinterop.org' ></echoVoidSoapHeader> </SOAP:Body> </SOAP:Envelope>
And will receive the SOAP server response:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://soapinterop.org/echoheader/" xmlns:ns1="http://soapinterop.org/" xmlns:ns0="http://soapinterop.org"> <SOAP:Header> <ns1:echoMeStringResponse> <ns2:varString>String</ns2:varString> </ns1:echoMeStringResponse> </SOAP:Header> <SOAP:Body> <ns1:echoVoidSoapHeaderResponse /> </SOAP:Body> </SOAP:Envelope>
The example code below makes a simple 'upper-case' service, exposes it under secured endpoint and invoke with x509 certificate. Note that default HTTPS listener MUST be enable in the INI file. Also the cli5.p12 certificate file MUST exists in server working directory.
SQL> create procedure WS.SOAPDEMO.SOAPTEST (in par varchar) { return (upper(par)); }; SQL> grant execute on WS.SOAPDEMO.SOAPTEST to SOAPDEMO; SQL> VHOST_DEFINE (vhost=>'*sslini*',lhost=>'*sslini*',lpath=>'/secure', ppath=>'/SOAP/',soap_user=>'SOAPDEMO'); -- SSL connection with server's certificate verification SQL> select xpath_eval ('//CallReturn/text()', xml_tree_doc ( soap_client (url=>'https://localhost:4443/secure', operation=>'SOAPTEST', parameters=>vector('par', 'demotext'), ticket=>'cli5.p12', passwd=>'secret'))); -- SSL connection only, no certificate verification SQL> select xpath_eval ('//CallReturn/text()', xml_tree_doc ( soap_client (url=>'https://localhost:4443/secure', operation=>'SOAPTEST', parameters=>vector('par', 'demotext'), ticket=>'1'))); -- response callret VARCHAR _______________________________________________________________________________ DEMOTEXT