Closed mbharanidharan88 closed 5 years ago
Nothing obvious leaps out as a problem but here's a working example: https://github.com/darroncockram/sdatasamples/tree/master/CreateSalesInvoice
Thanks! I referred the same and created the Invoice but still that error. Is there a way to get a Stack Trace with the request?
That is the stack trace in the error response but all it really tells us is that there was a problem deserialising the XML. If you capture the XML of the POST request what does it look like?
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:sme="http://schemas.sage.com/sdata/sme/2007" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sdata="http://schemas.sage.com/sdata/2008/1" xmlns:http="http://schemas.sage.com/sdata/http/2008/1" xmlns:sdatasync="http://schemas.sage.com/sdata/sync/2008/1">
<author />
<sdata:payload>
<salesInvoice sdata:uuid="00000000-0000-0000-0000-000000000000" xmlns="http://schemas.sage.com/crmErp/2008">
<active xsi:nil="true" />
<reference xsi:nil="true" />
<reference2 xsi:nil="true" />
<status xsi:nil="true" />
<allocationStatus xsi:nil="true" />
<deliveryStatus xsi:nil="true" />
<statusFlag xsi:nil="true" />
<statusFlagText xsi:nil="true" />
<type xsi:nil="true" />
<tradingAccount sdata:url="http://bharanidesktop:5495/sdata/accounts50/GCRM/{3C67D9B3-A00F-4F0A-A37C-F6B60E6306B5}/tradingAccountCustomer(efdb015d-7b05-4e61-898d-a62fe773b5fd)?format=atomentry" sdata:uuid="efdb015d-7b05-4e61-898d-a62fe773b5fd">
<active>true</active>
<customerSupplierFlag>Customer</customerSupplierFlag>
<companyPersonFlag>Company</companyPersonFlag>
<invoiceTradingAccount xsi:nil="true" />
<openedDate xsi:nil="true" />
<reference>ZEBRA</reference>
<reference2 xsi:nil="true" />
<status>Open</status>
<name>Zebra</name>
<shortName xsi:nil="true" />
<type>Unknown</type>
<registeredAddress xsi:nil="true" />
<postalAddresses xsi:nil="true" />
<shippingAddresses xsi:nil="true" />
<billingAddresses xsi:nil="true" />
<phones xsi:nil="true" />
<emails xsi:nil="true" />
<website />
<contacts xsi:nil="true" />
<deliveryContact xsi:nil="true" />
<salesPersons xsi:nil="true" />
<deliveryMethod xsi:nil="true" />
<deliveryRule>true</deliveryRule>
<currency>EUR</currency>
<taxCode xsi:nil="true" />
<taxReference />
<taxationCountry>IE</taxationCountry>
<useTaxInclusivePrices xsi:nil="true" />
<financeBalance>0.00</financeBalance>
<financeLimit>5000.00</financeLimit>
<financeBalanceDate xsi:nil="true" />
<financeStatusFlag>false</financeStatusFlag>
<financeStatusText>Open</financeStatusText>
<settlementDiscountType>Percent</settlementDiscountType>
<settlementDiscountAmount xsi:nil="true" />
<settlementDiscountPercent>0.00</settlementDiscountPercent>
<settlementDiscountTerms>0</settlementDiscountTerms>
<settlementDiscountTermsCommencement xsi:nil="true" />
<settlementDiscountIncludedInTotal>true</settlementDiscountIncludedInTotal>
<paymentTerms>0</paymentTerms>
<paymentTermsCommencement xsi:nil="true" />
<orderDiscountType xsi:nil="true" />
<orderDiscountAmount xsi:nil="true" />
<orderDiscountPercent xsi:nil="true" />
<orderText1 xsi:nil="true" />
<orderText2 xsi:nil="true" />
<orderLineDiscountType xsi:nil="true" />
<orderLineDiscountAmount xsi:nil="true" />
<orderLineDiscountPercent>0.00</orderLineDiscountPercent>
<orderLineText1 xsi:nil="true" />
<orderLineText2 xsi:nil="true" />
<invoiceDiscountType xsi:nil="true" />
<invoiceDiscountAmount xsi:nil="true" />
<invoiceDiscountPercent>0.00</invoiceDiscountPercent>
<invoiceText1 xsi:nil="true" />
<invoiceText2 xsi:nil="true" />
<bankAccounts xsi:nil="true" />
<tenderType xsi:nil="true" />
<defaultFulfillmentLocation xsi:nil="true" />
<pricelists xsi:nil="true" />
<pricingOverride xsi:nil="true" />
<accountingType xsi:nil="true" />
<financialAccounts xsi:nil="true" />
<primacyIndicator>true</primacyIndicator>
<opportunities xsi:nil="true" />
<salesQuotations xsi:nil="true" />
<salesOrders xsi:nil="true" />
<salesOrderDeliveries xsi:nil="true" />
<salesInvoices xsi:nil="true" />
<salesCredits xsi:nil="true" />
<purchaseOrders xsi:nil="true" />
<purchaseOrderDeliveries xsi:nil="true" />
<receipts xsi:nil="true" />
<interactions xsi:nil="true" />
<projects xsi:nil="true" />
</tradingAccount>
<customerReference xsi:nil="true" />
<opportunity xsi:nil="true" />
<pricelist xsi:nil="true" />
<copyFlag xsi:nil="true" />
<date xsi:nil="true" />
<time xsi:nil="true" />
<taxDate xsi:nil="true" />
<taxCodes>
<taxCode sdata:uuid="0b694565-e5c8-490a-9c5a-a32571173d91">
<notes xsi:nil="true" />
</taxCode>
</taxCodes>
<postalAddresses xsi:nil="true" />
<deliveryMethod xsi:nil="true" />
<deliveryTerms xsi:nil="true" />
<deliveryRule xsi:nil="true" />
<deliveryDate xsi:nil="true" />
<carrierCompany xsi:nil="true" />
<carrierTradingAccount xsi:nil="true" />
<carrierNetPrice>80.00</carrierNetPrice>
<carrierTaxPrice>20.00</carrierTaxPrice>
<carrierTotalPrice>100.00</carrierTotalPrice>
<carrierSalesInvoice xsi:nil="true" />
<carrierTaxCodes xsi:nil="true" />
<carrierReference xsi:nil="true" />
<currency xsi:nil="true" />
<operatingCompanyCurrency xsi:nil="true" />
<operatingCompanyCurrencyExchangeRate xsi:nil="true" />
<operatingCompanyCurrencyExchangeRateOperator xsi:nil="true" />
<operatingCompanyCurrencyExchangeRateDate xsi:nil="true" />
<customerTradingAccountCurrency xsi:nil="true" />
<customerTradingAccountCurrencyExchangeRate xsi:nil="true" />
<customerTradingAccountCurrencyExchangeRateOperator xsi:nil="true" />
<customerTradingAccountCurrencyExchangeRateDate xsi:nil="true" />
<buyerContact xsi:nil="true" />
<salespersons xsi:nil="true" />
<salesInvoiceLines>
<salesInvoiceLine sdata:uuid="00000000-0000-0000-0000-000000000000">
<originatorDocumentLine xsi:nil="true" />
<active xsi:nil="true" />
<reference xsi:nil="true" />
<reference2 xsi:nil="true" />
<status xsi:nil="true" />
<type>Standard</type>
<number xsi:nil="true" />
<commodity sdata:uuid="2e4f0611-0c32-4f25-8374-c814b90193d0">
<commodityGroup xsi:nil="true" />
<commodityIdentifiers xsi:nil="true" />
<unitOfMeasure xsi:nil="true" />
<buyingUnitOfMeasure xsi:nil="true" />
<sellingUnitOfMeasure xsi:nil="true" />
<packingUnitOfMeasure xsi:nil="true" />
<supplierTradingAccount xsi:nil="true" />
<taxCodes xsi:nil="true" />
<financialAccounts xsi:nil="true" />
<replacement xsi:nil="true" />
<associatedChildCommodities xsi:nil="true" />
<associatedParentCommodity xsi:nil="true" />
<interactions xsi:nil="true" />
<opportunities xsi:nil="true" />
<salesQuotationLines xsi:nil="true" />
<salesOrderLines xsi:nil="true" />
<salesOrderDeliveryLines xsi:nil="true" />
<salesInvoiceLines xsi:nil="true" />
<salesCreditLines xsi:nil="true" />
<purchaseOrderLines xsi:nil="true" />
<purchaseOrderDeliveryLines xsi:nil="true" />
<pricelists xsi:nil="true" />
<prices xsi:nil="true" />
</commodity>
<text xsi:nil="true" />
<deliveryTerms xsi:nil="true" />
<deliveryDate xsi:nil="true" />
<carrierTradingAccount xsi:nil="true" />
<carrierNetPrice xsi:nil="true" />
<carrierTaxPrice xsi:nil="true" />
<carrierTotalPrice xsi:nil="true" />
<carrierSalesInvoiceLine xsi:nil="true" />
<carrierTaxCodes xsi:nil="true" />
<carrierReference xsi:nil="true" />
<unitOfMeasure xsi:nil="true" />
<quantity>2.00</quantity>
<initialPrice xsi:nil="true" />
<pricelist xsi:nil="true" />
<settlementDiscountType xsi:nil="true" />
<settlementDiscountAmount xsi:nil="true" />
<settlementDiscountPercent xsi:nil="true" />
<settlementDiscountTerms xsi:nil="true" />
<invoiceLineDiscountType xsi:nil="true" />
<invoiceLineDiscountAmount xsi:nil="true" />
<invoiceLineDiscountPercent xsi:nil="true" />
<invoiceLineSubtotalDiscountType xsi:nil="true" />
<invoiceLineSubtotalDiscountAmount xsi:nil="true" />
<invoiceLineSubtotalDiscountPercent xsi:nil="true" />
<actualPrice xsi:nil="true" />
<netTotal>50.00</netTotal>
<chargesTotal xsi:nil="true" />
<discountTotal xsi:nil="true" />
<fOBPoint xsi:nil="true" />
<taxCodes>
<taxCode sdata:uuid="0b694565-e5c8-490a-9c5a-a32571173d91">
<notes xsi:nil="true" />
</taxCode>
</taxCodes>
<priceTax xsi:nil="true" />
<taxTotal>10.00</taxTotal>
<grossTotal>60.00</grossTotal>
<costTotal xsi:nil="true" />
<profitTotal xsi:nil="true" />
<project xsi:nil="true" />
<salesOrderDeliveryLines xsi:nil="true" />
<receipts xsi:nil="true" />
<financialAccounts xsi:nil="true" />
<notes xsi:nil="true" />
</salesInvoiceLine>
</salesInvoiceLines>
<lineCount xsi:nil="true" />
<originatorDocument xsi:nil="true" />
<salesOrderDeliveries xsi:nil="true" />
<receipts xsi:nil="true" />
<contract xsi:nil="true" />
<settlementDiscountType xsi:nil="true" />
<settlementDiscountAmount xsi:nil="true" />
<settlementDiscountPercent xsi:nil="true" />
<settlementDiscountTerms xsi:nil="true" />
<settlementDiscountIncludedInTotal xsi:nil="true" />
<invoiceDiscountType xsi:nil="true" />
<invoiceDiscountAmount xsi:nil="true" />
<invoiceDiscountPercent xsi:nil="true" />
<invoiceAdditionalDiscount1Type xsi:nil="true" />
<invoiceAdditionalDiscount1Amount xsi:nil="true" />
<invoiceAdditionalDiscount1Percent xsi:nil="true" />
<invoiceAdditionalDiscount2 xsi:nil="true" />
<invoiceAdditionalDiscount2Amount xsi:nil="true" />
<invoiceAdditionalDiscount2Percent xsi:nil="true" />
<netTotal xsi:nil="true" />
<discountTotal xsi:nil="true" />
<chargesTotal xsi:nil="true" />
<taxTotal xsi:nil="true" />
<grossTotal xsi:nil="true" />
<costTotal xsi:nil="true" />
<profitTotal xsi:nil="true" />
<text1 xsi:nil="true" />
<text2 xsi:nil="true" />
<projects xsi:nil="true" />
<financialAccounts xsi:nil="true" />
<interactions xsi:nil="true" />
<user xsi:nil="true" />
<notes xsi:nil="true" />
<CustomerId>0001-01-01T00:00:00.000+00:00</CustomerId>
<paymentDue xsi:nil="true" />
</salesInvoice>
</sdata:payload>
</entry>
I figured out the issue, It was an authentication problem. The provided password was wrong but still, it will be better if it throws the correct exception. Thank you.
Strange. If I use the wrong password I get the expected 401 Unauthorised response.
Scratch that. I see what you mean. It's not an error for the server but from the client side deserialiser.
Scratch that. I see what you mean. It's not an error for the server but from the client side deserialiser.
Maybe you're right. However, the issue is resolved now. Thank you.
I am trying to Create Sales Invoice but running up with the below error which is generic. Any ideas to trace this up, please?
Code:
Here the tradingAccount and the taxCode both have value.