<?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: XML declaration for RESTful services using javax.xml.ws.Provider in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289556#M62928</link>
    <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hi &lt;BR /&gt;Do you call the rest webservice in browser or in Talend Studio with ESB component? If I call a rest webservice with tRestClient or tRest component, I can see the XML declaration in the response. &lt;BR /&gt;Shong&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Shong, which example service is this? Which folder? I have ESB 5.2.2</description>
    <pubDate>Tue, 23 Apr 2013 20:10:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2013-04-23T20:10:46Z</dc:date>
    <item>
      <title>XML declaration for RESTful services using javax.xml.ws.Provider</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289551#M62923</link>
      <description>I built a few RESTful webservices using this example: 
&lt;BR /&gt;/examples/apache/cxf/restful_dispatch 
&lt;BR /&gt;which uses javax.xml.ws.Provider. 
&lt;BR /&gt;They work great. 
&lt;BR /&gt;The only glitch is now one client wants to see the XML declaration in the response XML. 
&lt;BR /&gt;They are claiming the XML is not valid without the declaration. 
&lt;BR /&gt;Even though they are wrong, and its valid, I am still curious if I can somehow get the declaration to show up? 
&lt;BR /&gt;So my service looks like: 
&lt;BR /&gt; 
&lt;PRE&gt;@WebServiceProvider()&lt;BR /&gt;@ServiceMode(value = Service.Mode.PAYLOAD)&lt;BR /&gt;public class RestSourcePayloadProvider implements Provider&amp;lt;DOMSource&amp;gt; {&lt;BR /&gt;  public DOMSource invoke(DOMSource request) {&lt;BR /&gt;        &lt;BR /&gt;        if (httpMethod.equalsIgnoreCase("POST")) {&lt;BR /&gt;            if (path.equals("/cxf/"+PATH+"/contract/search")) {&lt;BR /&gt;                System.out.println("---Invoking searchContracts---");&lt;BR /&gt;            &lt;BR /&gt;                return searchContracts(request);&lt;BR /&gt;            }&lt;BR /&gt;        }&lt;BR /&gt;  }&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;The searchContracts method in the example above returns a DOMSource object, which definitely has the XML declaration in it. Yet it gets stripped out. 
&lt;BR /&gt;I think this is because this service is kind've a "hack" to run a RESTful service on top of SOAP frameworks? And since SOAP thinks the xml encoding should be sent as headers, or maybe in the HEAD part of the SOAP response, the framework strips it out of the BODY. 
&lt;BR /&gt;Can Talend introduce a way to turn this stripping action off? 
&lt;BR /&gt;If you just build and run the restful_dispatch example, you will see what I mean. 
&lt;BR /&gt;This example just grabs a static xml file for the response: 
&lt;BR /&gt;for example, the test link, 
&lt;BR /&gt;&lt;A href="http://localhost:9000/customerservice/customer?id=1234" target="_blank"&gt;http://localhost:9000/customerservice/customer?id=1234&lt;/A&gt; 
&lt;BR /&gt;makes the service return the CustomJohnResp.xml file, which looks like: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;BR /&gt;&amp;lt;Customer&amp;gt;&lt;BR /&gt;  &amp;lt;name&amp;gt;John&amp;lt;/name&amp;gt;&lt;BR /&gt;  &amp;lt;id&amp;gt;123456&amp;lt;/id&amp;gt;&lt;BR /&gt;&amp;lt;/Customer&amp;gt;&lt;/PRE&gt; 
&lt;BR /&gt;But the service returns: 
&lt;BR /&gt; 
&lt;PRE&gt;&amp;lt;Customer&amp;gt;&lt;BR /&gt;  &amp;lt;name&amp;gt;John&amp;lt;/name&amp;gt;&lt;BR /&gt;  &amp;lt;id&amp;gt;123456&amp;lt;/id&amp;gt;&lt;BR /&gt;&amp;lt;/Customer&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 12:03:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289551#M62923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: XML declaration for RESTful services using javax.xml.ws.Provider</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289552#M62924</link>
      <description>Hi 
&lt;BR /&gt;Do you call the rest webservice in browser or in Talend Studio with ESB component? If I call a rest webservice with tRestClient or tRest component, I can see the XML declaration in the response. 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEKl.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/127888iD7FE0EFA6B205544/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEKl.png" alt="0683p000009MEKl.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 18 Apr 2013 03:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289552#M62924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-18T03:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: XML declaration for RESTful services using javax.xml.ws.Provider</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289553#M62925</link>
      <description>Which web service are you calling? 
&lt;BR /&gt;Is it the web service from my example above? 
&lt;BR /&gt;/examples/apache/cxf/restful_dispatch 
&lt;BR /&gt;Many other of the RESTful examples do have the xml declaration in the response. 
&lt;BR /&gt;But this one doesn't 
&lt;BR /&gt;And I just found out this morning that PeopleSoft will not process the response unless the declaration is there. 
&lt;BR /&gt;So I either need a way to fix this, 
&lt;BR /&gt;Or I have to rewrite the webservice to use something other than javax.xml.ws.Provider</description>
      <pubDate>Thu, 18 Apr 2013 14:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289553#M62925</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-18T14:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: XML declaration for RESTful services using javax.xml.ws.Provider</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289554#M62926</link>
      <description>Could this problem be cause by this?
&lt;BR /&gt;
&lt;A href="http://docs.oracle.com/javaee/5/api/javax/xml/soap/SOAPMessage.html#WRITE_XML_DECLARATION" rel="nofollow noopener noreferrer"&gt;http://docs.oracle.com/javaee/5/api/javax/xml/soap/SOAPMessage.html#WRITE_XML_DECLARATION&lt;/A&gt;
&lt;BR /&gt;Basically, the WRITE_XML_DECLARATION var of the javax.xml.soap.SOAPMessage object default value is "false"
&lt;BR /&gt;I there a way via CXF to set this to "true" for my service?
&lt;BR /&gt;Or is this a red-herring?</description>
      <pubDate>Fri, 19 Apr 2013 01:55:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289554#M62926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-19T01:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: XML declaration for RESTful services using javax.xml.ws.Provider</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289555#M62927</link>
      <description>I wrote two test REST services that do simple greetings in xml. One uses blueprint to create the HTTP endpoint. The other uses a bundle Activator class. I can't get either one to print the xml declaration at the top of the response xml. I tried using an Inteceptor to do it but it doesn't seem to be getting triggered.
&lt;BR /&gt;Anyway, I'm hoping there is a simple way to do this but just need some help or an example.
&lt;BR /&gt;I'm willing to put both example here but there doesn't seem to be any activity on this forum.
&lt;BR /&gt;Is there an IRS channel or somewhere else to ask developer questions and get help?
&lt;BR /&gt;miles</description>
      <pubDate>Tue, 23 Apr 2013 15:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289555#M62927</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-23T15:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: XML declaration for RESTful services using javax.xml.ws.Provider</title>
      <link>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289556#M62928</link>
      <description>&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;Hi &lt;BR /&gt;Do you call the rest webservice in browser or in Talend Studio with ESB component? If I call a rest webservice with tRestClient or tRest component, I can see the XML declaration in the response. &lt;BR /&gt;Shong&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Shong, which example service is this? Which folder? I have ESB 5.2.2</description>
      <pubDate>Tue, 23 Apr 2013 20:10:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/XML-declaration-for-RESTful-services-using-javax-xml-ws-Provider/m-p/2289556#M62928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-23T20:10:46Z</dc:date>
    </item>
  </channel>
</rss>

