Create, Update, and Delete request for Simple Object Access Protocol (SOAP) Object Writes - EcoSys - Customization & Programming - Hexagon

EcoSys Web Service API Usage Documentation

Language
English
Product
EcoSys
Search by Category
Customization & Programming
EcoSys Version
9.3

Object Update/Create Requests

Example SOAP message for writing to an object API via update or create. Note that the <...Options> and <...Parameters> elements are optional unless there is a required runtime parameter defined. For more information on requesting logging results of the call to the batch job log, refer to Batch Job Logging.

<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Body>

← SOAP envelope and body

<m:SampleObjectUpdateRequestElement

xmlns:m="http://ecosys.net/api/SampleObject">

← Request element ("Update" call in this example)

<SampleObjectOptions>

<Username>admin</Username>

<Password>secret</Password>

<LogoutSession>true</LogoutSession>

<LogLevel>DETAIL</LogLevel>

</SampleObjectOptions>

← Request options element (credentials, logging, etc.)

<SampleObjectParameters>

<filter>ABC</filter>

</SampleObjectParameters>

← Runtime parameters (if any defined)

<SampleObject>

<CostObjectID>Project ABC</CostObjectID>

<CostObjectName>Project ABC New Name</CostObjectName>

</SampleObject>

<SampleObject>

<CostObjectID>Project DEF</CostObjectID>

<CostObjectName>Project DEF New Name</CostObjectName>

</SampleObject>

. . .

← List of input objects to update/create

</m:SampleObjectUpdateRequestElement>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

← Closing tags

Object Delete Requests

Example SOAP message for deleting from an object AP. Note that the <...Options> and <...Parameters> elements are optional unless there is a required runtime parameter defined. See the section on Batch Job Logging for details on requesting logging results of the call to the batch job log.

Delete operation is nearly identical to a create/update operation, except that the input object type ends with ...Key, for example "SampleObjectKey" instead of "SampleObject". The key object requires only identifying key attributes for deletes.

<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<SOAP-ENV:Body>

← SOAP envelope and body

<m:SampleObjectDeleteRequestElement

xmlns:m="http://ecosys.net/api/SampleObject">

← Request element

<SampleObjectOptions>

<Username>admin</Username>

<Password>secret</Password>

<LogoutSession>true</LogoutSession>

</SampleObjectOptions>

← Request options element (credentials, logging, etc.)

<SampleObjectParameters>

<filter>ABC</filter>

</SampleObjectParameters>

← Runtime parameters (if any defined)

<SampleObjectKey>

<CostObjectID>Project ABC</CostObjectID>

</SampleObjectKey>

<SampleObjectKey>

<CostObjectID>Project DEF</CostObjectID>

</SampleObjectKey>

. . .

← List of input object keys to delete, specifying only the key fields required

</m:SampleObjectDeleteRequestElement>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

← Closing tags

Object Write Responses

Example SOAP message response for writing (create, update, or delete) to an object API. In this example, one of the input records was successful, and the other was not. For details on the reason code values, see Result Reason Codes. For example messages, see Result XML Format.

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

<soapenv:Envelope xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"

xmlns:ns1="http://ecosys.net/api/SampleObject"

xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<soapenv:Body>

← SOAP envelope and body

<ns1:SampleObjectWriteResponseElement>

← Response element

<ObjectResult

index="0" successFlag="true"

internalId="53377"

externalId="PROJ_ABC"/>

← Object result for first (index=0) input record (success) and resulting keys

<ObjectResult

index="1" successFlag="false"

internalId=""

externalId="PROJ_DEF">

<ResultMessage

level="FAILURE"

reasonCode="ESRC_OBJECT_NOT_FOUND_BY_KEY">

<KeyName>Project DEF</KeyName>

<Message>Record write (ignore) disallowed

because object not found by key.</Message>

</ResultMessage>

. . .

</ObjectResult>

. . .

← Object result for second (index=1) input record (failure), with corresponding ResultMessage object with reason code and corresponding keys

There may be more than one ResultMessage per ObjectResult.

</ns1:SampleObjectWriteResponseElement>

</soapenv:Body>

</soapenv:Envelope>

← Closing tags