<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: RESTful web service error (POST with json content) in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234005#M23505</link>
    <description>The service requires JSON, not XML Shong. In this case it can be supplied as a String. I have tested this out and supplying a JSON String does work. I believe that plumberg may not be selecting the correct "Output Column" in the tWriteJSONField.</description>
    <pubDate>Sun, 29 Mar 2015 15:02:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-29T15:02:03Z</dc:date>
    <item>
      <title>RESTful web service error (POST with json content)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234001#M23501</link>
      <description>I am trying to call a RESTful service which is created in ESB using tRESTRequest/ tRESTResponse. I am calling the same via tRestClient. I am not sure if the service is able to receive the request or process it. What am I doing wrong?&amp;nbsp; 
&lt;BR /&gt;Below are some screens: 
&lt;BR /&gt;Client. I am creating a json request and posting it to the service. 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDDZ.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/145502i1AA6206416711493/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDDZ.png" alt="0683p000009MDDZ.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;tRestClient config: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MD28.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151199i8268A031BC69BF59/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MD28.png" alt="0683p000009MD28.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;RESTFUL service job design. I would like to accept a json input. 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MD4D.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128414i826451D0997A01FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MD4D.png" alt="0683p000009MD4D.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Output component details: 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MD9J.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/135655i6E1BC5C79E67793E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MD9J.png" alt="0683p000009MD9J.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt; 
&lt;B&gt;&lt;U&gt;Here are the log n the output of the trestclient:&lt;/U&gt;&lt;/B&gt; 
&lt;BR /&gt;Starting job restconsumer at 15:14 27/03/2015. 
&lt;BR /&gt; connecting to socket on port 3854 
&lt;BR /&gt; connected 
&lt;BR /&gt;: net.sf.json.xml.XMLSerializer - Using default type string 
&lt;BR /&gt;: org.apache.cxf.interceptor.LoggingOutInterceptor - Outbound Message 
&lt;BR /&gt;--------------------------- 
&lt;BR /&gt;ID: 1 
&lt;BR /&gt;Address: &lt;A href="http://localhost:8088/getScore" target="_blank"&gt;http://localhost:8088/getScore&lt;/A&gt; 
&lt;BR /&gt;Http-Method: POST 
&lt;BR /&gt;Content-Type: application/json 
&lt;BR /&gt;Headers: {Content-Type=, Accept=} 
&lt;BR /&gt;-------------------------------------- 
&lt;BR /&gt;: org.apache.cxf.interceptor.LoggingInInterceptor - Inbound Message 
&lt;BR /&gt;---------------------------- 
&lt;BR /&gt;ID: 1 
&lt;BR /&gt;Response-Code: 400 
&lt;BR /&gt;Encoding: ISO-8859-1 
&lt;BR /&gt;Content-Type:&amp;nbsp; 
&lt;BR /&gt;Headers: {Content-Length=, Date=, Server=} 
&lt;BR /&gt;-------------------------------------- 
&lt;BR /&gt;400| 
&lt;BR /&gt; disconnected 
&lt;BR /&gt;Job restconsumer ended at 15:14 27/03/2015. 
&lt;BR /&gt; 
&lt;B&gt;&lt;U&gt;Log / output of restservice&lt;/U&gt;&lt;/B&gt; 
&lt;BR /&gt;Starting job Service at 15:13 27/03/2015. 
&lt;BR /&gt; connecting to socket on port 3529 
&lt;BR /&gt; connected 
&lt;BR /&gt;: org.apache.cxf.endpoint.ServerImpl - Setting the server's publish address to be &lt;A href="http://localhost:8088/" target="_blank"&gt;http://localhost:8088/&lt;/A&gt; 
&lt;BR /&gt;: org.eclipse.jetty.server.Server - jetty-8.1.15.v20140411 
&lt;BR /&gt;: org.eclipse.jetty.server.AbstractConnector - Started SelectChannelConnector@localhost:8088 
&lt;BR /&gt;: org.apache.cxf.interceptor.LoggingInInterceptor - Inbound Message 
&lt;BR /&gt;---------------------------- 
&lt;BR /&gt;ID: 1 
&lt;BR /&gt;Address: &lt;A href="http://localhost:8088/getScore" target="_blank"&gt;http://localhost:8088/getScore&lt;/A&gt; 
&lt;BR /&gt;Encoding: ISO-8859-1 
&lt;BR /&gt;Http-Method: POST 
&lt;BR /&gt;Content-Type: application/json 
&lt;BR /&gt;Headers: {Accept=, Cache-Control=, connection=, Content-Length=, content-type=, Host=, Pragma=, User-Agent=} 
&lt;BR /&gt;-------------------------------------- 
&lt;BR /&gt;: org.apache.cxf.jaxrs.provider.AbstractJAXBProvider - Message body is empty 
&lt;BR /&gt;: org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper - javax.ws.rs.BadRequestException 
&lt;BR /&gt; at org.apache.cxf.jaxrs.utils.SpecExceptions.toBadRequestException(SpecExceptions.java:82) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.utils.ExceptionUtils.toBadRequestException(ExceptionUtils.java:109) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.provider.AbstractJAXBProvider.reportEmptyContentLength(AbstractJAXBProvider.java:236) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.provider.json.JSONProvider.readFrom(JSONProvider.java:211) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.readFrom(DOM4JProvider.java:71) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.provider.dom4j.DOM4JProvider.readFrom(DOM4JProvider.java:42) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBodyReader(JAXRSUtils.java:1258) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.utils.JAXRSUtils.readFromMessageBody(JAXRSUtils.java:1205) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameter(JAXRSUtils.java:756) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.utils.JAXRSUtils.processParameters(JAXRSUtils.java:715) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:252) 
&lt;BR /&gt; at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:88) 
&lt;BR /&gt; at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) 
&lt;BR /&gt; at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) 
&lt;BR /&gt; at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:355) 
&lt;BR /&gt; at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:319) 
&lt;BR /&gt; at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:65) 
&lt;BR /&gt; at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088) 
&lt;BR /&gt; at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1024) 
&lt;BR /&gt; at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) 
&lt;BR /&gt; at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) 
&lt;BR /&gt; at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) 
&lt;BR /&gt; at org.eclipse.jetty.server.Server.handle(Server.java:370) 
&lt;BR /&gt; at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494) 
&lt;BR /&gt; at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971) 
&lt;BR /&gt; at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033) 
&lt;BR /&gt; at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) 
&lt;BR /&gt; at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 
&lt;BR /&gt; at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82) 
&lt;BR /&gt; at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696) 
&lt;BR /&gt; at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53) 
&lt;BR /&gt; at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608) 
&lt;BR /&gt; at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543) 
&lt;BR /&gt; at java.lang.Thread.run(Unknown Source) 
&lt;BR /&gt;: org.apache.cxf.interceptor.LoggingOutInterceptor - Outbound Message 
&lt;BR /&gt;--------------------------- 
&lt;BR /&gt;ID: 1 
&lt;BR /&gt;Response-Code: 400 
&lt;BR /&gt;Content-Type:&amp;nbsp; 
&lt;BR /&gt;Headers: {Date=, Content-Length=} 
&lt;BR /&gt;--------------------------------------</description>
      <pubDate>Sat, 16 Nov 2024 11:16:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234001#M23501</guid>
      <dc:creator>root</dc:creator>
      <dc:date>2024-11-16T11:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: RESTful web service error (POST with json content)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234002#M23502</link>
      <description>Hi plumberg,
