--Edited--
Hi,
I want to create a Return Authorization in ASP.NET application. I use the object from the sample code (which works fine for item query etc.) Following SOAP REQUEST returns USER_ERROR "Please choose an item to add" in response status:
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <preferences xmlns="urn:messages_2_5.platform.webservices.netsuite.com"> <warningAsError>false</warningAsError> </preferences> </soap:Header> <soap:Body> <add xmlns="urn:messages_2_5.platform.webservices.netsuite.com"> <record xmlns:q1="urn:customers_2_5.transactions.webservices.netsuite.com" xsi:type="q1:ReturnAuthorization"> <q1:entity> <name xmlns="urn:core_2_5.platform.webservices.netsuite.com">xxxxxxxxxx@usnavysealstore.com</name> </q1:entity> <q1:tranDate>2007-03-12T16:23:00</q1:tranDate> <q1:tranId>NS-RA10107</q1:tranId> <q1:memo>3/12/07:per xxxx she is to be charge for restocking fees and nonrefundable shipping charges.(xxx)</q1:memo> <q1:itemList> <q1:item> <q1:item type="inventoryItem"> <name xmlns="urn:core_2_5.platform.webservices.netsuite.com">NS-SSR-71536265-SE-BOO-XXXX-XXX-XX</name> </q1:item> <q1:quantity>1</q1:quantity> <q1:amount>6.99</q1:amount> </q1:item> <q1:item> <q1:item type="otherChargeSaleItem"> <name xmlns="urn:core_2_5.platform.webservices.netsuite.com">NS - Restocking Fee</name> </q1:item> <q1:quantity>1</q1:quantity> <q1:amount>-0.7</q1:amount> </q1:item> </q1:itemList> </record> </add> </soap:Body> </soap:Envelope>
As far as I can see there are nested <q1:item> tags, which I believe causing the problem. I have the following C# code for that: ReturnAuthorization RA = new ReturnAuthorization(); ReturnAuthorizationItemList ra_itemList = new ReturnAuthorizationItemList(); ReturnAuthorizationItem[] ra_items = new ReturnAuthorizationItem[2]; // Inventory item being returned ra_items[0] = new ReturnAuthorizationItem(); ra_items[0].quantitySpecified = true; ra_items[0].quantity = 1; ra_items[0].amountSpecified = true; ra_items[0].amount = 6.99; ra_items[0].item = new RecordRef(); ra_items[0].item.typeSpecified = true; ra_items[0].item.type = RecordType.inventoryItem; ra_items[0].item.name = "NS-SSR-71536265-SE-BOO-XXXX-XXX-XX"; // ra_items[1] = new ReturnAuthorizationItem(); ra_items[1].quantitySpecified = true; ra_items[1].quantity = 1; ra_items[1].amountSpecified = true; ra_items[1].amount = -0.7; ra_items[1].item = new RecordRef(); ra_items[1].item.typeSpecified = true; ra_items[1].item.type = RecordType.otherChargeSaleItem; ra_items[1].item.name = "NS - Restocking Fee"; // itemList is NOT an array of items, but itemList.item is. ra_itemList.item = ra_items; RA.itemList = ra_itemList;
I feel like I am missing something when I refer to items/item lists. Can anybody see my mistake?Thanks in advance.