Native web services in Oracle 11 g

Y at - there no official explanation on how to configure and create native web services to Oracle 11 g and how to properly secure these services? Since Oracle APEX now supports web services use SOAP and REST, it makes sense to have more explanation on creating and securing web services. As know many PL/SQL programmers, it isn't always an easy task to develop web services in jDeveloper to work with databases - with all of these technologies to Add on as jPublisher/Toplink to get the job of things. It is not easy to get the 'How to' guide on creating and securing of the native web services in Oracle 11 g.

Thank you.

Andy

Hello.

If you are still looking for this answer, you can try this.

http://www.Oracle-base.com/articles/11g/native-Oracle-XML-DB-Web-services-11gr1.php

The article has links to documentation and other resources at the bottom.

See you soon

Tim...

Tags: Database

Similar Questions

  • Could not get the native web service response to Oracle using a PL/SQL < Message > function <! [CDATA [component "WS_CALC" must be said]] > < / Message >

    Hi, we have a problem with oracle native web service access using a PL/SQL function. We are running out of ideas how to solve the problem. Someone would be so nice to take a look at our case. Thank you much in advance. Best regards, Smiljana

    CREATE TABLE for_web_info (some_hello_text VARCHAR2 (150), when_inserted DATE, we_are_from VARCHAR2 (30));

    INSERT INTO for_web_info VALUES ('HI everyone :-) ', SYSDATE, 'Ljubljana, Slovenia');

    CREATE OR REPLACE

    PACKAGE ws_calc AUTHID CURRENT_USER AS

    FUNCTION CalcProduct (a NUMBER by DEFAULT 1,

    b in on NUMBER,

    g NUMBER of OUTPUT)

    RETURN NUMBER;

    END ws_calc;

    /

    CREATE OR REPLACE

    PACKAGE ws_calc AS BODY

    FUNCTION CalcProduct (a NUMBER by DEFAULT 1,

    b in on NUMBER,

    g NUMBER of OUTPUT)

    RETURN NUMBER IS

    product NUMBER;

    BEGIN

    SELECT SUM (1) IN the for_web_info OF g;

    product: = a * b;

    RETURN any product;

    END;

    END;

    /

    Our two DBA done all the steps described in the manual Oracle® XML DB's Guide Developer, 11 g Release 2 (11.2), E23094-04, February 2014, section using Oracle DB native XML Web Services.

    Access us two wsdl with browser without problem and get two of them. We also receive web serivce response which databese of query table.

    http://our_db:8080 / orawsv? WSDL

    http://our_db:8080 / orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT? WSDL

    ---------------

    | First WSDL.

    ---------------

    <? XML version = "1.0"? >

    " < name definitions = targetNamespace"orawsv"=" http://xmlns.Oracle.com/orawsv "" "

    " xmlns =" http://schemas.xmlsoap.org/wsdl/ "

    ' xmlns:tns = ' http://xmlns.Oracle.com/orawsv "" "

    ' xmlns:soap = ' http://schemas.xmlsoap.org/WSDL/SOAP/ "

    " container = ' http://www.w3.org/2001/XMLSchema "

    " xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "

    " xsi: schemaLocation =" http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/"> ".

    < types >

    < xsd: Schema

    " targetNamespace = ' http://xmlns.Oracle.com/orawsv "" "

    elementFormDefault = "qualified" >

    < xsd: element name = "query" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "DDL_text" type = "xsd: String".

    minOccurs = "0" maxOccurs = "unbounded" / >

    < xsd: element name = 'query_text' >

    < xsd: complexType >

    < xsd:simpleContent >

    < xsd:extension base = "XSD: String" >

    < xsd: attribute name = "type" >

    < xsd:simpleType >

    < xsd:restriction base = "xsd:NMTOKEN" >

    < value xsd: Enumeration = "SQL" / >

    < value xsd: Enumeration = "XQUERY" / >

    < / xsd:restriction >

    < / xsd:simpleType >

    < / xsd: attribute >

    < / xsd:extension >

    < / xsd:simpleContent >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: Choice minOccurs = "0" maxOccurs = "unbounded" >

    < xsd: element name = "bind" >

    < xsd: complexType >

    < xsd:simpleContent >

    < xsd:extension base = "XSD: String" >

    < xsd: attribute name = "name" type = "xsd: String" / >

    < / xsd:extension >

    < / xsd:simpleContent >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "bindXML" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: all / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Choice >

    < xsd: element name = "null_handling" minOccurs = "0" >

    < xsd:simpleType >

    < xsd:restriction base = "xsd:NMTOKEN" >

    < value xsd: Enumeration = "DROP_NULLS" / >

    < value xsd: Enumeration = "NULL_ATTR" / >

    < value xsd: Enumeration = "EMPTY_TAG" / >

    < / xsd:restriction >

    < / xsd:simpleType >

    < / xsd: element >

    < xsd: element name = "max_rows" type = "positiveInteger" minOccurs = "0" / >

    < xsd: element name = "skip_rows" type = "positiveInteger" minOccurs = "0" / >

    < xsd: element name = "pretty_print" type = "xsd: Boolean" minOccurs = "0" / >

    < xsd: element name = "indentation_width" type = "positiveInteger" minOccurs = "0" / >

    < xsd: element name = "rowset_tag" type = "xsd: String" minOccurs = "0" / >

    < xsd: element name = "row_tag" type = "xsd: String" minOccurs = "0" / >

    < xsd: element name = "item_tags_for_coll" type = "xsd: Boolean" minOccurs = "0" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "queryOut" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: all / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Schema >

    < / types >

    < name of message = "QueryInput" >

    < name of part = element "body" = "tns:query" / >

    < / message >

    < name of the message 'XMLOutput' = >

    < name of part = element "body" = "tns:queryOut" / >

    < / message >

    < portType name = "ORAWSVPortType" >

    < operation name = "XMLFromQuery" >

    < input message = "tns:QueryInput" / >

    < output message = "tns:XMLOutput" / >

    < / operation >

    < / portType >

    < connection name = "ORAWSVBinding" type = "tns:ORAWSVPortType" >

    " < style: soap = transport = 'document' binding ' http://schemas.xmlsoap.org/SOAP/HTTP "/>

    < operation name = "XMLFromQuery" >

    " < soap: operation soapAction = ' http://our_db:8080 / orawsv "/>

    < input >

    < use of soap: body = "literal" / >

    < / Entry >

    < output >

    < use of soap: body = "literal" / >

    < / output >

    < / operation >

    < / binding >

    < service name = "ORAWSVService" >

    < documentation > Oracle Web Service < / documentation >

    < name of port = "ORAWSVPort" binding = "tns:ORAWSVBinding" >

    " < soap: address location = ' http://our_db:8080 / orawsv "/>

    < / port >

    < / service >

    < / definitions >

    ----------------

    | Second WSDL.

    ----------------

    <? XML version = "1.0"? >

    < name of definitions = "CALCPRODUCT."

    " targetNamespace = ' http://xmlns.Oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "" "

    " xmlns =" http://schemas.xmlsoap.org/wsdl/ "

    ' xmlns:tns = ' http://xmlns.Oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "" "

    " container = ' http://www.w3.org/2001/XMLSchema "

    ' xmlns:soap = ' http://schemas.xmlsoap.org/WSDL/SOAP/ ">

    < types >

    " < xsd: Schema targetNamespace = ' http://xmlns.Oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "" "

    elementFormDefault = "qualified" >

    < xsd: element name = "SNUMBER-CALCPRODUCTInput" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "G-NUMBER-OUT" >

    < xsd: complexType / >

    < / xsd: element >

    < xsd: element name = "B-NUMBER-INOUT" type = "xsd: double" / >

    < xsd: element name = "A-NUMBER-IN" minOccurs = "0" maxOccurs = "1" type = "xsd: double" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "CALCPRODUCTOutput" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "RETURN" type = "xsd: double" / >

    < xsd: element name = "G" type = "xsd: double" / >

    < xsd: element name = "B" type = "xsd: double" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Schema >

    < / types >

    < name of message = "CALCPRODUCTInputMessage" >

    < name of part = "parameters" element = "tns:SNUMBER - CALCPRODUCTInput" / >

    < / message >

    < name of message = "CALCPRODUCTOutputMessage" >

    < name of part = "parameters" element = "tns:CALCPRODUCTOutput" / >

    < / message >

    < portType name = "CALCPRODUCTPortType" >

    < operation name = "CALCPRODUCT" >

    < input message = "tns:CALCPRODUCTInputMessage" / >

    < output message = "tns:CALCPRODUCTOutputMessage" / >

    < / operation >

    < / portType >

    < connection name = "CALCPRODUCTBinding".

    Type = "tns:CALCPRODUCTPortType" >

    " < style: soap = transport = 'document' binding ' http://schemas.xmlsoap.org/SOAP/HTTP "/>

    < operation name = "CALCPRODUCT" >

    < soap: operation

    soapAction = "CALCPRODUCT" / >

    < input >

    < soap body parts: = 'settings' use = "literal" / >

    < / Entry >

    < output >

    < soap body parts: = 'settings' use = "literal" / >

    < / output >

    < / operation >

    < / binding >

    < service name = "CALCPRODUCTService" >

    < documentation > Oracle Web Service < / documentation >

    < name of port = "CALCPRODUCTPort" binding = "tns:CALCPRODUCTBinding" >

    < address soap:

    " location = ' http://our_db:8080 / orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT "/>

    < / port >

    < / service >

    < / definitions >

    -----------------

    | SQL Developer |

    -----------------

    SET serveroutput ON

    -------------

    | First WS.

    -------------

    DECLARE

    V_SOAP_REQUEST XMLTYPE: = XMLTYPE (' <? xml version = "1.0"? > < env:Envelope xmlns:env = "http://www.w3.org/2002/06/soap-envelope " > < env:Body > < query xmlns = "http://xmlns.oracle.com/orawsv" > < type of the argument texte_requete = "SQL" > <!) ([CDATA [SELECT * FROM for_web_info WHERE the INSTR (UPPER (we_are_from),: e) > 0]] > < / query_text > < link name 'e' = > SLOVENIA < / bind > < false pretty_print > < / pretty_print > < / query > < / env:Body > < / env:Envelope > ');

    V_SOAP_REQUEST_TEXT CLOB: = V_SOAP_REQUEST.getClobVal ();

    V_REQUEST UTL_HTTP. REQ;

    V_RESPONSE UTL_HTTP. RESP;

    V_BUFFER VARCHAR2 (1024);

    URL VARCHAR2 (4000): = ' http://our_db:8080 / orawsv ';

    BEGIN

    V_REQUEST: = UTL_HTTP. BEGIN_REQUEST (URL = > URL, METHOD = > 'POST');

    UTL_HTTP. SET_AUTHENTICATION (R = > V_REQUEST, username = > 'OUR_U', PASSWORD = > 'OUR_P'); -not case-sensitive

    V_REQUEST. METHOD: = 'POST';

    UTL_HTTP. SET_HEADER (R = > V_REQUEST, NAME = > 'Content-Length', VALUE = > DBMS_LOB.) GETLENGTH (V_SOAP_REQUEST_TEXT));

    UTL_HTTP. WRITE_TEXT (R = > V_REQUEST, DATA = > V_SOAP_REQUEST_TEXT);

    V_RESPONSE: = UTL_HTTP. GET_RESPONSE (V_REQUEST);

    LOOP

    UTL_HTTP. READ_LINE (V_RESPONSE, V_BUFFER, TRUE);

    DBMS_OUTPUT. PUT_LINE (V_BUFFER);

    END LOOP;

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    EXCEPTION

    WHEN UTL_HTTP. END_OF_BODY THEN

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    END;

    anonymous block filled

    " <? xml version ="1.0"? > < envelope soap: xmlns:soap = ' http://www.w3.org/2002/06/SOAP-envelope ' > < soap: Body > < queryOut xmlns = " http://xmlns.Oracle.com/orawsv "> "

    < set of LINES > < ROW > < SOME_HELLO_TEXT > HI everybody :-) < / SOME_HELLO_TEXT > < WHEN_INSERTED > 03.10.14 < / WHEN_INSERTED > < WE_ARE_FROM > Ljubljana, Slovenia < / WE_ARE_FROM > < / ROW > < / rowset > < / queryOut > < / soap: Body > < / envelope soap: >

    --------------

    | Second WS.

    --------------

    DECLARE

    V_SOAP_REQUEST XMLTYPE: = XMLTYPE ("<?") XML version = "1.0"? > < soap envelope: xmlns:soap = "http://www.w3.org/2002/06/soap-envelope" > < soap: Body > < xmlns SNUMBER-CALCPRODUCTInput = ""http://xmlns.oracle.com/orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT"(> < A-NUMBER-IN > 2 < / A-NUMBER-IN > < B-NUMBER-INOUT > 3 < / B-NUMBER-INOUT > < R-NUMBER-OUT / > < / SNUMBER-CALCPRODUCTInput > < / soap: Body > < / SOAP: envelope > '); "

    V_SOAP_REQUEST_TEXT CLOB: = V_SOAP_REQUEST.getClobVal ();

    V_REQUEST UTL_HTTP. REQ;

    V_RESPONSE UTL_HTTP. RESP;

    V_BUFFER VARCHAR2 (1024);

    URL VARCHAR2 (4000): = ' http://our_db:8080 / orawsv/OUR_SCHEMA/WS_CALC/CALCPRODUCT ';

    BEGIN

    V_REQUEST: = UTL_HTTP. BEGIN_REQUEST (URL = > URL, METHOD = > 'POST');

    UTL_HTTP. SET_AUTHENTICATION (R = > V_REQUEST, username = > 'OUR_U', PASSWORD = > 'OUR_P'); -not case-sensitive

    V_REQUEST. METHOD: = 'POST';

    UTL_HTTP. SET_HEADER (R = > V_REQUEST, NAME = > 'Content-Length', VALUE = > DBMS_LOB.) GETLENGTH (V_SOAP_REQUEST_TEXT));

    UTL_HTTP. WRITE_TEXT (R = > V_REQUEST, DATA = > V_SOAP_REQUEST_TEXT);

    V_RESPONSE: = UTL_HTTP. GET_RESPONSE (V_REQUEST);

    LOOP

    UTL_HTTP. READ_LINE (V_RESPONSE, V_BUFFER, TRUE);

    DBMS_OUTPUT. PUT_LINE (V_BUFFER);

    END LOOP;

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    EXCEPTION

    WHEN UTL_HTTP. END_OF_BODY THEN

    UTL_HTTP. END_RESPONSE (V_RESPONSE);

    END;

    anonymous block filled

    <? XML version = "1.0"? >

    " < envelope soap: xmlns:soap = ' http://www.w3.org/2002/06/SOAP-envelope/ ">

    < soap: Body >

    < soap: Fault >

    < Code: soap >

    < soap: value > SOAP: sender < / SOAP: value >

    < / Code: soap >

    entry processing < soap: reason > error < / SOAP: reason >

    < soap: detail >

    " < OracleErrors xmlns =" http://xmlns.Oracle.com/orawsv/faults "> "

    So OracleError >

    < ErrorNumber > ORA-19202 < / ErrorNumber >

    < message > <! [CDATA [error has occurred in the processing of XML]] > < / Message >

    < / OracleError >

    So OracleError >

    < ErrorNumber > ORA-06550 < / ErrorNumber >

    < message > <! [CDATA [line 1, column 24:]] > < / Message >

    < / OracleError >

    So OracleError >

    < ErrorNumber > PLS-00302 < / ErrorNumber >

    < message > <! [CDATA [component "WS_CALC" must be said]] > < / Message >

    < / OracleError >

    So OracleError >

    < ErrorNumber > ORA-06550 < / ErrorNumber >

    < message > <! [CDATA [line 1, column 7:]]

    [[PL/SQL: statement ignored]] > < / Message >

    < / OracleError >

    < / OracleErrors >

    < / Details: soap >

    < / soap fault: >

    < / soap: Body >

    < / envelope soap: >

    With reference APEX web service, the response is exactly the same and apex_web_service.make_request also work.

    Thanks again.

    The SOAP request is not correct.

    must be:

    So again, it does not solve the problem:

    -Which user you are using to authenticate on the other side?

    If it's another user the owner of the package, then of course you must grant the execute privilege appropriate to this user (and possibly one explicit SELECT on the table referenced too privilege).

  • How to return a multiple registration with Oracle Native Web Service?

    Hi all

    I would like to know the native web service oracle can return multiple records of customer or not?

    I have successfully developed the native oracle web service to return only one record, but the next challenge is to develop the web service to return a multiple record (such as database on each department employees)

    Thank you and best regards,
    Zenoni

    I have successfully developed the native oracle web service to return only one record, but the next challenge is to develop the web service to return a multiple record (such as database on each department employees)

    You may return a list (multiple values/records) in XML (using CLOB or XMLType), CSV or JSON format or whatever.

    function get_employees (p_department_id in number) return clob
    as
    begin
      return 'your_xml_string_here';
    end get_employees;
    

    It would be up to the customer (the caller of the web service) to extract the values of any format you decide, of course.

    -Morten

    http://ORA-00001.blogspot.com

  • "Unauthorized" error when you use native Web services

    Hi community

    I'm using Oracle 11 g 2 (11.2.0.3.0) and to try my first SOAP using XDB request

    I followed the instructions at [using Oracle Native XML Web Services DB | ] [ http://docs.Oracle.com/CD/E11882_01/AppDev.112/e23094/xdb_web_services.htm#ADXDB5677 ] and have traveled the many threads on this topic and am stuck again.

    The steps that I followed:

    Logged in as SYS:

    -Configuring HTTP access

    EXEC dbms_xdb.setHttpPort (7776); -I was initially using 8080, according to samples, but I changed to a port that I knew that nothing else has used

    EXEC dbms_xdb.setFtpPort (2100);  -Don't know its purpose, but anyway

    SELECT dbms_xdb.gethttpport () FROM dual;

    -Result = 7776

    -Check installed XDB

    SELECT * FROM dba_registry WHERE id_comp = "XDB".

    -Result = identifiant_composant = XDB; Version = 11.2.0.3.0; Status = VALID; Schema = XDB; Procedure = DBMS_REGXDB. VALIDATEXDB

    -Configure the Servlet ORAWSV-

    -Native web services are implemented using the servlet to "orawsv", which must be configured in the xdbconfig.xml file stored in DB XML itself.

    -This can be done using the DBMS_XDB on the package, as shown below.

    --

    DECLARE

    l_servlet_name VARCHAR2 (32): = "orawsv";

    BEGIN

    DBMS_XDB.deleteServletMapping (l_servlet_name);

    DBMS_XDB.deleteServlet (l_servlet_name);

    DBMS_XDB.addServlet (name = > l_servlet_name, language = > 'C', dispname = > descript 'Oracle query Web Service,' = > "Servlet to make queries as a Web Service", schema = > "XDB");

    DBMS_XDB.addServletSecRole (servname = > l_servlet_name, rolename = > 'XDB_WEBSERVICES', rolelink = > 'XDB_WEBSERVICES');

    DBMS_XDB.addServletSecRole (servname = > l_servlet_name, rolename = > 'XDB_WEBSERVICES_WITH_PUBLIC', rolelink = > 'XDB_WEBSERVICES_WITH_PUBLIC');

    DBMS_XDB.addServletSecRole (servname = > l_servlet_name, rolename = > 'XDB_WEBSERVICES_OVER_HTTP', rolelink = > 'XDB_WEBSERVICES_OVER_HTTP');

    DBMS_XDB.addServletMapping (template = > ' / orawsv / *', name = > l_servlet_name);

    END; /

    -I added ServletSecRoles for... _WITH_PUBLIC, and... _OVER_HTTP after initial sample didn't me give a result

  • Native Web Services database: XMLTYPE parameter in PL/SQL with XMLSCHEMA?

    Hello

    I would like to build a function with a parameter of XMLTYPE is the schema of the base, something like this:

    CREATE FUNCTION xy (p_xml XMLTYPE XMLSCHEMA 'http://myschema.com')...

    For now, I do the following code inside:

    l_xml: = p_xml.createSchemaBasedXML ('http://myschema.com');
    l_xml.schemaValidate ();

    / * validate XML with XSD code * /.
    l_nbr: = l_xml.isschemavalidated ();

    Why I want to put the schema directly in the statement is I want to use this function as a Web Service native Oracle. The web service does not know that the structure of the xml parameter because the schema is not known in the statement.

    Thank you and best regards,
    Andreas

    Published by: mdrake on November 8, 2009 21:55

    At the present time there is no way for the WSDL generated by the Native Web Services database to incorpirate this information. The problem is that there is no way to associate an XML schema to a variable value, parameter or return of PL/SQL. It should be the work of the XML DB and the PL/SQL to achieve group. It will consider a request for improvement.

    Workarounds only that I can think of would be to have a separate WSDL (made by hand) for this service. Of course, this will have to be to some other URL as expected, so this may not be viable, or to provide your own get (extended) WSDL service as part of the package, which adds the schema information in the WSDL. The Web Service consumer then you have to get the base/orawsv/parcel WSDL? WSDL, then get the WSDL extended by callling the appropriate method on the packaging...

  • Native web services and SOAP version.

    Hello

    I'm hoping to use the functionality of the native web services on the release of 11g 1 as an easy solution to expose certain procedures. On the test it seems to use SOAP version 1.1 by default, anyone know if it is possible to configure/patch to use version 1.2?

    I hope someone can help...

    Sorry, but for now we are limited to 1.1. What 1.2 features are of interest, given the scope of the current application

  • Test a REST based Web Service for Oracle R12.2.3

    Using the Oracle Support document,

    Installation of Oracle E-Business Suite integrated SOA Gateway, version 12.2 (Doc ID 1311068.1()

    I was able to deploy the REST web service based to FND_USER_PKG as FndUsrPkgSvc.

    I am able to view the file w.


    How once on the test REST based Web service?


    There is everything by deploying a REST Service Secuirty next note

    How this only plays a role in testing the web service.



    REST service security

    REST Web service is secure basic authentication HTTP to the HTTP Transport level. Send any of the following in the "Authorization" header according to the basic HTTP scheme:

    -Username:Passwod

    -Security token.

    Tip: Use connection Service to get a token of security for account taken of the user credentials.



    Thank you

    Rohit



    The guidance provided in the Guide of the SOA (156 Pg) developer are very useful, and once followed step by step allows not only to deploy, but also test the REST web service.

    Rohit-

  • Call to Web Service of Oracle PL/SQL not to call the Web service in SOA Server

    Hello

    Try to call the Web service to oralce pl/sql function

    created a function

    Unable to invoke the web service from the server of the SOA.

    CREATE or REPLACE FUNCTION HelloWorld_WebServices(S_STRING Varchar2) RETURN VARCHAR2 as

    Server sys.utl_dbws. SERVICE;

    APPEL_ sys.utl_dbws. CALL;

    service_qname sys.utl_dbws. QNAME;

    port_qname sys.utl_dbws. QNAME;

    response sys. XMLTYPE;

    application sys. XMLTYPE;

    BEGIN

    sys.utl_dbws.set_http_proxy ("hostname: Port'");

    service_qname: = sys.utl_dbws.to_qname ("ns1", "process");

    Server: = sys.utl_dbws.create_service (service_qname);

    APPEL_: = sys.utl_dbws.create_call (server);

    sys.utl_dbws.set_target_endpoint_address (APPEL_, ' http:/host name: port/soa-infra/services/OFS/HelloWorld/helloworld_client_ep ');

    sys.utl_dbws.set_property (APPEL_, 'OPERATION_STYLE', 'process');

    asks: = sys. XMLTYPE ("< ns1:process xmlns:ns1 ="http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld"> < ns1:input > < / ns1:input > < / ns1:process > '"); 

    answer: = sys.utl_dbws.invoke (APPEL_, request);

    return response.extract('//HelloWorld/child::text() ','http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld'). getstringval(); 

    DBMS_OUTPUT. Put_line ("values of the OutputsVariables8");

    -Of return ';

    END;

    Run - the code below:

    Select HelloWorld_WebServices ('Hi') to double;

    Error:

    ORA-29532: Java call terminated by eception Java exception: java.lang.NoClassDefFoundError

    ORA-06512: at "SYS." UTL_DBWS', line 403

    ORA-06512: at "SYS." UTL_DBWS', line 400

    ORA-06512: at the 'APPS '. HELLOWORLD_WEBSERVICES', line 74

    29532 00000 - "Java call terminated by eception Java exception: %s."

    * Cause: A mistake or a Java exception has been reported and could not be

    solved by Java code.

    * Action: Modify Java code, if this behavior is not expected.

    Hello

    Fixed the error

    After loading once again of DBA and network provided access files JAR/JVM firewall

    and the correction on the threshold

    Return response.extract (' / result/child::text () ','xmlns = "http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld" '). getstringval();

  • How to access the web service from Oracle?

    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0

    I'm making a call to a web service through a procedure/function...

    I tried to use
    CREATE OR REPLACE PROCEDURE Call_Rest_Webservice
    
     AS
    
      t_Http_Req Utl_Http.Req;
    
      t_Http_Resp Utl_Http.Resp;
    
      t_Request_Body VARCHAR2(30000);
    
      t_Respond VARCHAR2(30000);
    
      t_Start_Pos INTEGER := 1;
    
      t_Output VARCHAR2(2000);
    
    BEGIN
    
      /*Construct the information you want to send to the webservice.
      
      Normally this would be in a xml structure. But for a REST-
      
      webservice this is not mandatory. The webservice i needed to
      
      call excepts plain test.*/
    
      t_Request_Body := 'the data you want to send to the webservice';
    
      /*Telling Oracle where the webservice can be found, what kind of request is made
      
      and the version of the HTTP*/
    
      t_Http_Req := Utl_Http.Begin_Request('**webservice address**',
                                           'GET',
                                           'HTTP/1.1');
    
      /*In my case the webservice used authentication with a username an password
      
      that was provided to me. You can skip this line if it's a public webservice.*/
    
      --Utl_Http.Set_Authentication(t_Http_Req, 'username', 'password');
    
      /*Describe in the request-header what kind of data is send*/
    
      Utl_Http.Set_Header(t_Http_Req, 'Content-Type', 'text/xml charset=UTF-8');
    
      /*Describe in the request-header the lengt of the data*/
    
      Utl_Http.Set_Header(t_Http_Req, 'Content-Length', Length(t_Request_Body));
    
      /*Put the data in de body of the request*/
    
      Utl_Http.Write_Text(t_Http_Req, t_Request_Body);
    
      /*make the actual request to the webservice en catch the responce in a
      
      variable*/
    
      t_Http_Resp := Utl_Http.Get_Response(t_Http_Req);
    
      /*Read the body of the response, so you can find out if the information was
      
        received ok by the webservice.
      
        Go to the documentation of the webservice for what kind of responce you
      
        should expect. In my case it was:
      
        <responce>
      
          <status>ok</status>
      
        </responce>
      
      */
    
      Utl_Http.Read_Text(t_Http_Resp, t_Respond);
    
      /*Some closing?1 Releasing some memory, i think....*/
    
      Utl_Http.End_Response(t_Http_Resp);
    
    END;
    But it's me ORA-29272: HTTP request failed
    ORA-06512: at "SYS." UTL_HTTP", line 1029
    ORA-12545: Connect failed because target host or object does not exist

    But I can connect to the web server by going on * webservice address * through my browser.

    Is there an ACL must be open in order to have this capacity? I asked my s/n, but she asked me that I will need to give its name to username/password / ip in order to open an ACL...
    However there is no name to username/password required during a tour of the web service...

    Any help would be much appreciated...

    Thank you

    Published by: 986006 on March 4, 2013 08:38

    Y.L wrote:

    This is because the database could not connect to the specified server. Bad host name or IP address specified. Inability to resolve the hostname to an IP address. Firewall blocking. Etc.

    The host name, I put here can be visit through my browser. I think that it is not question of the host server... So, it could be a firewall on my side of the database which must be opened in order to visit the host?

    The "web browser" (your PL/SQL using UTL_HTTP code) code is running on the Oracle database server. He needs the same type of network access that has your browser on your PC. (firewalls open, authentication of the proxy if necessary, etc.).

    On 11g. Not on 10g.

    I saw the code example you post from the link you provided... those who only works on 11 g?
    If we can work on 10g, which package or what are the steps I need to follow in order to have that works on me?

    The code I posted works on both versions. My comment was regards the ACLs. No ACLs exist on 10g. If you only need to execute privs on the affected packages (e.g., UTL_HTTP, etc.).

    ACL were introduced with 11g - 11g, you also need the ADMINISTRATOR to create an ACL for you which will allow access to the UTL_HTTP network so now.

  • How to access AAU Web Service in Oracle.

    Hi all

    I try to call the AAU Web Service (CheckIn.wsdl) using oracle.
    But these web services are the name of user and password secure and expected.
    Someone has an idea to pass the name of user and password based on the oracle.

    My Code: -.

    CREATE OR REPLACE FUNCTION checkin (dDocName IN VARCHAR2, dDocTitle IN VARCHAR2, dDocType IN VARCHAR2,
    dDocAuthor IN VARCHAR2, dSecurityGroup IN VARCHAR2, dDocAccount IN VARCHAR2,
    primaryFile IN VARCHAR2)
    Return number
    AS
    l_service SYS. UTL_DBWS.service;
    l_call SYS. UTL_DBWS. Call;
    newurl VARCHAR2 (32767).
    l_wsdl_url VARCHAR2 (32767).
    l_namespace VARCHAR2 (32767).
    l_service_qname SYS. UTL_DBWS. QName;
    l_port_qname SYS. UTL_DBWS. QName;
    l_operation_qname SYS. UTL_DBWS. QName;
    l_xmltype_in SYS. XMLTYPE;
    l_xmltype_out SYS. XMLTYPE;
    BEGIN
    l_wsdl_url: = ' http://localhost:16200 / cs/groups/fix/wsdl/custom/CheckIn? WSDL ";
    l_namespace: = 'http://www.stellent.com/CheckIn/ ';
    l_service_qname: = SYS. UTL_DBWS.to_qname (l_namespace, ' CheckIne);
    l_port_qname: = SYS. UTL_DBWS.to_qname (l_namespace, 'CheckInSoap');
    l_operation_qname: = SYS. UTL_DBWS.to_qname (l_namespace, 'CheckInUniversal');
    l_service: = SYS. () UTL_DBWS.create_service
    wsdl_document_location = > URIFACTORY.getURI (l_wsdl_url).
    service_name = > l_service_qname);
    l_call: = SYS. () UTL_DBWS.create_call
    service_handle = > l_service,
    port_name = > l_port_qname,
    operation_name = > l_operation_qname);
    l_xmltype_in: = SYS. XMLTYPE ("<?") XML version = "1.0" encoding ="utf - 8"? >
    "< CheckInUniversal xmlns =" "|" l_namespace | "" >
    < VARCHAR2 > ' | dDocName | ' < / VARCHAR2 >
    < VARCHAR2 > ' | dDocTitle | ' < / VARCHAR2 >
    < VARCHAR2 > ' | dDocType | ' < / VARCHAR2 >
    < VARCHAR2 > ' | dDocAuthor | ' < / VARCHAR2 >
    < VARCHAR2 > ' | dSecurityGroup | ' < / VARCHAR2 >
    < VARCHAR2 > ' | dDocAccount | ' < / VARCHAR2 >
    < VARCHAR2 > ' | primaryFile | ' < / VARCHAR2 >
    (< / CheckInUniversal > ');
    l_xmltype_out: = SYS. UTL_DBWS. Invoke (call_Handle = > l_call,)
    request = > l_xmltype_in);
    SYS. UTL_DBWS.release_call (call_handle = > l_call);
    SYS. UTL_DBWS.RELEASE_SERVICE (service_handle = > l_service);
    END;

    Is compiled successfully.

    Whenever I'm running using
    SELECT the checkin ('WEBSERVICE009', 'WEBSERVICE009', 'Document','weblogic','Private','IT/EBA/Distributor_testuser','D:/ucmfiles/test_WebService_11.txt') FROM dual;

    He expects the name of user and password...

    Anyone with an idea.

    If you use apex, you have access to the wwv_flow_web_services package that has all the procs, you need to do this work. Otherwise, you can use flex_ws_api, which, although a bit outdated, should always work. This can be found at: http://jastraub.blogspot.com/2009/11/flexwsapi-no-on-samplecodeoraclecom.html

    I hope that will get you the start you need. Don't forget soapUI. This has proved to be very useful for my development just to prove that something works. It becomes a very simple way, when I often hear, "UCM does not work... '. ».

    Check-In

    -- Modify and create select that will get filename and content from a table.
    -- set serverouput on
    -- make sure flex_ws_api package is installed in same schema that you run this.
    declare
     l_filename varchar2(100);
     l_login varchar2(20);
     l_ddocname varchar2(20);
     l_BLOB BLOB;
     l_CLOB CLOB;
     l_envelope CLOB;
     l_response_msg varchar2(32767);
    begin
      select name, content, ddocname
      into l_filename, l_BLOB, l_ddocname
      from pdfs
      where id = 1;
    
      l_login := 'kalee';
      l_CLOB := flex_ws_api.blob2clobbase64(l_BLOB);
    
      l_envelope := '';
      l_envelope := l_envelope || '';
      l_envelope := l_envelope || '';
      l_envelope := l_envelope || '  ';
      l_envelope := l_envelope || '     ';
    
      if length(ltrim(rtrim(l_ddocname))) > 0 then
        l_envelope := l_envelope || '        '||l_ddocname||'';
      end if;
    
      l_envelope := l_envelope || '        '||l_filename||'';
      l_envelope := l_envelope || '        WebContent';
      l_envelope := l_envelope || '        '||l_login||'';
      l_envelope := l_envelope || '        Public';
      l_envelope := l_envelope || '        WebContent';
      l_envelope := l_envelope || '        ';
      l_envelope := l_envelope || '           ';
      l_envelope := l_envelope || '              xDCSDProfileTrigger';
      l_envelope := l_envelope || '              WebContent';
      l_envelope := l_envelope || '           ';
      l_envelope := l_envelope || '        ';
      l_envelope := l_envelope || '        ';
      l_envelope := l_envelope || '           '||l_filename||'';
      l_envelope := l_envelope || '           '||l_CLOB||'';
      l_envelope := l_envelope || '        ';
      l_envelope := l_envelope || '     ';
      l_envelope := l_envelope || '  ';
      l_envelope := l_envelope || '';
    
      l_xmltype := flex_ws_api.make_request(
        p_url               => 'https://ucmdev.dcsdk12.org/_dav/cs/idcplg',
        p_action            => 'http://www.stellent.com/Search/',
        p_envelope          => l_envelope,
        p_username          => 'admin',
        p_password          => 'password',
        p_wallet_path       => 'file:/u01/app/oracle/admin/SADD/wallet',
        p_wallet_pwd        => 'walletpassword'
      );
    
      l_response_msg := flex_ws_api.parse_response(p_collection_name=>'STELLENT_CHECKIN',p_xpath=>'//idc:CheckInUniversalResponse/idc:CheckInUniversalResult/idc:StatusInfo/idc:statusMessage/text()',p_ns=>'xmlns:idc="http://www.stellent.com/CheckIn/"');
    
      dbms_output.put_line(l_response_msg);
    exception
      when others then
        dbms_output.put_line(l_response_msg);
        raise;
    end;
    /
    

    Search

    declare
      l_envelope CLOB;
      l_xmltype XMLTYPE;
      l_response varchar2(100);
      ecode NUMBER;
      emesg VARCHAR2(200);
      cursor searchresults_cur(p_xmltype xmltype) is
        SELECT
          extractvalue(column_value, '/idc:SearchResults/idc:dDocName','xmlns:idc="http://www.stellent.com/Search/"') DOCNAME,
          extractvalue(column_value, '/idc:SearchResults/idc:dDocTitle','xmlns:idc="http://www.stellent.com/Search/"') DOCTITLE
        FROM TABLE(XMLSequence(p_xmltype.extract('//idc:QuickSearchResponse/idc:QuickSearchResult/idc:SearchResults','xmlns:idc="http://www.stellent.com/Search/"')));
      searchresults_rec searchresults_cur%ROWTYPE;
    
    begin
      l_envelope := '';
      l_envelope := l_envelope || '';
      l_envelope := l_envelope || ' ';
      l_envelope := l_envelope || ' ';
      l_envelope := l_envelope || '  ';
      l_envelope := l_envelope || '   dDocAuthor <matches> `kalee`';
      l_envelope := l_envelope || '  ';
      l_envelope := l_envelope || ' ';
      l_envelope := l_envelope || '';
    
      -- dbms_output.put_line('(soapenv)='||l_envelope);
    
      l_xmltype := flex_ws_api.make_request(
        p_url               => 'https://ucm.yourdomain/_dav/cs/idcplg',
        p_action            => 'http://www.stellent.com/Search/',
        p_envelope          => l_envelope,
        p_username          => 'admin',
        p_password          => 'password',
        p_wallet_path       => 'file:/u01/app/oracle/admin/DATABASESID/wallet',
        p_wallet_pwd        => 'walletpassword'
      );
    
      -- dbms_output.put_line('(xml)='||substr(l_xmltype.GetClobVal(),1,2000));
    
      open searchresults_cur(l_xmltype);
      loop
        fetch searchresults_cur into searchresults_rec;
        exit when searchresults_cur%NOTFOUND;
        dbms_output.put_line('(dDocName)='||searchresults_rec.DOCNAME||' (dDocTitle)='||searchresults_rec.DOCTITLE);
      end loop;
      if searchresults_cur%ROWCOUNT = 0 then
        dbms_output.put_line('No records found!');
      end if;
      close searchresults_cur;
    
    exception
      when others then
        ecode := SQLCODE;
        emesg := SQLERRM;
        --insert into log_table (code,message,info) values (0,TO_CHAR(ecode) || '-' || emesg,'.CheckinDocument emesg');
        --commit;
        raise;
    end;
    /
    
  • Integration of Web services in Oracle e-Business 11g1.1.14 JDev

    Hello

    Could someone please help me out with the technique suitable in this regard...

    I created a JDeveloper ADF application which deploys currently use / consume web services from one of my instances of Oracle e-Business. I have outlined some by the filing of the integration of the API and you can see in JDEV.

    To create the web service (via the Wizard), I entered an address for the WSDL file. However, this address is specific to the instance of the application.

    When I migrate / deploy my application in other environments, for example from Dev to Test, I'm sure that the Web Service will always be to 'point' to my instance of development about 99.9%.

    Is the best practice for editing each WebService as I migrate through environments? Or is this now touch on the field of areas outside the scope of this forumn?

    Once again, looking for tips / directions not a complete solution... happy to do my own research it myself.

    Thanks in advance if anyone can help.

    See you soon,.

    Simon

    Read this:
    http://blogs.Oracle.com/ADF/2011/02/changing_endpoint_url_for_a_web_service_data_control.html

    And you can also use a deployment plan:
    http://kingsfleet.blogspot.com/2008/12/controlling-what-service-proxy-uses-at.html

  • PL/SQL proc as a web service

    Oracle 11.2.0.x
    Reference: Accessing PL/SQL procedures stored using a Web Service (< i > Oracle Developer of Microsoft® XML DB Guide < /i >).

    The feature works very well. Have tested a number of written PL/SQL procs customized this way - is used as a web service and SoapUI and UTL_HTTP procedures as customers, call the web service.

    Issue.
    Can it withstand WSS (Web Services Security) with this feature?

    I added a WSSE to the header of the SOAP envelope when calling - using the standard password (no digest) and the default address. Orawsv XDB servlet accepts the call, the analysis of the SOAP envelope and executes the PL/SQL procedure successfully.

    However, it uses Basic authentication (schema name and password). Not the WSSE.

    Because the WSSE authentication data are part of the SOAP header (and not the body envelope), the PL/SQL procedure of course don't don't can't see the details of the WSSE. (also would make sense ito how XDB abstracts orawsv as a web service interface and allows procedures PL/SQL standard vanilla and functions to be used as web service endpoints).

    So if the WSSE must be supported, this would probably mean that he needs to be supported in XDB himself. And it is outside my small area of expertise of the Oracle.

    Not much on the net (many UTL_DBWS) and just a couple of basic orawsv supports Metalink notes.

    Ideas, suggestions or pointers will be appreciated.

    Thank you.

    WSS will not be supported by Native Web Services database. It is a deliberate choice to differentiate when an application server should be used Vs when DBNWS is appropriate. If you are in an environment where WSS is a requirement, you should be usiing an applications, such as Oracle WebLogic Server, to offer your Web Services.

    It said the next version of the database willl help DIGEST so authenitcation BASE for HTTP. If the current model of BASIC authentication is a problem, then you should force the use of an SSL (HTTPS) connection. That's why we have the role XDB_WEBSERVICES_OVER_HTTP. If this role is not granted then the DBNWS accessible only using HTTPS.

  • Flop native SOAP service: "Closed connection..", ready for production?

    Our system: Oracle 11 g 2 on CentOS Linux X 64.
    I followed the instructions here: http://www.oracle-base.com/articles/11g/NativeOracleXmlDbWebServices_11gR1.php, well, I can view the WSDL on browser. Now for the real world test, I wrote an application in Visual studio.net 2010 to use the service, after the first time (the value returned successfullly), I had such as:
    The underlying connection was closed: a connection which was to be kept alive was closed by the server.

    I googled and tried all sorts of tricks, like keepalive = TRUE but no joy. Some people suggest that .net has a bug, so I use SOAPUI and SOAPsonar, which returnes same error "the underlying connection was closed." I tried to do the session timeout also not long as possible, still no help, it seems to run out of options, so I tried to configure Oracle HTTP server (instead of the Embeded bridge) a point of entry for /orawsv (I couldn't find any example for this type of HTTP server to help with the configuration of the service web so I took one configuration of the APEX in the dads.conf file) but it did not work , so there is almost the end of my native miracle (no coding) of the web service solution...

    The only case for the Oracle SOAP service is: when I use Oracle APEX, it works fine without the floating point operations. It seems that every customer non-Oracle will not take SOAP Oracle of XDB service...

    Issues related to the:
    1. someone else has real work situations using the native client NON-Oracle with Oracle XMLDB application web services?
    2. it is possible to configure the server HTTP of Oracle 10 G works with this native services?
    3. I missed any parameter on xdbconfig.xml so will not happen this kind of condemnation to death? (almost everything is by default except the HTTP PORT #)

    Suggestions and advise are greatly appreciated

    Published by: seanzh on March 17, 2011 10:28

    Published by: seanzh on March 17, 2011 10:29

    Published by: seanzh on March 17, 2011 10:31

    Oracle APEX doesn't use SOAP or SOAP provider... It uses EGP that is a completely different implementation, the fact that it works or fails is not relevant to the review of native database web services...

    1. someone else has real work situations using the native client NON-Oracle with Oracle XMLDB application web services?

    I wrote a number of applications that use controls of the browser XMLHTTP to call Soap Services... They have been tested with IE and FIREFOX. I also tested extensively with XMLSPY (Altova) SOAP Infrastructure...

    2. it is possible to configure the server HTTP of Oracle 10 G works with this native services?

    No native Web Services are part of the Oracle 11 g database.

    3. I missed any parameter on xdbconfig.xml so will not happen this kind of condemnation to death? (almost everything is by default except the HTTP PORT #)

    Is not sound as it assuming you can get a following WSDL URL

    http://NomServeur/orawsv? WSDL

    SOAP is based on HTTP, which is a stateless protocol, so the connections should not be opened once the request is completed...

    You have (or you can download a trial) of XMLSpy and test with this stack...

    Can check you for all shared servers errors reported in the alert.log, found the trace of the server directory

  • Web service PLSQL returning multiple records

    Hello

    I am creating a web service using oracle 11 g, which should be able to return multiple records.

    Based on the code and the advice of the samples found on the internet, here is my code:

    CREATE OR REPLACE TYPE test_rec is OBJECT (
        s_nume_adre                    NUMBER ,
        c_eta_civi                     VARCHAR2(4 BYTE),
        l_nom1_comp                    VARCHAR2(40 BYTE),
        l_nom2_comp                    VARCHAR2(40 BYTE),
        l_nom3_comp                    VARCHAR2(40 BYTE),
        l_pren_comp                    VARCHAR2(30 BYTE),
        d_date_nais                    DATE);
    
    
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec;
    */
    
    CREATE OR REPLACE PACKAGE test_pkg AS
      function get_rows(snume_adre in number) return test_array;
    END;
    /
    
    CREATE OR REPLACE PACKAGE BODY test_pkg AS
      function get_rows(snume_adre in number) return test_array is
        v_rtn   test_array := test_array(null);
        v_first boolean := true;
    
        cursor c_get_rows(snume_adre in number) is
          SELECT a.s_nume_adre,
                 nvl(a.c_eta_civi, '') c_eta_civi,
                 nvl(a.l_nom1_comp, '') l_nom1_comp,
                 nvl(a.l_nom2_comp, '') l_nom2_comp,
                 nvl(a.l_nom3_comp, '') l_nom3_comp,
                 nvl(a.l_pren_comp, '') l_pren_comp,
                 nvl(a.d_date_nais, to_date('01.01.1900', 'dd.mm.yyyy')) d_date_nais
        FROM bro.z45 a
      where a.s_nume_adre = snume_adre or snume_adre is null;
    
      begin
       
        for rec in c_get_rows(snume_adre) loop
          if v_first then
            v_first := false;
          else
            v_rtn.extend;
          end if;
       
        v_rtn(v_rtn.last) := test_rec(rec.s_nume_adre, rec.c_eta_civi, rec.l_nom1_comp, rec.l_nom2_comp,
                                    rec.l_nom3_comp, rec.l_pren_comp, rec.d_date_nais);
        end loop;   
    
        return v_rtn;
      end;
    END;
    /
    
    --select * from table (test_pkg.get_rows(null));
    
    
    

    I am able to retrieve data using select.

    However, when I try to access its wsdl I get an error:

    < envelope soap: >

    < soap: Body >

    < soap: Fault >

    Client: soap < faultcode > < / faultcode >

    entry processing < faultstring > error < / faultstring >

    < detail >

    < OracleErrors > < / OracleErrors >

    < / details >

    < / soap fault: >

    < / soap: Body >

    < / envelope soap: >

    -- -------------------------------------------------------------------------------------------------------------

    If I comment the function call in the package declaration I get a "correct": wsdl

    -- -------------------------------------------------------------------------------------------------------------

    " < name definitions = targetNamespace"GET_ROWS"=" http://xmlns.Oracle.com/orawsv/test/TEST_PKG/GET_ROWS "xmlns =" http://schemas.xmlsoap.org/wsdl/ "xmlns:tns =" http://xmlns.Oracle.com/orawsv/test/TEST_PKG/GET_ROWS "container =" http://www.w3.org/2001/XMLSchema "xmlns:soap =" http://schemas.xmlsoap.org/wsdl/SOAP/ "> " ""

    < types >

    " < xsd: Schema targetNamespace = ' http://xmlns.Oracle.com/orawsv/test/TEST_PKG/GET_ROWS "elementFormDefault ="qualified"> "

    < xsd: element name = "GET_ROWSInput" >

    < xsd: complexType >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: element name = "GET_ROWSOutput" >

    < xsd: complexType >

    < / xsd: complexType >

    < / xsd: element >

    < / xsd: Schema >

    < / types >

    < name of message = "GET_ROWSInputMessage" >

    < name of part = "parameters" element = "tns:GET_ROWSInput" / >

    < / message >

    < name of message = "GET_ROWSOutputMessage" >

    < name of part = "parameters" element = "tns:GET_ROWSOutput" / >

    < / message >

    < portType name = "GET_ROWSPortType" >

    < operation name = "GET_ROWS" >

    < input message = "tns:GET_ROWSInputMessage" / >

    < output message = "tns:GET_ROWSOutputMessage" / >

    < / operation >

    < / portType >

    < connection name = "GET_ROWSBinding" type = "tns:GET_ROWSPortType" >

    " < style: soap = transport = 'document' binding ' http://schemas.xmlsoap.org/SOAP/HTTP "/>

    < operation name = "GET_ROWS" >

    < soap: operation soapAction = "GET_ROWS" / >

    < input >

    < soap body parts: = 'settings' use = "literal" / >

    < / Entry >

    < output >

    < soap body parts: = 'settings' use = "literal" / >

    < / output >

    < / operation >

    < / binding >

    < service name = "GET_ROWSService" >

    < documentation > Oracle Web Service < / documentation >

    < name of port = "GET_ROWSPort" binding = "tns:GET_ROWSBinding" >

    " < soap: address location = ' http://server.domain.ch:8080 / orawsv/TEST/TEST_PKG/GET_ROWS "/>

    < / port >

    < / service >

    < / definitions >

    -- -------------------------------------------------------------------------------------------------------------

    Any suspicion that how create and access pl sql web service returning multiple lines?

    I use java not and do not have access to tools such as JDeveloper.

    Thank you!

    The real problem is that collection types are not supported for the return parameters.

    The solution is to wrap the collection into another object.

    Here is an example of work based on your settings:

    CREATE OR REPLACE TYPE test_rec is OBJECT (
      empno  number(4)
    , ename  varchar2(10)
    , hiredate date
    );
    /
    
    CREATE OR REPLACE TYPE test_array AS TABLE OF test_rec;
    /  
    
    CREATE OR REPLACE TYPE test_array_wrapper is OBJECT ( arr test_array );
    /
    
    CREATE OR REPLACE PACKAGE test_pkg AS
      function get_rows(p_deptno in number) return test_array_wrapper;
    END;
    /  
    
    CREATE OR REPLACE PACKAGE BODY test_pkg AS
      function get_rows(p_deptno in number) return test_array_wrapper is
        results  test_array;
      begin  
    
        select test_rec(empno, ename, hiredate)
        bulk collect into results
        from scott.emp
        where deptno = p_deptno;     
    
        return test_array_wrapper(results);
      end;
    END;
    /
    

    The wsdl is then generated correctly:

    SQL> select httpuritype('http://DEV:dev@localhost:8080/orawsv/DEV/TEST_PKG/GET_ROWS?wsdl').getxml() from dual;
    
    HTTPURITYPE('HTTP://DEV:DEV@LOCALHOST:8080/ORAWSV/DEV/TEST_PKG/GET_ROWS?WSDL').GETXML()
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
      
        
          
            
              
                
              
            
          
          
            
              
                
              
            
          
          
            
              
                
                  
                    
                      
                        
                          
                        
                      
                    
                  
                
              
            
          
          
            
              
              
                
                  
                    
                  
                
              
              
            
          
        
      
      
        
      
      
        
      
      
        
          
          
        
      
      
        
        
          
          
            
          
          
            
          
        
      
      
        Oracle Web Service
        
          
        
      
    
    
  • German characters problem when calling Web Services via UTL_HTTP

    Dear members,

    I try to call the services of SAP CRM Web of Oracle PL/SQL. I used following code which works very well.
    -- call web service using Oracle UTIL_HTTP packages
    DECLARE
      http_req utl_http.req;
         http_resp utl_http.resp;
         lv_request VARCHAR2(32767);
         lc_response CLOB;
         lv_buffer VARCHAR2(32000);
         lv_name          VARCHAR2(256);
         lv_hdr_value     VARCHAR2(1024);     
         l_xml XMLType;          
    BEGIN     
         utl_http.set_persistent_conn_support(true);
         utl_http.set_transfer_timeout(600);
         
         http_req:= utl_http.begin_request
                                       ( url => 'http://xyz3ni92.server.xyz.com:8045/sap/bc/srt/xip/sap/crm_bupa_custid_qr/011/customersbycrmid/http_binding'
                                       , method => 'POST'                              
                                       );
         lv_request := '<?xml version="1.0" encoding="UTF-8"?>'
         ||'<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:glob="http://sap.com/xi/CRM/Global2">'
       ||'<soap:Header/>'
       ||'<soap:Body>'
          ||'<glob:CustomerCRMByIDQuery>'
             ||'<MessageHeader>'
                ||'<ID schemeID="?" schemeAgencyID="?" schemeAgencySchemeAgencyID="?"></ID>'
                ||'<UUID></UUID>'
                ||'<ReferenceID schemeID="?" schemeAgencyID="?" schemeAgencySchemeAgencyID="?"></ReferenceID>'
                ||'<ReferenceUUID></ReferenceUUID>'
             ||'</MessageHeader>'
             ||'<BusinessPartnerSelectionByBusinessPartner>'
                ||'<UUID schemeID="?" schemeAgencyID="?"></UUID>'
                ||'<InternalID>2200117598</InternalID>'
             ||'</BusinessPartnerSelectionByBusinessPartner>'
          ||'</glob:CustomerCRMByIDQuery>'
               ||'</soap:Body>'
         ||'</soap:Envelope>';     
         /*set username and password*/
         utl_http.set_authentication (
                   r => http_req,
                   username => 'WS_USER',
                   password => 'WS_PASSWORD',
                   scheme => 'Basic',
                   for_proxy => false);     
                   
         utl_http.set_header(http_req, 'Content-Type', 'application/soap+xml;charset=UTF-8'); 
         utl_http.set_header(http_req, 'Content-Length', LENGTHB(lv_request));
         utl_http.write_text(http_req, lv_request);
         /*Make HTTP call*/
         http_resp:= utl_http.get_response(http_req);
         
         /*read response text from response*/
         BEGIN
                   LOOP
                             utl_http.read_text(http_resp, lv_buffer);
                             lc_response := lc_response || TO_CLOB(lv_buffer);
                   END LOOP;
         EXCEPTION
                   WHEN OTHERS THEN
                        -- ora-29266 end-of-body reached
                        IF SQLCODE <> -29266 THEN
                                  RAISE;
                        END IF;
         END;
         utl_http.end_response(http_resp);     
         l_xml := XMLType(lc_response);
         /*Log response for testing*/
         DELETE FROM webservice_log;
         INSERT INTO webservice_log (seq_id,xml_response) VALUES (sqe_Webservice_Log.NEXTVAL,l_xml);
    EXCEPTION WHEN OTHERS THEN
              RAISE;
    END;
    However, if there are any German character in SAP, then they are replaced by UNWANTED data when they come to Oracle.

    If I invoke continues the same web service tools like SOAP-UI, then German characters do very well. I've also drawn web service queries and answers of the side SAP, and there response shows fine. When it comes to Oracle, they are themselves corrupt.

    I'm sure it's something to do with the character, but I am not able to find where and what should I fix/change.

    Thank you for your help in advance.

    DB: Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
    NLS_DATABASE_PARAMETERS
    PARAMETER                      VALUE                                  
    ------------------------------ ----------------------------------------
    NLS_LANGUAGE                   AMERICAN                                 
    NLS_TERRITORY                  AMERICA                                  
    NLS_CURRENCY                   $                                        
    NLS_ISO_CURRENCY               AMERICA                                  
    NLS_NUMERIC_CHARACTERS         .,                                       
    NLS_CHARACTERSET               AL32UTF8                                 
    NLS_CALENDAR                   GREGORIAN                                
    NLS_DATE_FORMAT                DD-MON-RR                                
    NLS_DATE_LANGUAGE              AMERICAN                                 
    NLS_SORT                       BINARY                                   
    NLS_TIME_FORMAT                HH.MI.SSXFF AM                           
    NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM                 
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR                       
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR             
    NLS_DUAL_CURRENCY              $                                        
    NLS_COMP                       BINARY                                   
    NLS_LENGTH_SEMANTICS           BYTE                                     
    NLS_NCHAR_CONV_EXCP            FALSE                                    
    NLS_NCHAR_CHARACTERSET         AL16UTF16                                
    NLS_RDBMS_VERSION              11.2.0.1.0   
    Kind regards
    Hari

    added other details by: Hari_639 on April 24, 2013 18:45

    I'm not really experienced with utl_http, but maybe you'll read on SET_BODY_CHARSET in the documentation.
    ISO-8859-1 is the default characterset, until you specify the characters in the attribute content_type and text media.
    But your media type is not text, then perhaps affecting the body charset UTF - 8 can help.

    concerning

Maybe you are looking for