locked
The request failed with HTTP status 400: Bad Request. RRS feed

  • Question

  • When i am trying to insert record in Entity in crm4.0 using web services in SSIS Script Component i got this error please help me

    The request failed with HTTP status 400: Bad Request.

    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

    at SC_9b8cb6f38b324ceeb4981e80f6876611.csproj.CRM.CrmService.Create(BusinessEntity entity)

    at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)

    at UserComponent.Input0_ProcessInput(Input0Buffer Buffer)

    at UserComponent.ProcessInput(Int32 InputID, PipelineBuffer Buffer)

    at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

    Thanks in Advance

    Friday, February 11, 2011 10:37 AM

Answers

  • With a 400 error it's unlikely the request has got as far as the CRM platform, so tracing will probably not help. The 3 most likely causes of a 400 Bad Request are:

    1. You've got an incorrect Url for the CRM web service
    2. CRM is incorrectly configured (this can happen in some circumstances if the AD SDK Root Domain setting is incorrect
    3. You've not encoded the request properly, and you've some characters in the data (e.g. <, >, &, ") that cause malformed XML

    If it's either 1 or 2, this error would apply for all records, whereas 3 would be record-specific. It would be helpful if you could give more information about the circumstances of the error in your initial post - see http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/d5afd5b1-5324-4e20-85ef-f15c13936c92 for some posting suggestions


    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Friday, February 11, 2011 1:46 PM
    Moderator

All replies

  • Enable tracing and provide a more explicit error. To enable CRM Trace, Start > Run > regedit > HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > MSCRM and add TraceEnabled and TraceRefresh keys (both DWORD, value = 1).
    Cornel Croitoriu - Senior Software Developer - www.Biz-Forward.com
    Friday, February 11, 2011 11:21 AM
  • With a 400 error it's unlikely the request has got as far as the CRM platform, so tracing will probably not help. The 3 most likely causes of a 400 Bad Request are:

    1. You've got an incorrect Url for the CRM web service
    2. CRM is incorrectly configured (this can happen in some circumstances if the AD SDK Root Domain setting is incorrect
    3. You've not encoded the request properly, and you've some characters in the data (e.g. <, >, &, ") that cause malformed XML

    If it's either 1 or 2, this error would apply for all records, whereas 3 would be record-specific. It would be helpful if you could give more information about the circumstances of the error in your initial post - see http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/d5afd5b1-5324-4e20-85ef-f15c13936c92 for some posting suggestions


    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Friday, February 11, 2011 1:46 PM
    Moderator