views:

56

answers:

1

Hi,

I've been trying to create a PLSQL package that will post into SharePoint through its web services. I've tried doing this using C# and it kind of worked, yet with PLSQL It seems like am having problem authenticating to Sharepoint since it uses Kerberos & NTLM.

declare
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;
begin
soap_request:= '<?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/"&gt;
<soap:Body>
<GetListAndView xmlns="http://schemas.microsoft.com/sharepoint/soap/"&gt;
<listName>Events</listName>
<viewName></viewName>
</GetListAndView>
</soap:Body>
</soap:Envelope>
';
utl_http.set_response_error_check(enable => TRUE);
utl_http.set_detailed_excp_support(enable => TRUE);
http_req:= utl_http.begin_request
( 'http://deptportal/IT/BSS/b_r/_vti_bin/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);
utl_http.end_response(http_resp);
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();
end;

Its mostly failing in authentication, Is there any way that I could supply the authentication to SharePoint and passing through?

Thanks in advance,

+2  A: 

You could enable basic authentication in SharePoint. I had a similar problem and solved it by extending my web application:

  • Default zone: HTTP - Negotiate
  • Extranet zone: HTTPS - Negotiate + Basic authentication (HTTPS to minimize security risk)

That way, you can use the extranet zone for applications that don't support NTLM or Kerberos.

Tom Vervoort
Thanks Tom, I tried your approach and it worked.
Mo J. Mughrabi