Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

calling soap webservice from APEX_WEB_SERVICE

3230404Sep 8 2019 — edited Sep 9 2019

Hi everyone, im new in apex and im trying to call and consume a soap webservice from oracle database using APEX_WEB_SERVICE, i have oracle 12.2.0.1 and APEX 19.1.

the webservice is working fine from SOAP UI, the wsdl file is attached "WS.txt"

i have created the b@elow function as a sample to test the call of this ws:

CREATE OR REPLACE FUNCTION LUAY_APEX_TRAINING.test (p_int_1  IN  NUMBER,

                                        p_int_2  IN  NUMBER)

  RETURN NUMBER

AS

  l_envelope  CLOB;

  l_xml       XMLTYPE;

  l_result    VARCHAR2(32767);

BEGIN

  -- Build a SOAP document appropriate for the web service.

  l_envelope := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tcib="http://temenos.com/TCIBSelfReg">

   <soapenv:Header/>

   <soapenv:Body>

      <tcib:TCIBSelfRegistrationARRtst>

         <!--Optional:-->

         <WebRequestCommon>

            <!--Optional:-->

            <company>PS0010001</company>

            <password>Adham@321</password>

            <userName>U1007901</userName>

         </WebRequestCommon>

         <!--Optional:-->

         <OfsFunction>

            <!--Optional:-->

            <activityName></activityName>

            <!--Optional:-->

            <assignReason></assignReason>

            <!--Optional:-->

            <dueDate></dueDate>

            <!--Optional:-->

            <extProcess></extProcess>

            <!--Optional:-->

            <extProcessID></extProcessID>

            <!--Optional:-->

            <gtsControl></gtsControl>

            <!--Optional:-->

            <messageId></messageId>

            <!--Optional:-->

            <noOfAuth></noOfAuth>

            <!--Optional:-->

            <owner></owner>

            <!--Optional:-->

            <replace></replace>

            <!--Optional:-->

            <startDate></startDate>

            <!--Optional:-->

            <user></user>

         </OfsFunction>

         <!--Optional:-->

         <AAARRANGEMENTACTIVITYTCIBSELFRRRType id="">

            <!--Optional:-->

            <Arrangement>NEW</Arrangement>

            <!--Optional:-->

            <Activity>INTERNET.SERVICES-NEW-ARRANGEMENT</Activity>

            <!--Optional:-->

            <EffectiveDate>2018-04-04</EffectiveDate>

            <!--Optional:-->

            <Customer>12</Customer>

            <!--Optional:-->

            <Product>TCIB.PERSONAL</Product>

         </AAARRANGEMENTACTIVITYTCIBSELFRRRType>

      </tcib:TCIBSelfRegistrationARRtst>

   </soapenv:Body>

</soapenv:Envelope>';

  -- Get the XML response from the web service.

  l_xml := APEX_WEB_SERVICE.make_request(

    p_url      => 'http://10.60.60.61:8080/TCIBSelfReg/services',

    p_action   => 'http://10.60.60.61:8080/TCIBSelfReg/TCIBSelfRegistrationAAActivity',

    p_envelope => l_envelope

  );

  -- Display the whole SOAP document returned.

  DBMS_OUTPUT.put_line('l_xml=' || l_xml.getClobVal());

  -- Pull out the specific value of interest.

  l_result := APEX_WEB_SERVICE.parse_xml(

    p_xml   => l_xml,

    p_xpath => '//return/text()',

    p_ns    => 'xmlns:ns1="http://temenos.com/TCIBSelfReg"'

  );

  DBMS_OUTPUT.put_line('l_result=' || l_result);

  RETURN TO_NUMBER(l_result);

END;

when i call the function i always end up with the error attached "ws error.txt"

can anyone guide me plz.

really appreciated.

BR

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!--
Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.3-b01-.
-->
<!--
Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.3-b01-.
-->
<types>
<xsd:schema>
</xsd:schema>
<xsd:schema>
</xsd:schema>
</types>
<message name="TCIBSelfRegistrationAAActivity">
<part name="parameters" element="tns:TCIBSelfRegistrationAAActivity"/>
</message>
<message name="TCIBSelfRegistrationAAActivityResponse">
<part name="parameters" element="tns:TCIBSelfRegistrationAAActivityResponse"/>
</message>
<message name="TCIBSelfRegistrationAAActivity_Validate">
<part name="parameters" element="tns:TCIBSelfRegistrationAAActivity_Validate"/>
</message>
<message name="TCIBSelfRegistrationAAActivity_ValidateResponse">
<part name="parameters" element="tns:TCIBSelfRegistrationAAActivity_ValidateResponse"/>
</message>
<message name="TCIBSelfRegistrationExtUser">
<part name="parameters" element="tns:TCIBSelfRegistrationExtUser"/>
</message>
<message name="TCIBSelfRegistrationExtUserResponse">
<part name="parameters" element="tns:TCIBSelfRegistrationExtUserResponse"/>
</message>
<message name="TCIBSelfRegistrationExtUser_Validate">
<part name="parameters" element="tns:TCIBSelfRegistrationExtUser_Validate"/>
</message>
<message name="TCIBSelfRegistrationExtUser_ValidateResponse">
<part name="parameters" element="tns:TCIBSelfRegistrationExtUser_ValidateResponse"/>
</message>
<portType name="T24WebServicesImpl">
<operation name="TCIBSelfRegistrationAAActivity">
<input wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationAAActivityRequest" message="tns:TCIBSelfRegistrationAAActivity"/>
<output wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationAAActivityResponse" message="tns:TCIBSelfRegistrationAAActivityResponse"/>
</operation>
<operation name="TCIBSelfRegistrationAAActivity_Validate">
<input wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationAAActivity_ValidateRequest" message="tns:TCIBSelfRegistrationAAActivity_Validate"/>
<output wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationAAActivity_ValidateResponse" message="tns:TCIBSelfRegistrationAAActivity_ValidateResponse"/>
</operation>
<operation name="TCIBSelfRegistrationExtUser">
<input wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationExtUserRequest" message="tns:TCIBSelfRegistrationExtUser"/>
<output wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationExtUserResponse" message="tns:TCIBSelfRegistrationExtUserResponse"/>
</operation>
<operation name="TCIBSelfRegistrationExtUser_Validate">
<input wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationExtUser_ValidateRequest" message="tns:TCIBSelfRegistrationExtUser_Validate"/>
<output wsam:Action="http://temenos.com/TCIBSelfReg/T24WebServicesImpl/TCIBSelfRegistrationExtUser_ValidateResponse" message="tns:TCIBSelfRegistrationExtUser_ValidateResponse"/>
</operation>
</portType>
<binding name="T24WebServicesImplPortBinding" type="tns:T24WebServicesImpl">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="TCIBSelfRegistrationAAActivity">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="TCIBSelfRegistrationAAActivity_Validate">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="TCIBSelfRegistrationExtUser">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="TCIBSelfRegistrationExtUser_Validate">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="T24WebServicesImplService">
<port name="T24WebServicesImplPort" binding="tns:T24WebServicesImplPortBinding">
</port>
</service>
</definitions>
This post has been answered by Pavel_p on Sep 9 2019
Jump to Answer
Comments
Post Details
Added on Sep 8 2019
5 comments
1,429 views