Skip to Content
avatar image
Former Member

oData adapter POST missing fields in payload

Hello,
Having an issue with oData adapter.
Please see description below.
'Ive been working on this for days now to no avail!
Please help!

Overview-
-
Attempting to consume an odata service in C4C using SAP PI oData adapter.
Purpose is to create a service ticket complete with service line items.

-When testing the odata service using postman the service ticket is created as expected.
URL:
POST https://my317343.crm.ondemand.com/sap/c4c/odata/cust/v1/ticket_from_ecc/ServiceRequestCollection

Payload: { 
"ZFLDAPPCODE": "S", 
"ProcessingTypeCode": "ZSRQ", 
"ObjectID": "1", 
"Name": "Test Description 0003208617", 
"ServiceRequestItem": [  { 
"ProductID": "176000988"  },  { 
"ProductID": "176001171"  }  ]  }

Versions
PI version is 7.5 sp06
Adapter version in sp02 patch 22

Background
Message for message mapping was generated from an XSD that was created from eclipse odata modeler.
The resulting XML from mapping seems correct based on converting the above json to xml.

<?xml version="1.0"
encoding="UTF-8"?><ServiceRequestCollection>  <ServiceRequest> 
<ProcessingTypeCode>ZSRQ</ProcessingTypeCode>  <PartyID>0000212802</PartyID>  <Name>Test Description
0003208617</Name>  <ServiceRequestItem>  <ServiceRequestItem>  <DailyRate> 
<currencyCode>usd</currencyCode>  </DailyRate> 
<ProductID>176000988</ProductID>  <NetPriceBaseQuantity> 
<unitCode>EA</unitCode>  <content>2</content>  </NetPriceBaseQuantity>  <NetPriceAmount> 
<content>10</content> 
<currencyCode>USD</currencyCode>  </NetPriceAmount>  <NetAmount> 
<content>10</content> 
<currencyCode>usd</currencyCode>  </NetAmount>  <Description> 
<content>desc</content> 
<languageCode>en</languageCode>  </Description>  </ServiceRequestItem>  </ServiceRequestItem>  </ServiceRequest></ServiceRequestCollection>


Issue
When the request is sent from odata adapter it does not include the service items array in the payload. Only the higher level fields.
This was discovered using XPI inspector.
HTTP_CLIENT : 273 REQUEST:

<?xml version="1.0" encoding="utf-8"?><entry 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" xml:base="https://my317343.crm.ondemand.com/sap/c4c/odata/cust/v1/ticket_from_ecc/"><content type="application/xml"><m:properties><d:Name>Test Description 0003208617</d:Name><d:PartyID>0000212802</d:PartyID><d:ProcessingTypeCode>ZSRQ</d:ProcessingTypeCode></m:properties></content></entry>

Also seem to be getting an adapter error as well

