Article ID: 9402, created on Dec 5, 2010, last review on May 3, 2014

  • Applies to:
  • Business Automation

Symptoms

The following PBA-E XML API request fails:

<?xml version='1.0'?>
<methodCall>
<methodName>Execute</methodName>
<params>
<param>
<value><struct>
<member>
<name>Params</name>
<value><array><data>
<value><string>NULL</string></value>
<value><string>Default NS Subscription</string></value>
<value><int>30</int></value>
<value><int>50</int></value>
<value><int>1289347200</int></value>
<value><int>1320883200</int></value>
<value><string>1030129</string></value>
<value><int>4</int></value>
<value><int>1</int></value>
<value><int>3</int></value>
<value><double>0.0</double></value>
<value><double>0.0</double></value>
<value><double>0.0</double></value>
<value><double>0.0</double></value>
<value><double>0.0</double></value>
<value><int>0</int></value>
<value><int>3</int></value>
<value><int>1</int></value>
<value><int>1289347200</int></value>
<value><int>1289347200</int></value>
</data></array></value>
</member>
<member>
<name>Method</name>
<value><string>SubscriptionAdd_API</string></value>
</member>
<member>
<name>Server</name>
<value><string>BM</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>

The error message is the following:

# curl -d@subscription.xml http://127.0.0.1:5224/RPC2 -H'Content-type: text/xml'
<?xml version="1.0"?>
<methodResponse><fault>
  <value><struct>
  <member>
    <name>faultCode</name>
    <value><i4>-1</i4></value>
  </member>
  <member>
    <name>faultString</name>
    <value><string>ERROR: insert or update on table 'Subscription' violates foreign key constraint 'Subscription_Parent_subscr_049'
    Key (Parent_subscriptionID)=(-2147483648) is not present in table 'Subscription'.;
    Error while executing the query
    ERROR: insert or update on table 'Subscription' violates foreign key constraint 'Subscription_Parent_subscr_049'
    Key (Parent_subscriptionID)=(-2147483648) is not present in table 'Subscription'.;
    Error while executing the query</string></value>
  </member>
  </struct></value>
</fault></methodResponse>

Cause

The first parameter in XML API call (it is parent subscription ID) has wrong type, PBA-E expects to see integer value while string is used.

Resolution

Change the line in XML request
<value><string>NULL</string></value>

to
<value><int>-2147483648</int></value>

198398b282069eaf2d94a6af87dcb3ff caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF