Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2003
    Posts
    4

    Unanswered: UTL_HTTP Web Service

    I am trying to consume a web service written in C# from within PL/SQL using the UTL_HTTP sys package. If my webservice is installed on the default web site (using IIS) the PL/SQL code works fine. However if it gets moved from here to the 8080 port the code no longer works.

    Anyone have any ideas? It's been driving me mad.

    Here is the code:

    FUNCTION GET_GUID(SZGUID_IN IN VARCHAR2) RETURN VARCHAR2 IS
    L_RESPONSE T_RESPONSE;
    L_HTTP_REQUEST UTL_HTTP.REQ;
    L_HTTP_RESPONSE UTL_HTTP.RESP;
    SZGUID VARCHAR2(20);
    P_ENV VARCHAR2(32767);
    BEGIN
    --the envelope
    /*P_ENV := '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' ||
    '<soap:Body>' ||
    '<getGUID xmlns="http://id-bs.com/webservice/">' ||
    '<GUIDString>' ||
    SZGUID_IN ||
    '</GUIDString></getGUID></soap:Body></soap:Envelope>';*/
    P_ENV := '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">' ||
    '<soap:Body>' ||
    '<getGUID xmlns="http://id-bs.com/webservice/"><GUIDString>' ||
    SZGUID_IN ||
    '</GUIDString></getGUID></soap:Body></soap:Envelope>';

    utl_http.set_response_error_check(TRUE);

    -- use 1.0
    L_HTTP_REQUEST := UTL_HTTP.BEGIN_REQUEST('http://' || SZWEBSERVER ||
    '/getGUID/GUIDService.asmx',
    'POST',
    'HTTP/1.0');

    UTL_HTtp.set_proxy('http://' || SZWEBSERVER || ':8080');
    UTL_HTTP.SET_HEADER(L_HTTP_REQUEST,
    'Content-Type',
    'text/xml');
    UTL_HTTP.SET_HEADER(L_HTTP_REQUEST,
    'Content-Length',
    LENGTH(P_ENV));
    UTL_HTTP.SET_HEADER(L_HTTP_REQUEST,
    'SOAPAction',
    'http://id-bs.com/webservice/getGUID');
    ------------------------------
    UTL_HTTP.WRITE_TEXT(L_HTTP_REQUEST,
    P_ENV);

    L_HTTP_RESPONSE := UTL_HTTP.GET_RESPONSE(L_HTTP_REQUEST);
    UTL_HTTP.READ_LINE(L_HTTP_RESPONSE,
    P_ENV);
    L_RESPONSE.DOC := XMLTYPE.CREATEXML(TO_CHAR(P_ENV));
    L_RESPONSE.DOC := L_RESPONSE.DOC.EXTRACT('/soap:Envelope/soap:Body/child::node()',
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
    SZGUID := GET_RETURN_VALUE(L_RESPONSE,
    'getGUIDResult',
    'xmlns="http://id-bs.com/webservice/"');
    UTL_HTTP.END_RESPONSE(L_HTTP_RESPONSE);
    RETURN SZGUID;

    END GET_GUID;


    Thnaks,
    Dave

  2. #2
    Join Date
    Dec 2003
    Location
    Oklahoma, USA
    Posts
    354
    It looks to me that you already have something running on port 8080... namely the proxy server:

    <snip>
    UTL_HTtp.set_proxy('http://' || SZWEBSERVER || ':8080');
    </snip>

    JoeB

  3. #3
    Join Date
    Jun 2003
    Posts
    4
    No that's not it, that was an attempt to get the call to the web service to look at port 8080 not a proxy server.

    I am actually getting and error 4.1 - Access is denied but I have no idea what access is being denied

    Any ideas?

  4. #4
    Join Date
    Jun 2003
    Posts
    4

    Solved

    I've solved the problem. The webserver needs to have anonymous access enabled to work without any code changes. There is also a link on the Microsoft site that suggests a code change to fix this problem but I have not tried that out.

    http://support.microsoft.com/default...b;en-us;811318

    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •