Hi all,
When we try to invoke a response from a SOAP web service through Oracle-APEX by creating a Web Service Reference through shared Components or making a web request thru apex_web_service.make_request() in a function is resulting in
HTTP response 415 - Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.
The function created for your reference:
create or replace FUNCTION BD_GetPinCode(
P_Pincode IN VARCHAR2,
P_ProductCode IN VARCHAR2,
P_CustomerCode IN VARCHAR2,
P_license_key IN VARCHAR2,
P_login_id IN VARCHAR2
)
RETURN VARCHAR2
AS
l_envelope CLOB;
l_xml XMLTYPE;
l_result VARCHAR2(32767);
BEGIN
l_envelope := '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/" xmlns:sapi="http://schemas.datacontract.org/2004/07/SAPI.Entities.Admin">
<soap:Body>
<tem:GetServicesforPincode>
<!--Optional:-->
<tem:pinCode>P_Pincode</tem:pinCode>
<!--Optional:-->
<tem:profile>
<!--Optional:-->
<sapi:Customercode>P_CustomerCode</sapi:Customercode>
<!--Optional:-->
<sapi:LicenceKey>P_license_key</sapi:LicenceKey>
<!--Optional:-->
<sapi:LoginID>P_login_id</sapi:LoginID>
</tem:profile>
</tem:GetServicesforPincode>
</soap:Body>
</soap:Envelope>';
l_xml := APEX_WEB_SERVICE.make_request(
p_url => 'http://netconnect.bluedart.com/Ver1.10/Demo/ShippingAPI/Finder/ServiceFinderQuery.svc',
p_action => 'http://netconnect.bluedart.com/Ver1.10/Demo/ShippingAPI/Finder/ServiceFinderQuery.svc/GetServicesforPincode',
p_envelope => l_envelope );
l_result := APEX_WEB_SERVICE.parse_xml(
p_xml => l_xml,
p_xpath => '//GetServicesforPincode/PinCodeServiceDetailsReference',
p_ns => 'xmlns:ns1="http://netconnect.bluedart.com/Ver1.10/Demo/ShippingAPI/Finder/"' );
DBMS_OUTPUT.put_line('l_result=' || l_result);
RETURN l_result;
END;
Any help on this will be highly appreciated.
Regards
Raja Ramamoorthy
raja@transnet.in