0
votes

I am trying to program a VisualWebPart using Visual Studio 2010 which has to do a simple thing: invoke a web service (hosted in a remote server, NOT locally). When I execute within the Sharepoint site (version 2010, which I have published in my IIS) I get this error:

"The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'."

Pardon my ignorance, but the only difference here is the case of the Ntlm authentication scheme! I have been all over the web and found many related problems, but none of the solutions worked. Almost ALL solutions i found involve modifications in the webservice security configuration, this is not an option for me.

Looking for a solution, I created a sample windows form and invoked the web service from it: no problems whatsoever.

In order to be able to invoke the webservice correctly this is the necessary security configuration:

<security mode="TransportCredentialOnly">
   <transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm="" />
   <message clientCredentialType="UserName" algorithmSuite="Default" />
</security>

I believe the problem is that I haven´t been able to properly set this security property to the web.config of my Sharepoint site, since I tried to put it in the security tag that appears in the web.config but still get the same error.

Any further information needed please ask, I am REALLY desperate, for days I have been with the SAME error.

1

1 Answers

0
votes

In the end I was given permissions in their server: more precisely in the database which was the one that wouldn't let me create the web part in the server. Once this was done, the call to the webservice worked just fine, because they have the web.config correctly configured.