Step 1: XML Binding Wizard
Using the following XML document containing a sample of the order details, you should create a new project and create the appropriate bindings for an inbound service that will be loaded onto the server and used by the code. In the code example below, the name of the service used to process the inbound orders is called inboundorder so the solution name in the XML Binding Wizard should also be called inboundorder.
The sample XML document to use is based on the order.xml document that is found by default in the JSM Instance folder of your installation. The contents of the document are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<Orders>
<SalesOrder SONumber="12345">
<Customer CustNumber="543">
<CustName>ABC Industries</CustName>
<Street>123 Main St.</Street>
<City>Chicago</City>
<State>IL</State>
<PostCode>60609</PostCode>
</Customer>
<OrderDate>981215</OrderDate>
<Line LineNumber="1">
<Part PartNumber="123">
<Description>Gasket Paper</Description>
<Price>9.95</Price>
</Part>
<Quantity>10</Quantity>
</Line>
<Line LineNumber="2">
<Part PartNumber="456">
<Description><![CDATA[Gasket <Polymer> Glue]]></Description>
<Price>13.27</Price>
</Part>
<Quantity>5</Quantity>
</Line>
</SalesOrder>
</Orders>
You will need to set up your bindings as demonstrated in this screen shot.
The bindings also need to be set up for the response to the customer. The following is the sample XML document used for the response.
<?xml version="1.0" encoding="UTF-8"?>
<OrderResponse>
<ResponseComments>
<Comment>This is confirm that we have received you order</Comment>
<Comment>Your order number was 12345</Comment>
<Comment>Your order has been successfully processed</Comment>
<Comment>Your order details are as follow.</Comment>
</ResponseComments>
<SalesOrder SONumber="12345">
<Customer CustNumber="543">
<CustName>ABC Industries</CustName>
<Street>123 Main St.</Street>
<City>Chicago</City>
<State>IL</State>
<PostCode>60609</PostCode>
</Customer>
<OrderDate>981215</OrderDate>
<Line LineNumber="1">
<Part PartNumber="123">
<Description>Gasket Paper</Description>
<Price>9.95</Price>
</Part>
<Quantity>10</Quantity>
<Status>Succesfully processed</Status>
</Line>
<Line LineNumber="2">
<Part PartNumber="456">
<Description><![CDATA[Gasket <Polymer> Glue]]></Description>
<Price>13.27</Price>
</Part>
<Quantity>5</Quantity>
<Status>Unsuccesfully processed - invalid part number</Status>
</Line>
</SalesOrder>
</OrderResponse>
In the code example, the name of the service used to process the outbound responses is called outboundresponse so the solution name in the XML Binding Wizard should also be called outboundresponse.
The XML bindings should be mapped as follows: