Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Soap API Challenge?

AlexHorton
Collaborator II

Hello all,

 

While using the example given for an Ajax call via the soap API, I seem to be running into a head scratcher.

 

I am attempting to use the UpdateRecord API with the following XML:

 

<?xml version="1.0" encoding="utf-8"?>
 <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
   <UpdateRecord xmlns="http://archer-tech.com/webservices/">
    <sessionToken>EB4B9E11D1192CF88A8205248ECDEE27</sessionToken>
    <moduleId>562</moduleId>
    <contentId>286102</contentId>
     <fieldValues>
      <![CDATA[<fieldValues><Field id="31866" value="Testing Value" ></Field></fieldValues>]]>
     </fieldValues>
   </UpdateRecord>
  </soap:Body>
 </soap:Envelope>

 

Problem is, I am getting the following back:
{
  "readyState": 4,
  "responseText": "soap:ServerServer was unable to process request. ---> Input string was not in a correct format.",
  "responseXML": {},
  "status": 500,
  "statusText": "Internal Server Error"
}
Server was unable to process request. ---> Input string was not in a correct format.

 

I can't seem to find where the gap is at.  The xml seems to be well formed to me, unless I'm just blind as a bat...

1 ACCEPTED SOLUTION

Accepted Solutions

JeffLetterman
Archer Employee
Archer Employee

I'll take up the challenge!    This may sound weird based on the exception, but does the api user account have the System Administrator Role?  If not, add it and test again.  The purpose of the role is to quickly determine if issue is permissions based.  Also, try updating the same record using Archer API Templates - an Archer application to quickly test the Archer Web Services API, REST API, and Content API using Custom Objects and much more‌.

View solution in original post

8 REPLIES 8

JeffLetterman
Archer Employee
Archer Employee

I'll take up the challenge!    This may sound weird based on the exception, but does the api user account have the System Administrator Role?  If not, add it and test again.  The purpose of the role is to quickly determine if issue is permissions based.  Also, try updating the same record using Archer API Templates - an Archer application to quickly test the Archer Web Services API, REST API, and Content API using Custom Objects and much more‌.

Yep, it's me that is attempting to send the api call.

I'm grabbing my sessionToken using this line of code:

    var sessionToken = parent.parent.ArcherApp.globals.workpointFeatures.SessionToken;

Ilya_Khen
Champion III

Do you really need <fieldValues> 2 times?

<fieldValues>
<![CDATA[<fieldValues><Field id="31866" value="Testing Value" ></Field></fieldValues>]]>
</fieldValues>‍‍‍‍‍‍

JeffLetterman
Archer Employee
Archer Employee

What is the field type of 31866?  If it is a Values List, you need to pass the ID of Value, not the friendly display value.

 

Ilya Khen‌ - when using SOAP, the first fieldValues is the actual parameter name.  The second fieldValues is to enclose the fields in XML.  

Boy, do I feel stupid....

 

The record's field ID I was referencing wasn't correct - it was off by one digit.

 

(Slaps head)

 

I replaced it with the correct one and boom, it worked.

The Toolbox did help me with this one  

 

Thanks, Jeff!

Great

Got it