locked
OData post - malformed syntax error RRS feed

  • Question

  • Hi,

    I'm using SAP Gateway for Microsoft to perform CRUD operations. Read operation is working fine, whereas i got an error during post(create) / put(update). how to rectify the below error.

    Error: <?xml version="1.0" encoding="utf-8"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code>/IWCOR/CX_DS_BAD_REQUEST/005056A509B11ED1B9BF94F386DD82E6</code><message xml:lang="en">The Data Services Request could not be understood due to malformed syntax</message><innererror><transactionid>E5D602E617DFF1F98162005056BE704A</transactionid><errordetails/></innererror></error>

            public static Customer AddCustomerDetailGW(Customer cust)
            {
                ApplicationConfigReader.ConfigFilePath = new Uri(System.Reflection.Assembly.GetExecutingAssembly().CodeBase).LocalPath;
                ServiceDetails serviceDetail = ConfigurationReaderHandler.Instance.GetServiceDetails("ZCUSTOMER_DETAILS_SRV");
                ZCUSTOMER_DETAILS_SRV.ZCUSTOMER_DETAILS_SRV serviceContext = new ZCUSTOMER_DETAILS_SRV.ZCUSTOMER_DETAILS_SRV(new Uri(serviceDetail.Url));            
                //serviceContext.AddAndUpdateResponsePreference = DataServiceResponsePreference.IncludeContent;
                serviceContext.AddToCustomerSet(cust);
                //serviceContext.AddObject("CustomerSet", cust);
                DataServiceResponse response = serviceContext.SaveChanges();//*****error*****
                Console.WriteLine(response.ToString());
                
                return cust;
            }

    Anandhan.S Remember to 'mark or propose as answer' or 'vote as helpful' as appropriate.

    Friday, April 15, 2016 7:44 AM

All replies

  • https://social.msdn.microsoft.com/Forums/en-US/home?forum=adodotnetdataservices
    Sunday, April 17, 2016 1:47 AM
  • hi anandhan

    how did you resolve the issue. i am facing a similiar problem albeit i am try to call sap from mule api

    regards

    sachin

    Thursday, June 9, 2016 2:42 PM