000012781 - When calling a Web Service API method using SOAP  the following occurs: The remote server returned an error: (400) Bad Request.

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 22, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000012781
Applies ToRSA Archer
IssueWhen calling a Web Service API method using SOAP, the following occurs: The remote server returned an error: (400) Bad Request.
CauseThis typically occurs when calling the Web Service API method using SOAP and one of the method parameters requires an XML string.  The following shows an invalid SOAP call for the UpdateRecord method because the fieldValues parameter is not correct.  The XML string value needs to be enclosed using CDATA.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://archer-tech.com/webservices/">
  <soapenv:Header />
  <soapenv:Body>
    <web:UpdateRecord>
      <web:sessionToken>0602B9C307ADF8082D4B31DEB490A063</web:sessionToken>
      <web:moduleId>397</web:moduleId>
      <web:contentId>205530</web:contentId>
      <web:fieldValues><fieldValues><Field id="13867" value="My updated value from API." /></fieldValues></web:fieldValues>
    </web:UpdateRecord>
  </soapenv:Body>
</soapenv:Envelope>
 
ResolutionThe XML string value needs to be enclosed using CDATA.  The following is a valid SOAP call for the UpdateRecord method.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://archer-tech.com/webservices/">
  <soapenv:Header />
  <soapenv:Body>
    <web:UpdateRecord>
      <web:sessionToken>0602B9C307ADF8082D4B31DEB490A063</web:sessionToken>
      <web:moduleId>397</web:moduleId>
      <web:contentId>205530</web:contentId>
      <web:fieldValues><![CDATA[<fieldValues><Field id="13867" value="My updated value from API." /></fieldValues>]]></web:fieldValues>
    </web:UpdateRecord>
  </soapenv:Body>
</soapenv:Envelope>
 
Legacy Article IDa64323

Attachments

    Outcomes