none
401 Authorization Error while consuming CRM 4.0 service in BizTalk dynamic port RRS feed

  • Question

  • Hi,

    I am using dynamic port to consume crm 4.0 service. Following are properties i am setting in orchestration. But getting 401 Authorization error same as i was getting while trying with static port.

    MSG_CRMCreateRequest(WCF.UserName) = "username";
    MSG_CRMCreateRequest(WCF.Password) = "password";
    MSG_CRMCreateRequest(SOAP.Username) = "username";
    MSG_CRMCreateRequest(SOAP.Password) = "Spassword";
    MSG_CRMCreateRequest(WCF.BindingType) = "basicHttpBinding";
    MSG_CRMCreateRequest(WCF.BindingConfiguration) = "<binding name=\"basicHttpBinding\" sendTimeout=\"00:10:00\" maxReceivedMessageSize=\"104857600\" />";
    MSG_CRMCreateRequest(WCF.Action)="http://schemas.microsoft.com/crm/2007/WebServices/Create";
    MSG_CRMCreateRequest(WCF.SecurityMode)="Message";
    MSG_CRMCreateRequest(WCF.TransportClientCredentialType)="Windows";
    Dynamic_Send_To_CRM(Microsoft.XLANGs.BaseTypes.Address)="http://servername:port/MSCrmServices/2007/CrmService.asmx";
    Dynamic_Send_To_CRM(Microsoft.XLANGs.BaseTypes.TransportType)="WCF-Custom";

    Error details: System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.

    Please suggest what setting i should add more to avoide above error.

    Thanks & Regards,


    //Dharmendra //Bangalore, India
    Tuesday, January 11, 2011 6:57 AM

Answers

  • What credentials are you passing to the service ? Is it the integrated windows domain login ?

    The easy way to check if this is working for the credentials is to consume the service using a .NET test harness first.

    See , if you are able to access the service using the .NET .

    Try setting security mode to None where MSG_CRMCreateRequest(WCF.TransportClientCredentialType)="Windows";

    Also , tweeking the binding file will help.

    Here is the link for reference

    http://stackoverflow.com/questions/213978/wcf-security-error-with-vs-2008-unit-test

    HTH

    Sullu


    http://biztalkguide.blogspot.com/ Please mark as answer if this solved the issue.Thanks
    Tuesday, January 11, 2011 9:33 AM

All replies

  • Hi

    Check if you have Anonymous Authentication enabled ?

    Most of us get 401 error ,while consuming the CRM , all due to setting up the authentication properly.

    HTH

    Sullu


    http://biztalkguide.blogspot.com/ Please mark as answer if this solved the issue.Thanks
    Tuesday, January 11, 2011 9:11 AM
  • hi,

    Yes Anonymous Authentication is enabled. Still i get error.

    Regards,


    //Dharmendra //Bangalore, India
    Tuesday, January 11, 2011 9:16 AM
  • What credentials are you passing to the service ? Is it the integrated windows domain login ?

    The easy way to check if this is working for the credentials is to consume the service using a .NET test harness first.

    See , if you are able to access the service using the .NET .

    Try setting security mode to None where MSG_CRMCreateRequest(WCF.TransportClientCredentialType)="Windows";

    Also , tweeking the binding file will help.

    Here is the link for reference

    http://stackoverflow.com/questions/213978/wcf-security-error-with-vs-2008-unit-test

    HTH

    Sullu


    http://biztalkguide.blogspot.com/ Please mark as answer if this solved the issue.Thanks
    Tuesday, January 11, 2011 9:33 AM