Expand my Community achievements bar.

SOLVED

Is there a way to write multiple records in to adobe campaign AKA nolan

Avatar

Level 1

Hi All ,

I am trying to consume API exposed by adobe campaign . I want to write multiple records in one single API call.

I have my below soap message which I am trying to send

Request :

<?xml version='1.0' encoding='ISO-8859-1'?>

<soapenv:Envelope

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

xmlns:urn='urn:xtk:session'>

<soapenv:Header/>

<soapenv:Body>

<urn:Write>

<urn:sessiontoken>___8df4fd29-3dd5-4e59-9f35-bbf2a5905b18</urn:sessiontoken>

<urn:domDoc>

<welcomeSubscriberapi _operation='insertOrUpdate' xtkschema='cnet:welcomeSubscriberapi' _key='@emailAddress' firstName='adasd' lastName='adasd' emailAddress ='testData@gmail.com' segmentValue ='For_Home' country ='us' language = 'en' newSubscriber ='No'></welcomeSubscriberapi>

<welcomeSubscriberapi _operation='insertOrUpdate' xtkschema='cnet:welcomeSubscriberapi' _key='@emailAddress' firstName='abcded' lastName='efgh' emailAddress ='testData12@gmail.com' segmentValue ='MEMBER' country ='us' language = 'en' newSubscriber ='No'></welcomeSubscriberapi>

</urn:domDoc>

</urn:Write>

</soapenv:Body>

</soapenv:Envelope>

but  I get below error response back

Response :

<?xml version='1.0'?>

<SOAP-ENV:Envelope

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

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

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

<SOAP-ENV:Body>

<SOAP-ENV:Fault>

<faultcode>SOAP-ENV:Server</faultcode>

<faultstring xsi:type='xsd:string'>SOP-330011 Error while executing the method 'Write' of service 'xtk:persist'.</faultstring>

<detail xsi:type='xsd:string'>SOP-330020 A 'document' parameter contains more than one root element.</detail>

</SOAP-ENV:Fault>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

I am trying to follow below example provided in adobe campaign documentation website

<recipient-collection xtkschema="nms:recipient">   

  <recipient email="john.doe@adobe.com" firstName="John" lastName="Doe" _key="@email"/>

<recipient email="peter.martinez@adobe.com" firstName="Peter" lastName="Martinez" _key="@email"/>

  <recipient ...

</recipient-collection>

please help me with this , I am kind of stuck.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You're close. Use xtk:persist#WriteCollection for the SOAPAction:

Then it's just:

<SOAP-ENV:Body>

  <WriteCollection>

    <__sessiontoken></__sessiontoken>

    <domDoc>

      <welcomeSubscriberapi-collection xtkschema="cnet:welcomeSubscriberapi">

        <welcomeSubscriberapi _operation='insertOrUpdate' xtkschema='cnet:welcomeSubscriberapi' _key='@emailAddress' firstName='adasd' lastName='adasd' emailAddress ='testData@gmail.com' segmentValue ='For_Home' country ='us' language = 'en' newSubscriber ='No'></welcomeSubscriberapi>

        <welcomeSubscriberapi _operation='insertOrUpdate' xtkschema='cnet:welcomeSubscriberapi' _key='@emailAddress' firstName='abcded' lastName='efgh' emailAddress ='testData12@gmail.com' segmentValue ='MEMBER' country ='us' language = 'en' newSubscriber ='No'></welcomeSubscriberapi>

      </welcomeSubscriberapi-collection>

    </domDoc>

  </WriteCollection>

</SOAP-ENV:Body>

PS is this CNET CBSi?

Thanks,

-Jon

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

You're close. Use xtk:persist#WriteCollection for the SOAPAction:

Then it's just:

<SOAP-ENV:Body>

  <WriteCollection>

    <__sessiontoken></__sessiontoken>

    <domDoc>

      <welcomeSubscriberapi-collection xtkschema="cnet:welcomeSubscriberapi">

        <welcomeSubscriberapi _operation='insertOrUpdate' xtkschema='cnet:welcomeSubscriberapi' _key='@emailAddress' firstName='adasd' lastName='adasd' emailAddress ='testData@gmail.com' segmentValue ='For_Home' country ='us' language = 'en' newSubscriber ='No'></welcomeSubscriberapi>

        <welcomeSubscriberapi _operation='insertOrUpdate' xtkschema='cnet:welcomeSubscriberapi' _key='@emailAddress' firstName='abcded' lastName='efgh' emailAddress ='testData12@gmail.com' segmentValue ='MEMBER' country ='us' language = 'en' newSubscriber ='No'></welcomeSubscriberapi>

      </welcomeSubscriberapi-collection>

    </domDoc>

  </WriteCollection>

</SOAP-ENV:Body>

PS is this CNET CBSi?

Thanks,

-Jon

Avatar

Level 4

Hi Jon/Srinivas,

I am also trying to insert multiple records in single API call

Can you give me custom schema structure and SOAP UI message please.I am struggling from 3 days.

Thanks,

Priyanks