How to Call WebService from Oracle DB Using UTL_DBWS and Return Results in XML Format (Doc ID 746455.1)

Last updated on MARCH 16, 2017

Applies to:

Web Services - Version 10.1.3.1.0 to 10.1.3.4.0 [Release Oracle10g]
Information in this document applies to any platform.
Oracle Server - Enterprise Edition - Version: 10.2.0.4
Oracle Server - Enterprise Edition - Version: 11.1.0.6
***Checked for relevance on 24-JUL-2013***

Goal

This article provides a method for consuming a Document Style Web Service using the UTL_DBWS package.  It calls a web service deployed in Oracle Application Server 10.1.3.1 or later.  The sample will work inside Oracle Database version 10.2.0.4 and 11.1.0.6.  The web service returns the following results:

<ns0:getBrandsResponse xmlns:ns0="http://www.sample.com/sampleservice">

<ns0:return>
<ns0:item>
<ns0:code>SomeName</ns0:code>

<ns0:name>SomeName</ns0:name>
<ns0:id>123</ns0:id>
</ns0:item>

<ns0:item>
<ns0:code>SomeCode</ns0:code>

<ns0:name>aName</ns0:name>
<ns0:id>223</ns0:id>
</ns0:item>

</ns0:return>
</ns0:getBrandsResponse>

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms