Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9242

Fault handling in DIServer Interact

$
0
0

Good Day Mentors,

 

I'm currently testing out how the DIServer works.

 

Now, I am testing Fault handling with the DI Server,

and would want to know if there is a way to get multiple Errors from an DI Server Interact call.

 

My test scenario was adding 2 Sales Orders into SAP via DI Server using the Interact Call(Not BatchInteract).

The actual SOAP call sent , with comments, is as below:

<?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header>  <SessionID>5659CCC6-2E15-4664-BFA2-4E6A3BDD3E35</SessionID>   </env:Header><env:Body><dis:Add xmlns:dis="http://www.sap.com/SBO/DIS">  <Service>OrdersService</Service> <Document>  <DocType>dDocument_Items</DocType>   <DocDate>2014-05-09</DocDate>   <DocDueDate>2014-05-10</DocDueDate>   <CardCode>C23900</CardCode>   <Comments>DI Server Test - ADD</Comments> <DocumentLines><DocumentLine>  <ItemCode>A00003</ItemCode>   <Quantity>2</Quantity>   </DocumentLine><DocumentLine>  <ItemCode>TESTITTEM02</ItemCode> <!-- This Item Code Does not Exist in OEC Computer-->  <Quantity>2</Quantity>   </DocumentLine>  </DocumentLines>  </Document>  </dis:Add><dis:Add xmlns:dis="http://www.sap.com/SBO/DIS">  <Service>OrdersService</Service> <Document>  <DocType>dDocument_Service</DocType>   <DocDate>2014-05-09</DocDate>   <DocDueDate>2014-05-10</DocDueDate>   <CardCode>C20000</CardCode>   <Comments>DI Server Test - ADD</Comments> <DocumentLines><DocumentLine>  <ItemDescription>Printer Servicing</ItemDescription>   <AccountCode>499999</AccountCode> <!-- This Account Code Does not Exist in OEC Computer-->  </DocumentLine>  </DocumentLines>  </Document>  </dis:Add>  </env:Body>  </env:Envelope>

I commented the parts that should throw errors, which are the non existent ItemCode and AccountCode in 2 separate Sales Orders.

I was hoping to get a Fault Response from the DIServer which tells me that there are two error from 2 different Documents.

Basically, 2 separate error messages for the 1st Sales order(non existent Item Code) and 2nd Sales Order (Non Existent Account Code).

 

But the Fault Response I got from the DIServer was this:

<?xml version="1.0" ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code>  <env:Value>env:Receiver</env:Value> <env:Subcode>  <env:Value>-1</env:Value>   </env:Subcode>  </env:Code><env:Reason>  <env:Text xml:lang="en">Error in SOAP command 'Add'</env:Text>   </env:Reason><env:Detail>  <Command>Add</Command>   <SessionID>5659CCC6-2E15-4664-BFA2-4E6A3BDD3E35</SessionID>   </env:Detail>  </env:Fault>  </env:Body>  </env:Envelope>

The fault response only tells me that there is an error, but nothing specific to the documents. Just something specific to the actual SOAP call.

 

If I something is not clear, please do clarify with me.

 

I'm using SAP B1 9.0 PL05.

 

Thanks in advance!

Sean


Viewing all articles
Browse latest Browse all 9242

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>