10:41:27:665 System.err [Fatal Error] :1:1: Content is not allowed in prolog. 10:41:27:668 ~processor.OsciOdataRequestProcessor parseErrorResponse(): failed with error, message = Content is not allowed in prolog.
[EXCEPTION]
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:129)
at com.sap.aii.adapter.lib.component.odata.processor.OsciOdataRequestProcessor.parseErrorResponse(OsciOdataRequestProcessor.java:2309)
at com.sap.aii.adapter.lib.component.odata.processor.OsciOdataRequestProcessor.createEntity(OsciOdataRequestProcessor.java:1018)
at com.sap.aii.adapter.lib.component.odata.runtime.ODataClientProducer.process(ODataClientProducer.java:209)
at com.sap.aii.adapter.picao.service.ODataRequestProcessorService.processRequest(ODataRequestProcessorService.java:138)
at com.sap.aii.adapter.odata.ra.xi.api.ODataAPICaller.processRequest(ODataAPICaller.java:207)
at com.sap.aii.adapter.odata.ra.xi.api.ODataAPICaller.processRequest(ODataAPICaller.java:259)
at com.sap.aii.adapter.odata.ra.xi.jca.CCIInteraction.sendMessageToODataSource(CCIInteraction.java:437)
at com.sap.aii.adapter.odata.ra.xi.jca.CCIInteraction.send(CCIInteraction.java:337)
at com.sap.aii.adapter.odata.ra.xi.jca.CCIInteraction.execute(CCIInteraction.java:276)
at com.sap.aii.af.app.endpoint.ModuleProcessorExitBean.process(ModuleProcessorExitBean.java:206)
at sun.reflect.GeneratedMethodAccessor1038.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:172)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:99)
at com.sun.proxy.$Proxy355.process(Unknown Source)
at com.sap.aii.af.app.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:271)
at sun.reflect.GeneratedMethodAccessor483.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:172)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:99)
at com.sun.proxy.$Proxy408.process(Unknown Source)
at com.sap.aii.af.app.listener.AFWListenerBean.onMessage(AFWListenerBean.java:431)
at sun.reflect.GeneratedMethodAccessor505.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.sap.engine.services.ejb3.runtime.impl.RequestInvocationContext.proceedFinal(RequestInvocationContext.java:47)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:166)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatesTransition.invoke(Interceptors_StatesTransition.java:19)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Resource.invoke(Interceptors_Resource.java:50)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.doWorkWithAttribute(Interceptors_Transaction.java:37)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_Transaction.invoke(Interceptors_Transaction.java:21)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_MethodRetry.invoke(Interceptors_MethodRetry.java:46)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:191)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_StatelessInstanceGetter.invoke(Interceptors_StatelessInstanceGetter.java:23)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_SecurityCheck.invoke(Interceptors_SecurityCheck.java:25)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.Interceptors_ExceptionTracer.invoke(Interceptors_ExceptionTracer.java:17)
at com.sap.engine.services.ejb3.runtime.impl.AbstractInvocationContext.proceed(AbstractInvocationContext.java:179)
at com.sap.engine.services.ejb3.runtime.impl.DefaultInvocationChainsManager.startChain(DefaultInvocationChainsManager.java:138)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:172)
at com.sap.engine.services.ejb3.runtime.impl.DefaultEJBProxyInvocationHandler.invoke(DefaultEJBProxyInvocationHandler.java:99)
at com.sun.proxy.$Proxy419.onMessage(Unknown Source)
at com.sap.engine.messaging.impl.spi.ServicesImpl.deliver(ServicesImpl.java:361)
at com.sap.aii.adapter.xi.ms.XIEventHandler$TRPProcessingBlock.process(XIEventHandler.java:1850)
at com.sap.engine.messaging.impl.spi.stage.ProcessorImpl.processBlock(ProcessorImpl.java:196)
at com.sap.engine.messaging.impl.spi.stage.ProcessorImpl.proceedToProcessingBlock(ProcessorImpl.java:103)
at com.sap.engine.messaging.impl.spi.stage.ProcessorImpl.processMessage(ProcessorImpl.java:74)
at com.sap.aii.adapter.xi.ms.processor.ScenarioConfigurableProcessor.processMessage(ScenarioConfigurableProcessor.java:52)
at com.sap.aii.adapter.xi.ms.XIEventHandler.onTransmit(XIEventHandler.java:471)
at com.sap.engine.messaging.impl.core.queue.consumer.SendConsumer.processMessage(SendConsumer.java:537)
at com.sap.engine.messaging.impl.core.queue.consumer.SendConsumer.onMessage(SendConsumer.java:110)
at com.sap.engine.messaging.impl.core.queue.Queue.run(Queue.java:1109)
at com.sap.engine.messaging.runtime.MSWorkWrapper.run(MSWorkWrapper.java:58)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:185)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:302)


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 12, 2017 at 02:09 PM

    Any ideas?
    Should I add more info?
    Thank You!

    Add comment
    10|10000 characters needed characters exceeded