1 Reply Latest reply: Feb 2, 2014 9:58 PM by Nanoucab RSS

    Help with a Bad Request on the CRM API

    Jupiter Community Member

      Hi All,

       

      I'm new the BC API's and have an issue I'm hoping someone can help with.

       

      The following request generates a Bad Request... but I can't see why. Can anyone see what I've done wrong?

       

      I've also included a second request in this email with a badly formatted timestamp which is giving me an understandable error - bad format I've only included this second request because it appears to be reading it - at least until it fins an error - which makes me think that the format is almost correct.

       

      Thanks in advance.

       

      Kind Regards,

       

      Jupiter

       

      POST /catalystwebservice/catalystcrmwebservice.asmx HTTP/1.1

      Host: myDomain.worldsecuresystems.com

      Content-Type: text/xml; charset=utf-8

      Content-Length: 882

      SOAPAction: "http://tempuri.org/CatalystDeveloperService/CatalystCRMWebservice/ContactList_Retrieve"

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

      <env:Body>

          <ContactList_Retrieve xmlns="http://tempuri.org/CatalystDeveloperService/CatalystCRMWebservice">

            <username xsi:type="xsd:string">myEmail</username>

            <password xsi:type="xsd:string">myPassword</password>

            <siteId xsi:type="xsd:integer">mySiteId</siteId>

            <lastUpdateDate xsi:type="xsd:date">2013-01-01T10:15:30-10:00</lastUpdateDate>

            <recordStart xsi:type="xsd:integer">0</recordStart>

            <moreRecords xsi:type="xsd:boolean">false</moreRecords>

          </ContactList_Retrieve>

      </env:Body>

      </env:Envelope>

       

      The above returns:

       

      HTTP/1.1 400 Bad Request

      Cache-Control: private

      Content-Type: text/html

      Access-Control-Allow-Origin: *

      Date: Mon, 27 Jan 2014 23:48:06 GMT

      Content-Length: 11

       

       

      Bad Request

       

      The second example with the bad timestamp format is:

       

      POST /catalystwebservice/catalystcrmwebservice.asmx HTTP/1.1

      Host: myDomain.worldsecuresystems.com

      Content-Type: text/xml; charset=utf-8

      Content-Length: 883

      SOAPAction: "http://tempuri.org/CatalystDeveloperService/CatalystCRMWebservice/ContactList_Retrieve"

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

      <env:Body>

          <ContactList_Retrieve xmlns="http://tempuri.org/CatalystDeveloperService/CatalystCRMWebservice">

            <username xsi:type="xsd:string">myEmail</username>

            <password xsi:type="xsd:string">myPassword</password>

            <siteId xsi:type="xsd:integer">mySiteId</siteId>

            <lastUpdateDate xsi:type="xsd:date">2013-01-01T10:15:30Z-10:00</lastUpdateDate>

            <recordStart xsi:type="xsd:integer">0</recordStart>

            <moreRecords xsi:type="xsd:boolean">false</moreRecords>

          </ContactList_Retrieve>

      </env:Body>

      </env:Envelope>

       

      ...which returns:

       

      HTTP/1.1 500 Internal Server Error

      Cache-Control: private

      Content-Length: 504

      Content-Type: text/xml; charset=utf-8

      Access-Control-Allow-Origin: *

      Date: Mon, 27 Jan 2014 23:55:04 GMT

       

       

      <?xml version="1.0" encoding="utf-8"?>

           <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

                <soap:Body>

                     <soap:Fault>

                          <faultcode>soap:Client</faultcode>

                          <faultstring>Server was unable to read request. ---&gt; There is an error in XML document (8, 86). ---&gt; The string '2013-01-01T10:15:30Z-10:00' is not a valid AllXsd value.</faultstring>

                          <detail />

                     </soap:Fault>

           </soap:Body>

      </soap:Envelope>

       

      Any advice would be greatly appreciated.