2 Replies Latest reply on Dec 3, 2009 5:10 PM by marcelcasado

    Accessing WSDL from an CXF NMR endpoint

    marcelcasado

      Hi,

       

      I have a CXF web service deployed with an NMR endpoint. I also have a camel route with a jetty endpoint to expose the NMR CXF endpoint. Is there a way to get the WSDL for my service (https://localhost:8084/services/thresholds?wsdl) ? I'm actually getting an exception :

       

      org.apache.servicemix.nmr.api.ServiceMixException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Source object passed to '''' has no contents.      at org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:120)      at org.apache.servicemix.nmr.core.InternalEndpointWrapper.process(InternalEndpointWrapper.java:86)      at org.apache.servicemix.nmr.core.ChannelImpl.process(ChannelImpl.java:255)      at org.apache.servicemix.nmr.core.ChannelImpl$1.run(ChannelImpl.java:215)      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)      at java.lang.Thread.run(Thread.java:637) Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: Source object passed to '''' has no contents.

           at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:756)

           at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:349)

           at org.apache.servicemix.cxf.transport.nmr.NMRMessageHelper.convertMessageToInputStream(NMRMessageHelper.java:51)

           at org.apache.servicemix.cxf.transport.nmr.NMRDestination.process(NMRDestination.java:113)

           ... 6 more

      Caused by: javax.xml.transform.TransformerException: Source object passed to '''' has no contents.

           at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:704)

           at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:744)

           ... 9 more

       

      My camel route :

       

      <camel:route>

                     <camel:from ref="serverURL" />               

                     <camel:choice>

                          <camel:when>

                           <camel:simple>in.header.wsdl</camel:simple>

                           <camel:setHeader headerName="CamelHttpMethod">

                          <camel:constant>GET</camel:constant>

                        </camel:setHeader>

                         

                        <camel:convertBodyTo type="org.apache.camel.converter.jaxp.StringSource" />

                          <!-- <camel:to

                                    uri="nmr:DecisionService" /> -->

                            <camel:to

                                    uri="nmr:wcs1.1" />

                                     

                          </camel:when>

                          <camel:otherwise>

                             <camel:to uri="direct:processRequest"/>

                          </camel:otherwise>

                     </camel:choice>

                </camel:route>

       

       

      Thanks in advance,

       

      -Marcel

        • 1. Re: Accessing WSDL from an CXF NMR endpoint
          joe.luo

          The error message is quite similar as this post.

           

          Try to use StreamSource to convert the body to see if it works for you.

          • 2. Re: Accessing WSDL from an CXF NMR endpoint
            marcelcasado

            Thanks Joe for your suggestion but I tried that before but did not work. I believe the problem is that when requesting the WSDL we are doing a GET request with an empty payload so here the exception. But I believe even I get pass this exception the "nmr" processor is not aware  I'm requesting the service WSDL anymore.

             

            Could anybody tell me what is the mechanism that CXF uses to detect the WSDL request and how generates the WSDL on the fly ?

             

            Thanks,

             

            -Marcel