1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

PL/SQL Integrating to Microsoft SharePoint Web services

Discussion in 'SQL PL/SQL' started by mo.mughrabi, Sep 7, 2010.

  1. mo.mughrabi

    mo.mughrabi Guest

    Dear all,

    I been working on a project in which I need to integrate to SharePoint from within Oracle. Am trying to build functions in which I can post to SharePoint web services, I've tried using the web services before with other programming language, mostly .NET.

    Am facing a little trouble passing the SharePoint authentication since it uses Kerberos & NTLM. I wrote the block below in order to by the authentication using set_authentication

    Code (SQL):
    soap_request varchar2(30000);
    soap_respond varchar2(30000);
    http_req utl_http.req;
    http_resp utl_http.resp;
    resp XMLType;
    i pls_integer;
    l_len pls_integer;
    soap_request:= '<XML Envelop>';
    utl_http.set_response_error_check(enable => TRUE);
    utl_http.set_detailed_excp_support(enable => TRUE);
    http_req:= utl_http.begin_request
    ( 'lists.asmx'
    , 'POST'
    , 'HTTP/1.1'
    utl_http.set_header(http_req, 'Content-Type', 'text/xml');
    utl_http.set_header(http_req, 'Content-Length', LENGTH(soap_request));
    utl_http.set_header(http_req, 'SOAPAction', '');
    Utl_Http.Set_Authentication (
    r => http_req,
    username => 'username',
    password => 'pass0word',
    scheme => 'Basic',
    for_proxy => FALSE );
    utl_http.set_header(r=>http_req ,name=>'User-Agent',VALUE=>'Mozilla/4.0');
    utl_http.write_text(http_req, soap_request);
    http_resp:= utl_http.get_response(http_req);
    utl_http.read_text(http_resp, soap_respond);
    i := 1;
    l_len := LENGTH(soap_respond);
    while (i <= l_len) loop
    dbms_output.put_line(substr(soap_respond, i, 60));
    i := i + 60;
    END loop;
    --return resp.getStringVal();
    I tried writing the domain inside the username field to be domain/user, with and without it, it didn't work. Am starting to think there might be another function that I might be able to use to gain authentication over the web services.

    Any idea how could I solve this issue?

    P.S I had to remove the XML envelop and replace it with <xml envelop> because the forum won't let me post any links :)
  2. Atreide

    Atreide Newly Initiated

    Likes Received:
    Trophy Points:
    I cannot but say Thank You. Thank you very much. After some too many hours of trying to get some result from accessing a Web Service and getting nothing but this code "500 - Internal Error" for so many tries. I copy + pasted your code, changed very few things and it worked out with no problem.

    The only things I changed was putting the right XML file for the request, as you mention in the P.S. Of course, changed the URL, instead of this "lists.asmx". User/Password. And for this SoapAction Header, I putted the name of the actual method to be invoked in the Web Service, double cuotted. Meanning:

    utl_http.set_header(http_req, 'SOAPAction', '"WSMethodInvoked"');

    I guess none of this is going to be of any help for you, that for sure are well aware of all this matters. I guess/hope the problem will already be solved, being such an old post, any how I hope will be of any help for some other goofs as me, when I was starting to believe that accessing to this Web Service could just not be possible from Developer 6i. I couldn't but write this post to express how gratefull I am after wathing so many utl_http examples that wouldn't work at all.