Method Community

 

Intermittent HTTP/1.1 400 Bad Request Error

Last post 03-13-2013 1:33 PM by ImTheirWebGuy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-13-2013 11:52 AM

    Intermittent HTTP/1.1 400 Bad Request Error

    Hi there!

    We've got a customer form which on submission, creates a new Lead and associated Opportunity. For the most part, this works without issue. Every now and then, with no explanation, the Lead will create, but the Opportunity fails to. I added a hook to email me the raw API call after submission, and waited for the next failure, then tested the Opportunity call in SoapUI, and received the following response:

    HTTP/1.1 400 Bad Request
    Cache-Control: private
    Content-Type: application/soap+xml; charset=utf-8
    ETag: ""
    Server: Microsoft-IIS/7.0
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    p3p: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"
    Date: Wed, 13 Mar 2013 16:27:37 GMT
    Content-Length: 0

    I can't see any difference between submissions which work correctly, and submissions which do not. Here's an example of the call that just failed:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
       <soap:Header/>
       <soap:Body>
          <tem:MethodAPIInsertV2>
             <!--Optional:-->
             <tem:strCompanyAccount>ourcompanyaccount</tem:strCompanyAccount>
             <!--Optional:-->
             <tem:strLogin>my login</tem:strLogin>
             <!--Optional:-->
             <tem:strPassword>my password</tem:strPassword>
             <!--Optional:-->
             <tem:strSessionID/>
             <!--Optional:-->
             <tem:strTable>Opportunity</tem:strTable>
             <!--Optional:-->
             <tem:arrInsertFieldsArray>
                <!--Zero or more repetitions:-->
                <tem:string>AssignedTo</tem:string>
                <tem:string>BudgetEstimate</tem:string>
                <tem:string>Customer</tem:string>
                <tem:string>EventDate</tem:string>
                <tem:string>EventType</tem:string>
                <tem:string>FlexibleDate</tem:string>
                <tem:string>FlexibleDetails</tem:string>
                <tem:string>Guests</tem:string>
                <tem:string>Name</tem:string>
                <tem:string>Details</tem:string>
                <tem:string>CloseDate</tem:string>
                <tem:string>OpportunityStage</tem:string>
             </tem:arrInsertFieldsArray>
             <!--Optional:-->
             <tem:arrInsertValueArray>
                <!--Zero or more repetitions:-->
                <tem:string>Andrea Farnum</tem:string>
                <tem:string>10000</tem:string>
                <tem:string>Chris McMoretestspam Web Lead</tem:string>
                <tem:string>05/25/2013</tem:string>
                <tem:string>Wedding Ceremony & Reception</tem:string>
                <tem:string>Yes</tem:string>
                <tem:string>Either weekend. </tem:string>
                <tem:string>150</tem:string>
                <tem:string>McMoretestspam Wedding Ceremony & Reception 05/25/2013</tem:string>
                <tem:string>Testing the hard dump reporting setup</tem:string>
                <tem:string>2013-Apr-12 04:02:37 PM</tem:string>
                <tem:string>RFP</tem:string>
             </tem:arrInsertValueArray>
          </tem:MethodAPIInsertV2>
       </soap:Body>
    </soap:Envelope>

    Any guidance? The system works 75% of the time, but that 25% is causing some huge distrust of the system from our sales staff, and I'm trying to get it nailed down without much success. I'd love to hear that I overlooked something obvious.

  • 03-13-2013 1:21 PM In reply to

    Re: Intermittent HTTP/1.1 400 Bad Request Error

    Answer


    Hi ImTheirWebGuy

    How are you sending the request? Are you just sending xml directly? Is the & in McMoretestspam Wedding Ceremony & Reception 05/25/2013 encoded? 

    If that is not the issue can you send me an email(so you don't post sensitive data in the forum) with an example of data from a good post post, a bad post, and your account name

    Dave

  • 03-13-2013 1:25 PM In reply to

    Re: Intermittent HTTP/1.1 400 Bad Request Error

    " Is the & in McMoretestspam Wedding Ceremony & Reception 05/25/2013 encoded?"

    Holy crap. Been banging my head on this for days, and I think that's the obvious answer I missed. Testing now. 

    In answer to the other questions, it's well formed xml packets being posted via cURL in PHP.

  • 03-13-2013 1:33 PM In reply to

    Re: Intermittent HTTP/1.1 400 Bad Request Error

    That was exactly correct. All tests are passing now. Thanks David!

Page 1 of 1 (4 items)