on 10-15-2015 2:28 AM
Hello Experts,
For a customer project, we have to implement a Sales Order Creation in OData. I created a Gateway project based on the BAPI_SALESORDER_CREATE2. I created the 3 entities I need (Header, Item and Partner).
I tested the BAPI with my data and everything is fine.
Now I tried to test it through the GW_CLIENT.
I got already a lot of errors that I was able to correct with SCN messages (thanks a lot !) but now I have a 'Error while parsing an XML stream: 'BOM / charset detection failed'.
I understood something is wrong with my XML file but the "Check XML" is ok and I have no idea what can be wrong in my simple XML test file !
Any help is appreciated.
Here is the file:
<?xml version="1.0" encoding="UTF-8"?>
<entry xml:base="http://xx/sap/opu/odata/sap/Z_SALESORDER_CREATE2_SRV/" xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/OrderSalesHeader" type="application/atom+xml;type=feed" title="Z_SALESORDER_CREATE2_SRV.OrderSalesHeader">
<m:inline>
<feed>
<entry>
<content type="application/xml">
<m:properties>
<d:DocType>TA</d:DocType>
<d:SalesOrg>1100</d:SalesOrg>
<d:DistrChan>01</d:DistrChan>
<d:Division>01</d:Division>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeaderItem" type="application/atom+xml;type=feed" title="Z_SALESORDER_CREATE2_SRV.HeaderToItem">
<m:inline>
<feed>
<entry>
<content type="application/xml">
<m:properties>
<d:Material>AIGL0232</d:Material>
<d:TargetQu>100</d:TargetQu>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeaderPartner" type="application/atom+xml;type=feed" title="Z_SALESORDER_CREATE2_SRV.HeaderToPartner">
<m:inline>
<feed>
<entry>
<content type="application/xml">
<m:properties>
<d:PartnRole>SP</d:PartnRole>
<d:PartnNumb>YOU001</d:PartnNumb>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
</entry>
Thanks,
Luc
Hi Luc,
Could you please try and test with below payload
<?xml version="1.0" encoding="UTF-8"?>
<atom:entry
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<atom:content type="application/xml">
<m:properties>
<d:DocType>TA</d:DocType>
<d:SalesOrg>1100</d:SalesOrg>
<d:DistrChan>01</d:DistrChan>
<d:Division>01</d:Division>
</m:properties>
</atom:content>
<atom:link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeaderItem"
type="application/atom+xml;type=feed"
title="Z_SALESORDER_CREATE2_SRV.HeaderToItem">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:Material>AIGL0232</d:Material>
<d:TargetQu>100</d:TargetQu>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
<atom:link
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/HeaderPartner"
type="application/atom+xml;type=feed"
title="Z_SALESORDER_CREATE2_SRV.HeaderToPartner">
<m:inline>
<atom:feed>
<atom:entry>
<atom:content type="application/xml">
<m:properties>
<d:PartnRole>SP</d:PartnRole>
<d:PartnNumb>YOU001</d:PartnNumb>
</m:properties>
</atom:content>
</atom:entry>
</atom:feed>
</m:inline>
</atom:link>
</atom:entry>
Thanks,
Syam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luc,
Is it Get call is working fine..
Can you try posting same XML format which you receive on calling get operation.
It looks like some thing missing in XML.
Regards
Vivek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Luc,
What are the headers you passed for the xml payload ?
Meanwhile can you try with the below JSON Payload ?
Pass below headers only :
x-csrf-token : XXXXXXXXXXX
Content-Type : application/json
Method : POST
{
"DocType":"TA",
"SalesOrg":"1100",
"DistrChan":"01",
"Division":"01",
"HeaderItem":[{"Material":"AIGL0232","TargetQu":"100"}],
"HeaderPartner":[{"PartnRole":"SP","PartnNumb":"YOU001"}]
}
Regards,
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ashwin,
In the header I have only the X-CSRF-Token.
When I try I get an error 400 :
System expected the element '{http://www.w3.org/2005/Atom}entry'
I feel my header is not complete, I will investigate.
Thanks a lot, I wanted to try with json but was not sure about the syntax !
Luc
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.