I'm trying to use the asyncAddList operation to create a large purchase order, and I am running into an unusual XML error (one that I do not see when performing normal add/update/delete operations). For background, the platform is Ruby 1.8.6 with the SOAP module (1.6.1-snapshot I think) and an autogenerated class file from wsdl2ruby. Here's what the top portion of my request XML looks like:
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <env:Body> <n1:asyncAddList xmlns:n1="urn:messages_2_6.platform.webservices.netsuite.com"> <n1:record xsi:type="n2:PurchaseOrder" xmlns:n2="urn:purchases_2_6.transactions.webservices.netsuite.com"> <n2:entity internalId="21" xsi:type="n3:RecordRef" xmlns:n3="urn:core_2_6.platform.webservices.netsuite.com"/> <n2:itemList replaceAll="true"> <n2:item> <n2:item xsi:type="n4:RecordRef" externalId="Foo-V-12345" type="inventoryItem" xmlns:n4="urn:core_2_6.platform.webservices.netsuite.com"/> <n2:quantity>30</n2:quantity> </n2:item>
Many items later, the end looks like: </n2:itemList> </n1:record> </n1:asyncAddList> </env:Body> </env:Envelope>
I submit my XML and watch the queue, where it appears and is processed by Netsuite. However, the XML response looks like this:<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>org.xml.sax.SAXParseException: The prefix "n1" for element "n1:record" is not bound.</faultstring> <detail> <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">org.xml.sax.SAXParseException: The prefix "n1" for element "n1:record" is not bound.
[stack trace...]I'm not the president of the XML Club or anything, but it looks like the n1 prefix is bound in the parameters for the n1:asyncAddList element. Is that parameter local to that element, where I need to repeat the xmlns:n1= statement in the n1:record element's parameters? I'm hoping someone else has run into this and can offer some useful advice.Jim