on 06-24-2013 8:11 AM
Hello Experts ,
Currently Issue is with SAP Netweaver Gateway Odata Services .
I am Trying to POST the Records into Database table Using Odata Create Method, For that I am Using T-Code SE80 and creating GW Data Model and Consumption Model ,generating the Model . Later on tried to Run the Odata service URL in the REST client . I am Getting the Error message as "System expected a value for the type g" . I am Using POST Method here and the Content-type = application/atom+xml and also Using x-csrf-token .
In The Request Header, Passing the Data Record to be created in XML Format as shown below.
XML Format:
<?xml version="1.0" encoding="utf-8"?>
<atom:entry xml:base="http://host:port/sap/opu/odata/sap/ZCUSTOMER_RFC/"
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"
xmlns:sap="http://www.sap.com/Protocols/SAPData">
<atom:content >
<m:properties>
<d:empno>0000000020</d:empno>
<d:city>UK</d:city>
<d:ename>Ram</d:ename>
</m:properties>
</atom:content>
</atom:entry>
Could anyone suggest whether the Format and Procedure I am using is correct or not ? and also the reason for the error 500 Internal server error with code CX_ST_MATCH_TYPE and Message "System expected a value for the type g".
Appreciate your Help.
Thanks,
Uday.
Hi Uday,
This error comes only when your "POST" body is improper.
I would suggest you to do "GET" operation on any record and check whether your "POST" body matches with it else change the body accordingly.
thanks & regards,
Shivakishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi guys,
I know that's an old thread but I just reached same error and the solution in my case was the missing type on atom content. After change add it worked.
<atom:content type="application/xml">
Regards, Fernando D aRós
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi uday,
I would suggest you to use rest client which comes along with the netweaver gateway
In netweaver gateway use t-code /iwfnd/gw_client
Also for post request, you have to add a new header and it has to be X-Requested-With:XMLHttpRequest
Let me know if you are still facing any problems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Firefox RestClient is the one I had used.
For POST please see the steps below:
Get the response:
Copy the token from the response and replace it with the "fetch".
Change GET -> PUT
Copy the response body and paste it to the request body with modifications ( added data to be updated to the SAP ).
Hope that helps.
Message was edited by: Midhun VP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Uday,
Navigate to /iwfnd/maint_services at netweaver gateway, then select the service and click on error log, it will provide you the detail information about the 500 internal server.
whear as what I think is it could be a data type mismatch issue, Please check the schema by looking into the metadata url
are you using some rest client to test the service? if so which one?
Regards,
Srinivas Divakarla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.