function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
duyplduypl 

Authenticate user when calling SharePoint List web service on HTTPS

Hi,

 

I want to use SharePoint web service in Apex (e.g List service). I was able to generate Apex code from WSDL file uploaded to Force.com. Below is my current code to access List service hosted on HTTPS server

 

public String[] getSharePointListIds() {
  MSSharepointSoapClient.ListsSoap soapClient = new MSSharepointSoapClient.ListsSoap();
// I have username / password to access SharePoint but I don't know how to specify it in generated Apex code so here I just simply ingore it MSSharepointSoapClient.GetListResult_element result = soapClient.GetList('Products'); }

 

I got error in GetList() method on generated code. Below is error message from Debug Log

 

...

03:34:55.030 (30156000)|SYSTEM_METHOD_ENTRY|[1357]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
03:34:55.450 (450935000)|CALLOUT_REQUEST|[1357]|<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Header /><env:Body><GetList xmlns="http://schemas.microsoft.com/sharepoint/soap/"><listName>Products</listName></GetList></env:Body></env:Envelope>
03:34:55.450 (450996000)|CALLOUT_REQUEST|[1357]|GetList_element:[apex_schema_type_info=(http://schemas.microsoft.com/sharepoint/soap/, true, false), field_order_type_info=(listName), listName=Products, listName_type_info=(listName, http://www.w3.org/2001/XMLSchema, string, 0, 1, false)]::SFDC_STACK_DEPTH=1 SOAPAction="http://schemas.microsoft.com/sharepoint/soap/GetList" User-Agent=SFDC-Callout/25.0 Accept=text/xml Content-Type=text/xml; charset=UTF-8 
03:34:55.625 (625042000)|EXCEPTION_THROWN|[1357]|System.CalloutException: IO Exception: External server did not return any content
03:34:55.625 (625190000)|SYSTEM_METHOD_EXIT|[1357]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
03:34:55.625 (625218000)|METHOD_EXIT|[43]|01p90000001n1Ig|MSSharepointSoapClient.ListsSoap.GetList(String)
03:34:55.625 (625294000)|FATAL_ERROR|System.CalloutException: IO Exception: External server did not return any content

...

 

 

Do you have any experience on this error ? Is there any sample code to access SharePoint web service (with authentication) ?

 

Thanks,

Duy

Gayathri SureshbabuGayathri Sureshbabu

Hi duypl,

 

did you get a solution to this?

 

Cheers

S. Gayathri