&lt;BR /&gt;I suspect the issue is that you are expecting the body to be a Document. If you change the tRestRequest schema to have "body" as a String and supply the JSON as a string to the "string" output column of the tWriteJSONField component, it should work
&lt;BR /&gt;Regards
&lt;BR /&gt;Richard</description>
      <pubDate>Fri, 27 Mar 2015 20:49:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234002#M23502</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-27T20:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: RESTful web service error (POST with json content)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234003#M23503</link>
      <description>Thanks. I tried that, still no go. 
&lt;BR /&gt;I tried another method.. used a tRest component instead of tRestClient... and the request did reach the service. I am not sure what I am doing wrong with the tRestClient... Any pointers appreciated 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDEC.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152658iE04B650F41717946/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDEC.png" alt="0683p000009MDEC.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Sat, 28 Mar 2015 00:49:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234003#M23503</guid>
      <dc:creator>root</dc:creator>
      <dc:date>2015-03-28T00:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: RESTful web service error (POST with json content)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234004#M23504</link>
      <description>Hi&amp;nbsp;
&lt;BR /&gt;
&lt;PRE&gt;: org.apache.cxf.jaxrs.provider.AbstractJAXBProvider - Message body is empty&lt;/PRE&gt;
&lt;BR /&gt;tRestClient requires a Document as input request, but tWriteJsonField generates a string. You need to use a tXMLMap before tRestClient to generate a Document. In the restful webservice, use a tXMLMap after tRestRequest to extract data from the Document.
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Sun, 29 Mar 2015 03:15:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234004#M23504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-29T03:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: RESTful web service error (POST with json content)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234005#M23505</link>
      <description>The service requires JSON, not XML Shong. In this case it can be supplied as a String. I have tested this out and supplying a JSON String does work. I believe that plumberg may not be selecting the correct "Output Column" in the tWriteJSONField.</description>
      <pubDate>Sun, 29 Mar 2015 15:02:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234005#M23505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-29T15:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: RESTful web service error (POST with json content)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234006#M23506</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;The service requires JSON, not XML Shong. In this case it can be supplied as a String. I have tested this out and supplying a JSON String does work. I believe that plumberg may not be selecting the correct "Output Column" in the tWriteJSONField.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Thanks @Rhall. will recheck settings of output.</description>
      <pubDate>Sun, 29 Mar 2015 15:52:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234006#M23506</guid>
      <dc:creator>root</dc:creator>
      <dc:date>2015-03-29T15:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: RESTful web service error (POST with json content)</title>
      <link>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234007#M23507</link>
      <description>Yes, @plumberg, if you want to pass a json string to the webservice, change the data type of body column to String on tRestRequest as Rhall suggested. 
&lt;BR /&gt;BR 
&lt;BR /&gt;Shong</description>
      <pubDate>Mon, 30 Mar 2015 03:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/RESTful-web-service-error-POST-with-json-content/m-p/2234007#M23507</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-30T03:35:37Z</dc:date>
    </item>
  </channel>
</rss>

