on 01-14-2017 12:18 PM
Hi Everybody,
Below is the input structure coming from web service and i need to parse this to a well formed XML structure including <pBigTxt> which has Order as an header node with 1 to 1 occurrence which has attributes/fields and Line as item node with 0 to unbounded which has attributes/fields.
Input Structure :
<?xml version="1.0" encoding="UTF-8"?>
<CreateOrder>
<pDynamicsID>38</pDynamicsID>
<pCustomerNo>300696</pCustomerNo>
<pBigTxt>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Order OrderID="1125153" CustomerID="PP20101CMUNIEN" UserID="WC10562" DateCreated="20170111" DealerOrderNumber="1125153_TEST" OrderTypeID="021" ShipmentMethodID="Z2" Surcharge="0" Discount="0" SubTotal="356.49" VAT="49.9086" Total="406.3986">
<Line LineID="1" ItemID="0095031" Qty="2.00" DealerUnitCost="0.0000" LineDiscount="0.0000" LineAmount="0.0000" />
<Line LineID="2" ItemID="0095314" Qty="3.00" DealerUnitCost="0.0000" LineDiscount="0.0000" LineAmount="0.0000" />
<Line LineID="3" ItemID="21825666" Qty="4" DealerUnitCost="0" LineDiscount="0" LineAmount="0" />
</Order>
</pBigTxt>
</CreateOrder>
Expected Output Structure:
<?xml version="1.0" encoding="UTF-8"?>
<CreateOrder>
<pDynamicsID>38</pDynamicsID>
<pCustomerNo>300696</pCustomerNo>
<pBigTxt>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Order
OrderID="1125153"
CustomerID="PP20101CMUNIEN"
UserID="WC10562"
DateCreated="20170111"
DealerOrderNumber="1125153_TEST"
OrderTypeID="021"
ShipmentMethodID="Z2"
Surcharge="0"
Discount="0"
SubTotal="356.49"
VAT="49.9086"
Total="406.3986">
<Line
LineID="1"
ItemID="0095031"
Qty="2.00"
DealerUnitCost="0.0000"
LineDiscount="0.0000"
LineAmount="0.0000" />
<Line
LineID="2"
ItemID="0095314"
Qty="3.00"
DealerUnitCost="0.0000"
LineDiscount="0.0000"
LineAmount="0.0000" />
<Line
LineID="3"
ItemID="21825666"
Qty="4"
DealerUnitCost="0"
LineDiscount="0"
LineAmount="0" />
</Order>
</pBigTxt>
</CreateOrder>
I have decided to map the output of well formed XML to a intermediate structure and finally mapping to BAPI to create sales order.I tried to parse input message using Java map however facing difficulties.Any suggestions will highly appreciated.
Thanks
Pavan
Issue resolved.Problem with the input data tags which has additional ns0: receiving from the web service.
Cheers
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i dont need pBigTxt .Could not update the thread due to some issues hence posting as a separate comment
<?xml version="1.0" encoding="UTF-8"?>
<CreateOrder>
<pDynamicsID>38</pDynamicsID>
<pCustomerNo>300696</pCustomerNo>
<Order
OrderID="1125153"
CustomerID="PP20101CMUNIEN"
UserID="WC10562"
DateCreated="20170111"
DealerOrderNumber="1125153_TEST"
OrderTypeID="021"
ShipmentMethodID="Z2"
Surcharge="0"
Discount="0"
SubTotal="356.49"
VAT="49.9086"
Total="406.3986">
<Line
LineID="1"
ItemID="0095031"
Qty="2.00"
DealerUnitCost="0.0000"
LineDiscount="0.0000"
LineAmount="0.0000" />
<Line
LineID="2"
ItemID="0095314"
Qty="3.00"
DealerUnitCost="0.0000"
LineDiscount="0.0000"
LineAmount="0.0000" />
<Line
LineID="3"
ItemID="21825666"
Qty="4"
DealerUnitCost="0"
LineDiscount="0"
LineAmount="0" />
</Order>
</CreateOrder>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.