Trestclient component to call a Microsoft Dynamics 2016 REST API

Four Stars

Trestclient component to call a Microsoft Dynamics 2016 REST API

Hi all

I want to use the Trestclient component to call a Microsoft Dynamics 2016 REST API to update through the PATCH method a search field.
The peculiarity of this operation on this type of field is that one must add @odata. Bind after the name of the field.
Reading the source JSON by the Trestclient component causes a Java error on the character @ reading:

Caused by: com. ctc. wstx. Exc. WstxUnexpectedCharException: Unexpected character ' @ ' (code 64) excepted space, or ' > ' or  "/> "

Can someone help me please.
Thank you in advance.

Moderator

Re: Trestclient component to call a Microsoft Dynamics 2016 REST API

Hello,

Would you mind posting your trestclient component setting screenshot on forum?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Trestclient component to call a Microsoft Dynamics 2016 REST API

Job screenshot

job.png

txmlmap screenshot

txmlmap.pngtrestclient screenshottresclient.pngtresclient2.png

error on job

Démarrage du job Copy_of_Chargement_ID_module_principal_patrimoine_location a 12:09 24/05/2018.

[statistics] connecting to socket on port 4070

[statistics] connected

139

[ERROR]: org.apache.cxf.jaxrs.utils.JAXRSUtils - Problem with writing the data, class org.dom4j.tree.DefaultDocument, ContentType: application/linked+json

[WARN ]: org.apache.cxf.phase.PhaseInterceptorChain - Interceptor for {http://hostSmiley Tongueort/CRM2016DEVHTTP/api/data/v8.2}tRESTClient has thrown exception, unwinding now

org.apache.cxf.interceptor.Fault: Problem with writing the data, class org.dom4j.tree.DefaultDocument, ContentType: application/linked+json

at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1192)

at org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:1230)

at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)

at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:691)

at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1050)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:897)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:866)

at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:334)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tOracleInput_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:5033)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tJava_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:3410)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tFileRowCount_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:3274)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tFileInputJSON_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:2999)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tRESTClient_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:5943)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.runJobInTOS(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:6191)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.main(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:6039)

Caused by: javax.ws.rs.ProcessingException: Problem with writing the data, class org.dom4j.tree.DefaultDocument, ContentType: application/linked+json

at org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:834)

at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:509)

at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1187)

... 14 more

Caused by: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error

at org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:79)

at org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:111)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.convertToDOM(DOM4JProvider.java:130)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.writeTo(DOM4JProvider.java:110)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.writeTo(DOM4JProvider.java:47)

at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1392)

at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:495)

... 15 more

Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '@' (code 64) excepted space, or '>' or "/>"

at [row,col {unknown-source}]: [2,115]

at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:647)

at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2996)

at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2963)

at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2839)

at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1073)

at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1367)

at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1261)

at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1189)

at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1178)

at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1151)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.convertToDOM(DOM4JProvider.java:128)

... 19 more

Exception in component tRESTClient_2 (Copy_of_Chargement_ID_module_principal_patrimoine_location)

javax.ws.rs.ProcessingException: Problem with writing the data, class org.dom4j.tree.DefaultDocument, ContentType: application/linked+json

at org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:834)

at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:509)

at org.apache.cxf.jaxrs.client.WebClient$BodyWriter.doWriteBody(WebClient.java:1187)

at org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:1230)

at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)

at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:691)

at org.apache.cxf.jaxrs.client.WebClient.doChainedInvocation(WebClient.java:1050)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:897)

at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:866)

at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:334)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tOracleInput_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:5033)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tJava_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:3410)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tFileRowCount_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:3274)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tFileInputJSON_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:2999)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.tRESTClient_1Process(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:5943)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.runJobInTOS(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:6191)

at local_project.copy_of_chargement_id_module_principal_patrimoine_location_0_1.Copy_of_Chargement_ID_module_principal_patrimoine_location.main(Copy_of_Chargement_ID_module_principal_patrimoine_location.java:6039)

Caused by: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error

at org.apache.cxf.jaxrs.utils.SpecExceptions.toInternalServerErrorException(SpecExceptions.java:79)

at org.apache.cxf.jaxrs.utils.ExceptionUtils.toInternalServerErrorException(ExceptionUtils.java:111)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.convertToDOM(DOM4JProvider.java:130)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.writeTo(DOM4JProvider.java:110)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.writeTo(DOM4JProvider.java:47)

at org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1392)

at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:495)

... 15 more

Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '@' (code 64) excepted space, or '>' or "/>"

at [row,col {unknown-source}]: [2,115]

at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:647)

at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2996)

at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2963)

at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2839)

at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1073)

at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1367)

at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:1261)

at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1189)

at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1178)

at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:1151)

at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.convertToDOM(DOM4JProvider.java:128)

... 19 more

[statistics] disconnected

 

Job Copy_of_Chargement_ID_module_principal_patrimoine_location terminé à 12:09 24/05/2018. [Code sortie=1]

 

thank you for help

Best regards

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch