PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] SharePoint 2013 Web Services Integration
[WD20] SharePoint 2013 Web Services Integration
Iniciado por guest, 24,ago. 2015 11:38 - 2 respuestas
Publicado el 24,agosto 2015 - 11:38
Hi,

I'm trying to integrate and consume SharePoint Web Services from a WD program (service later on).
I can import the web services but am unable to run them in accordance with the LST93 example.

As the SharePoint site is part of an intranet and secured, I need to get an authentication token or cookie first I guess and this is where I am blocked.
I tried these options already:
1) Generate an HTTP authentication header using Windows API's (Passing principal and user credentials)
API("secur32","AcquireCredentialsHandleW",..
API("secur32","InitializeSecurityContextW",...
I always get an error on the first API: SEC_E_SECPKG_NOT_FOUND
(Note: my dev computer is not part of the domain, but is attached to the network and I can logon to the site with the credentials passed to the API)

2) Use SharePoint authentication Web Service
https://server-name/_vti_bin/authentication.asmx…
I can import the web service but cannot get it to work.

So here's my question:
Has anybody been able to get authentication (for an impersonated user) to work when trying to consume SharePoint web services?

Any help will be highly appreciated.

If I can't find a solution, I guess I'll switch over to .Net for this is there are tons of examples (contrary to WX) on how to achieve this.

Thanks in advance,

Peter H.
Publicado el 24,agosto 2015 - 21:29
Peter,

For a connection with Microsoft NAV webservives I had to first set the HTTPParameter (http://doc.pcsoft.fr/en-US/?1000018985&name=HTTPParameter)

httpParameterMode Used to configure the management mode of requests. The associated with this constant can be:
0 (False by default): Standard management mode of requests, performed by WinDev and WebDev.
1 (True): Management mode of requests performed by Internet Explorer. This value must be used in specific cases and it may trigger changes of behavior.

To 1 so it uses Internet Explorer to do the authentication. Then I just had to set the Username and password of the webservice.

Maybe this wil work for Sharepoint also ?

Danny
Publicado el 25,agosto 2015 - 09:26
Hi Danny,

Thanks for the reply. This may indeed be a work around, but I am not sure.

In the mean time I was able to get a workaround by installing my dev environment on a (virtual) machine that is part of the domain.

The SharePoint web services use NTLM/Kerberos authentication (like integrated Windows authentication) and apparently it is impossible to get authentication from a machine that is not part of the domain as it uses a double hob scheme to authenticate which won't work in this case.
I'm not sure I fully understand it myself, but I got it to work like a charm from within the domain.

Note: I don't use the SOAP or HTTP or WSRequest functions but have natively imported the SharePoint wsdl's into my project.
I'll investigate if this also works for the HTTP parameter setting you mentioned.

Thanks all for helping out!

Cheers,

Peter H.