Accueil > Apache CXF, JAX-WS > JAX-WS with Apache CXF and Eclipse [step2]

JAX-WS with Apache CXF and Eclipse [step2]


In [step1], we have configured CXF Eclipse Plugin to use CXF 2.4.2 and created an empty Dynamic Web project with Tomcat 7.

In this article we will create a sample Java class HelloServiceImpl and publish it as WebService by using CXF Eclipse wizard. Basicly, this wizard will :

Download

You can download jaxwswithcxf_step2.zip which is a zip which contains the Dynamic Web Project jaxwswithcxf with the HelloWorldImpl WebServices explained in this article.

Create Class HelloServiceImpl

Create in the jaxwswithcxf Dynamic Web Project the class org.sample.ws.HelloServiceImpl like this :

package org.sample.ws;

public class HelloServiceImpl {

	public String getVersion() {
		return "1.0";
	}

	public String hello(String user) {
		return "Hello " + user + "!";
	}
}

Create WebService HelloServiceImpl

Web services can be created using two methods:

  • top-down development : Top-down Web services development involves creating a Web service from a WSDL file. WSDL file describes the services (methods, parameters) and defines the contract for the WebService. This WSDL file can also be used to generate the consumer of the WebService (which can be different technolgy (PHP, .Net, etc) than the WebService).
  • bottom-up development : Bottom-up Web services development involves creating a Web service from a Java bean or enterprise bean.

In our case we will use bottom-up development : we will use HelloServiceImpl Java class to create the Web Service.

step1 : select Java class

Select HelloServiceImpl and click on the right mouse button to click on the Web Services/Create Web Service menu item :

step2 : select CXF runtime

This action opens the generic Wizard Web Service to generate WebService with Axis, Axis2, CXF, etc :

In our case we want to generate CXF code. To do that, click on Web service runtime: Apache Axis, the Service Deployment Configuration opens. Select Apache CXF 2.x for Web service runtime :

Click on OK button to close the Service Deployment Configuration dialog :

You can notice that Web service runtime is Apache CXF 2.x. By default the Start service is selected which means as soon as wizard is finished, the server will start. I prefer to start my server manually, so I use Install Service to avoid launching the server at the end of the wizard :

step3 : Starting Point Configuration

Click on Next button, the Starting Point Configuration wizard page displays. This page is used to generate an interface (for the HelloServiceImpl) annoted with JAX-WS annotation. In our case we change nothing and HelloServiceImpl will contain the JAX-WS annotation :

step4 : Web Service JAX-WS Annotations Configuration

Click on Next button, the Web Service JAX-WS Annotations Configuration wizard page displays. This page provides several checkbox that you can select/unselect to generate JAX-WS annotation. You can preview the generated code on the bottom of this page. In our case we don’t change the pre-defined values. We will play with those checkbox in a next article :

step5 : Web Service Java2WS Configuration

Click on Next button, the Web Service Java2WS Configuration wizard page displays. This wizard page provides some checkbox to select that you wish generate :

  • Generate client generate simple client with JAX-WS Service.create()
  • Generate server generate simple server of the WebService. This code starts a server (with Embedding Jetty) and publish the WebService by using JAX-WS Endpoint#publish.
  • Generate Wrapper and Fault Beans generate Java class with JAXB annotation. Those classes are generated in the *.jaxws package (in our case org.sample.ws.jaxws). We will see the use of those classes in the next articles.
  • Generate WSDL generate WSDL of the WebService.
    • WSDL file : name of the WSDL file to generate.
    • Default SOAP binding.
    • Generate seperate XSD for the types : if this option is selected, the generated WSDL file will not contain the XML Schema which declares the type of the structure used in the method parameters.

step6 : Web Service Publication

Click on Next button, the Web Service Publication wizard page displays :

Click on Finish button to generate JAX-WS WebService and CXF component (Spring beans and web.xml).

Result of CXF Wizard

After finishing the generation of the CXF wizard, your workspace looks like this :

The wizard generate several things :

  • [1] HelloServiceImpl : modify the Java class HelloServiceImpl with JAX-WS annotation :
    package org.sample.ws;
    
    import javax.jws.WebService;
    
    @WebService(targetNamespace = "http://ws.sample.org/", portName = "HelloServiceImplPort", serviceName = "HelloServiceImplService")
    public class HelloServiceImpl {
    
    	public String getVersion() {
    		return "1.0";
    	}
    
    	public String hello(String user) {
    		return "Hello " + user + "!";
    	}
    }

    The JAX-WS javax.jws.WebService annotation is used to indicate that this class is a WebService.

  • [2] generate some classes in the org.sample.ws.jaxws package. Those classes are generated because the Generate Wrapper and Fault Beans of the page Web Service Java2WS Configuration was checked. At this step, those classes are not used.
  • [3] CXF librarires. If you open this item you will see that the wizard use the whole JAR of the CXF distribution :

    Don’t be afraid of the amount of JARs, CXF needs few JARs.

  • [4] beans.xml : this Spring file is used to declare with Spring bean the Java class HelloServiceImpl which must be published as WebService :
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
    	<import resource="classpath:META-INF/cxf/cxf.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    	<jaxws:endpoint xmlns:tns="http://ws.sample.org/" id="helloservice"
    		implementor="org.sample.ws.HelloServiceImpl" wsdlLocation="wsdl/helloserviceimpl.wsdl"
    		endpointName="tns:HelloServiceImplPort" serviceName="tns:HelloServiceImplService"
    		address="/HelloServiceImplPort">
    		<jaxws:features>
    			<bean class="org.apache.cxf.feature.LoggingFeature" />
    		</jaxws:features>
    	</jaxws:endpoint>
    </beans>
    • the following declaration :
      <jaxws:endpoint ... implementor="org.sample.ws.HelloServiceImpl" 

      is used to publish the HelloServiceImpl class.

    • the following declaration :
      <jaxws:endpoint ... address="/HelloServiceImplPort" 

      is used to set the path for the URL of HelloServiceImpl. In our case our service will be available at http://localhost:8080/jaxwswithcxf/services/HelloServiceImplPort.

    • the following declaration :
      <jaxws:endpoint ... wsdlLocation="wsdl/helloserviceimpl.wsdl" 
      

      set the location of the WSDL. If you remove this wsdlLocation attribute, WSDL will be generated if you access it by the URL http://localhost:8080/jaxwswithcxf/services/HelloServiceImplPort?wsdl.

  • [5] web.xml is modified to declare the CXF servlet based on Spring
    <servlet>
      <description>Apache CXF Endpoint</description>
      <display-name>cxf</display-name>
      <servlet-name>cxf</servlet-name>
      <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>
    

    available at http://localhost:8080/jaxwswithcxf/services/ :

    <servlet-mapping>
      <servlet-name>cxf</servlet-name>
      <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
    

    This servlet is used to dispatch to the proper WebServices. To know the deployed WebServices, this servlet use the Spring ApplicationContext loaded from the beans.xml :

      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/beans.xml</param-value>
      </context-param>
    
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
    

    Here is the full code of the web.xml :

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
      <display-name>jaxwswithcxf</display-name>
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      <servlet>
        <description>Apache CXF Endpoint</description>
        <display-name>cxf</display-name>
        <servlet-name>cxf</servlet-name>
        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>cxf</servlet-name>
        <url-pattern>/services/*</url-pattern>
      </servlet-mapping>
      <session-config>
        <session-timeout>60</session-timeout>
      </session-config>
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/beans.xml</param-value>
      </context-param>
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
    </web-app>
  • [6] helloserviceimpl_schema1.xsd : this XML Schema describes the structure used in the WebService. This file is generated because the Generate seperate XSD for the types checkbox of the page Web Service Java2WS Configuration was checked. Here is the content of this file :
    <?xml version="1.0" encoding="utf-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.sample.org/" elementFormDefault="unqualified" targetNamespace="http://ws.sample.org/" version="1.0">
    <xs:element name="getVersion" type="tns:getVersion"/>
    <xs:element name="getVersionResponse" type="tns:getVersionResponse"/>
    <xs:element name="hello" type="tns:hello"/>
    <xs:element name="helloResponse" type="tns:helloResponse"/>
    <xs:complexType name="getVersion">
        <xs:sequence/>
      </xs:complexType>
    <xs:complexType name="getVersionResponse">
        <xs:sequence>
          <xs:element minOccurs="0" name="return" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
    <xs:complexType name="hello">
        <xs:sequence>
          <xs:element minOccurs="0" name="arg0" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
    <xs:complexType name="helloResponse">
        <xs:sequence>
          <xs:element minOccurs="0" name="return" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
  • [7] helloserviceimpl.wsdl : is the generated WSDL. This file is generated because the Generate WSDL checkbox of the page Web Service Java2WS Configuration was checked. Here is the content of this file :
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="HelloServiceImplService" targetNamespace="http://ws.sample.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.sample.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
      <wsdl:types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://ws.sample.org/" schemaLocation="helloserviceimpl_schema1.xsd"/>
    </schema>
      </wsdl:types>
      <wsdl:message name="hello">
        <wsdl:part name="parameters" element="tns:hello">
        </wsdl:part>
      </wsdl:message>
      <wsdl:message name="getVersion">
        <wsdl:part name="parameters" element="tns:getVersion">
        </wsdl:part>
      </wsdl:message>
      <wsdl:message name="helloResponse">
        <wsdl:part name="parameters" element="tns:helloResponse">
        </wsdl:part>
      </wsdl:message>
      <wsdl:message name="getVersionResponse">
        <wsdl:part name="parameters" element="tns:getVersionResponse">
        </wsdl:part>
      </wsdl:message>
      <wsdl:portType name="HelloServiceImpl">
        <wsdl:operation name="getVersion">
          <wsdl:input name="getVersion" message="tns:getVersion">
        </wsdl:input>
          <wsdl:output name="getVersionResponse" message="tns:getVersionResponse">
        </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="hello">
          <wsdl:input name="hello" message="tns:hello">
        </wsdl:input>
          <wsdl:output name="helloResponse" message="tns:helloResponse">
        </wsdl:output>
        </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="HelloServiceImplServiceSoapBinding" type="tns:HelloServiceImpl">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="getVersion">
          <soap:operation soapAction="" style="document"/>
          <wsdl:input name="getVersion">
            <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output name="getVersionResponse">
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
        <wsdl:operation name="hello">
          <soap:operation soapAction="" style="document"/>
          <wsdl:input name="hello">
            <soap:body use="literal"/>
          </wsdl:input>
          <wsdl:output name="helloResponse">
            <soap:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="HelloServiceImplService">
        <wsdl:port name="HelloServiceImplPort" binding="tns:HelloServiceImplServiceSoapBinding">
          <soap:address location="http://localhost:9090/HelloServiceImplPort"/>
        </wsdl:port>
      </wsdl:service>
    </wsdl:definitions>
    

You can notice that you have JAX-WS Web Services menu item which shows you information about Java classes which are annotated with JAX-WS :

Launch WEB Application

At this step we don’t have any client (consumer of the HelloServiceImpl) but we can test it.

An important information is that our WebService is declared with the org.apache.cxf.feature.LoggingFeature :

 
<jaxws:endpoint id="helloservice"
		...>
		<jaxws:features>
			<bean class="org.apache.cxf.feature.LoggingFeature" />
		</jaxws:features>
	</jaxws:endpoint>

This feature is very usefull because it gives you the capability to trace for instance the received SOAP message (IN) and the sent SOAP message (OUT). We will check that in the Eclipse Console View.

Launch jaxwswithcxf to publish our WebService. After the start of the Web Application, you can notice some interesting logs in the Eclipse Console View :

  • you can notice that WEB-INF/beans.xml is loaded :
    ...
    INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/beans.xml]
    ...
    

    And check that HelloServiceImpl is published :

    ...
    INFO: Creating Service {http://ws.sample.org/}HelloServiceImplService from WSDL: wsdl/helloserviceimpl.wsdl
    22 août 2011 17:16:13 org.apache.cxf.endpoint.ServerImpl initDestination
    INFO: Setting the server's publish address to be /HelloServiceImplPort
    ...

    URLs

    At this step we can play with different URLs

    CXF Services list

    If you go at http://localhost:8080/jaxwswithcxf/services, you can see the list of WebServices (and REST services) :

    WSDL

    If you click on the link

    WSDL : {http://ws.sample.org/}HelloServiceImplService

    you will see the WSDL :

    URL of the WSDL is http://localhost:8080/jaxwswithcxf/services/HelloServiceImplPort?wsdl

    If you go to the Eclipse Console View, you will see some logs (because we have LoggingFeatures) :

    getVersion method

    It’s possible to call our getVersion method with the following URL http://localhost:8080/jaxwswithcxf/services/HelloServiceImplPort/getVersion which returns the SOAP message :

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    	<soap:Body>
    		<ns2:getVersionResponse xmlns:ns2="http://ws.sample.org/">
    			<return>1.0</return>
    		</ns2:getVersionResponse>
    	</soap:Body>
    </soap:Envelope>
    

    If you go to the Eclipse Console View, you will see some logs (because we have LoggingFeatures)

    With this log you can see for instance the sent SOAP Message :

    hello method

    It’s possible to call method with parameter. If you call hello like this, you will that :

    http://localhost:8080/jaxwswithcxf/services/HelloServiceImplPort/hello

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    	<soap:Body>
    		<ns2:helloResponse xmlns:ns2="http://ws.sample.org/">
    			<return>Hello null!</return>
    		</ns2:helloResponse>
    	</soap:Body>
    </soap:Envelope>
    
    Hello null!

    is returned because we have not filled the parameter.

    To set a parameter, you must access to this URL :
    http://localhost:8080/jaxwswithcxf/services/HelloServiceImplPort/hello?arg0=world

    This URL will return the following SOAP message :

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    	<soap:Body>
    		<ns2:helloResponse xmlns:ns2="http://ws.sample.org/">
    			<return>Hello world!</return>
    		</ns2:helloResponse>
    	</soap:Body>
    </soap:Envelope>

    Why arg0? Because if you check the XML Schema you have :

    <xs:complexType name="hello">
        <xs:sequence>
          <xs:element minOccurs="0" name="arg0" type="xs:string"/>
        </xs:sequence>
      </xs:complexType>

    Conclusion

    In this article we have generated with CXF Eclipse wizard a WebService with JAX-WS. This wizard initializes CXF by creating beans.xml wich declare Java classes which must be published and CXF Servlet. You can notice that HelloServiceImpl is not linked to CXF and could be used with another JAX-WS implementation.

    In next article [step3] we will create and generate a client with JAX-WS (and CXF) which will consume our WebService.

Catégories :Apache CXF, JAX-WS
  1. daniel
    novembre 3, 2011 à 9:18

    Clear, very useful..waiting for the 3rd step!

    • novembre 3, 2011 à 9:25

      Hi Daniel,

      Thank a lot for your post. I’m happy that articles please you. I have started writing the 3rdstep. I must just find time to finish it.

      Regards Angelo

    • novembre 21, 2011 à 12:07

      Very good! No missing information or bugs, a perfekt article for beginning. Thank you very much!

      • novembre 21, 2011 à 12:42

        Hi steve,

        Thank a lot.

        Regards Angelo

  2. novembre 9, 2011 à 6:44

    Just what i was trying to understand 2 weeks ago!, thanks a lot for this article

    • novembre 9, 2011 à 7:23

      Hi,

      I’m happy that my article has helped you.

      Regards Angelo

  3. soghinso
    novembre 23, 2011 à 3:31

    Thank you Angelozer
    its easy with u

  4. Vidya
    novembre 25, 2011 à 8:28

    Hi,

    Thank you for explaining it so briefly with Tomcat server…
    It will be great if you explain this with Jboss6 also.
    I tried to do this before a month using Jboss6 but i failed. its showing lot of dependency errors.

    • novembre 25, 2011 à 8:48

      Hi,

      I have never used JBoss6.Sorry I cannot help you.

      Regards Angelo

  5. janvier 3, 2012 à 12:20

    angelozerr :
    Hi Daniel,
    Thank a lot for your post. I’m happy that articles please you. I have started writing the 3rdstep. I must just find time to finish it.
    Regards Angelo

    Hi Angelo,
    yes so war, all is accomplished thanks to you, now i will try to create and generate a client with JAX-WS by my account,
    Hoping to read your article 3 very soon,

  6. rene
    janvier 13, 2012 à 9:57

    Hi angelozerr,

    Great article. When do you think you have finished the 3rdstep. I’m waiting to see the consumer variant.

    Kind regards,

    Rene

    • janvier 13, 2012 à 11:27

      Hi Rene,

      Thanks for your post. For the step3 I have started something but I must just find time to finish it.

      Regards Angelo

  7. Rene
    février 5, 2012 à 6:33

    Hi Angelo,

    Did you already find some time to start with step3. Any idea when you find time to finish it.

    • février 5, 2012 à 6:41

      Hi Rene,

      I’m very busy for the moment, sorry.
      I don’t know when I will hav etime to write it.

      Regards Angelo

  8. Sony V George
    février 16, 2012 à 8:06

    Hi angelozerr,

    Great Job!!!!

    This article really Excellent . The way you explained is Quite Great.
    Please post the Setp3 as well, whenever you find free.

    Regards
    Sony

    • février 16, 2012 à 8:19

      Hi Sony,

      Thank a lot for your post. I don’t know when I will able to post the step3.

      Regards Angelo

  9. Shameer
    février 16, 2012 à 10:29

    simply superb ….

  10. Bahador
    mars 2, 2012 à 5:42

    Hi Angelozerr,
    It was great tutorial. Thanks for sharing with us. I really need to know more about step 3. I wonder when you would have enough time to populate your knowledge to your website?

    Thanks again for your sharing.

    I am waiting,

    Best

  11. mars 6, 2012 à 3:26

    Hi, thanks a lot for your post, it’s definitively close to what I’m trying to put together.
    I followed all the steps here, but when I start my Tomcat I get an error that sounds like something is missing:

    2012-03-06 16:10:05,000 [pool-2-thread-1] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/Web_Gateway] – Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
    java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

    As far as I understood there was no need of spring jars, but it definitively seems they are needed, at least the contextLoaderListener.

    Am I doing something wrong here?

    • mars 6, 2012 à 3:37

      Hi Fabrizio,

      By default CXF works with Spring (because we use CXFServlet) To know which service must be published as webservice, CXFServlet use Spring beans declaration loaded by ContextLoaderListener . To use CXF without Spring you must use CXFNonSpringServlet and use javax.xml.ws.Endpoint.publish (which is implemented by CXF) to publish your web service). It should be explained in another article, but for the moment no time to do that).

      Regards Angelo

      • mars 6, 2012 à 3:58

        Thanks a lot Angelo, I’m going through the non-Spring approach then.

  12. mars 9, 2012 à 8:15

    Thx, awesome article Angelo. Clear instructions.

    I am trying to deploy jaxwswithcxf on Apache Geronimo v2.2.1 and CXF v2.5.2. Everything is smooth until It ends up with org.apache.geronimo.common.DeploymentException: WSDL generation failed at org.apache.geronimo.jaxws.builder.WsdlGenerator.generateWsdl.

    Are you able to help me with anything here? Unfortunately I couldn’t get an exception or a « caused by » other than the DeploymentException that I could pinpoint.

    Many thanks,
    JJ

    • mars 9, 2012 à 8:30

      Hi Jemmejoy.

      Many thanks for your post.
      I’m sorry I cannot help you, I have never used CXF v2.5.2. Goal of my article is just to start working with CXF, but I have not time to explain adwanced feature.
      So please post your question to CXF forum.

      Good luck!

      Regards Angelo

  13. onepseudoxy
    mars 14, 2012 à 12:21

    Hi,
    Could you please publish a working example that use cxf, spring MVC, hibernate and mysql project where a web service needs to access data from database. in which ( Controller, Business, service, DAO and domain object layer are implemented).
    Kindly.

    • mars 14, 2012 à 1:06

      Hi,

      I have never used Spring MVC. So it’s impossible for me to do that (not time to do that).

      Regards Angelo

  14. Sanjay Kumar
    avril 28, 2012 à 4:09

    Hi Angelozer,

    i am new to webservices, i tried to follow your steps to create a test project. i used eclipse helios, apache cxf-2.5 and apache tomcat-7.0.27 for the application.

    when I am comming to « step5 : Web Service Java2WS Configuration » there following options are not comming for me in eclipse:

    1)generate Client
    2)generate Server
    3)generate Wrapper and Fault beans
    4)Generate WSDL

    and i am getting following Error on eclipse:

    java.lang.NoClassDefFoundError: org/apache/cxf/tools/java2wsdl/JavaToWSDL

    so for me wsdl files are not getting generated.

    please help me on this , since last three days I am trying to get out of this problem but not getting what to do.

    Thanks in adance.

    • Mai 2, 2012 à 11:31

      Hi,

      Have you tried with version of CXF like explained in this article? Perhaps CXF 2.5 has changed some tools java classes since 2.5?

      Regards Angelo

  15. Mai 22, 2012 à 10:42

    Getting below error

    23 May, 2012 4:03:52 AM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(D:\New Jax WS\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\jaxwswithcxf\WEB-INF\lib\geronimo-servlet_2.5_spec-1.1.2.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

    Any idea

  16. Sinha B L
    Mai 24, 2012 à 7:13

    Hi Angelozer,
    Thank you very much for the post. It is very useful.
    Waiting for Step3

    Sinha

  17. Carlos
    juillet 29, 2012 à 9:19

    I’m waiting for you Step 3. Great tutorial!

  18. août 3, 2012 à 8:08

    Hi Angelo, where is STEP3?

    • août 3, 2012 à 8:14

      Hi imsrch,

      I must just find time to write this article.

      Regards Angelo

  19. Lucia Ion
    août 30, 2012 à 11:33

    Please help with advise.
    My environment is :
    Eclipse Juno
    Tomcat 7.0
    JDK 1.6
    CXF 2.4.8

    I try to create a CXF Web Service from a wsdl (Top to Down ).
    I follow all the instructions from everywhere.

    I would appreciate an answer.
    I have this error at the end:

    30.08.2012 13:23:07 org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\jdk\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/jdk/bin/../jre/bin/client;C:/jdk/bin/../jre/bin;C:/jdk/bin/../jre/lib/i386;C:\jdk\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0\;;C:\PROGRAM FILES (X86)\COMMON FILES\ROXIO SHARED\OEM\DLLSHARED\;C:\PROGRAM FILES (X86)\COMMON FILES\ROXIO SHARED\OEM\DLLSHARED\;C:\PROGRAM FILES (X86)\COMMON FILES\ROXIO SHARED\OEM\12.0\DLLSHARED\;C:\PROGRAM FILES (X86)\ROXIO\OEM\AUDIOCORE\;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files\TortoiseSVN\bin;C:\eclipse;;.
    30.08.2012 13:23:07 org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:AreaProj_CXF’ did not find a matching property.
    30.08.2012 13:23:07 org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler [« http-bio-8080 »]
    30.08.2012 13:23:07 org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler [« ajp-bio-8009 »]
    30.08.2012 13:23:07 org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 344 ms
    30.08.2012 13:23:07 org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    30.08.2012 13:23:07 org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
    30.08.2012 13:23:07 org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(C:\tomcat\wtpwebapps\AreaProj_CXF\WEB-INF\lib\geronimo-servlet_2.5_spec-1.1.2.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    30.08.2012 13:23:07 org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    30.08.2012 13:23:07 org.springframework.web.context.ContextLoader initWebApplicationContext
    INFO: Root WebApplicationContext: initialization started
    30.08.2012 13:23:07 org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing Root WebApplicationContext: startup date [Thu Aug 30 13:23:07 CEST 2012]; root of context hierarchy
    30.08.2012 13:23:08 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/cxf-beans.xml]
    30.08.2012 13:23:08 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
    30.08.2012 13:23:08 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-extension-soap.xml]
    30.08.2012 13:23:08 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [META-INF/cxf/cxf-servlet.xml]
    30.08.2012 13:23:08 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b1cd0: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,areaservice]; root of factory hierarchy
    30.08.2012 13:23:08 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b1cd0: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,areaservice]; root of factory hierarchy
    30.08.2012 13:23:08 org.springframework.web.context.ContextLoader initWebApplicationContext
    SCHWERWIEGEND: Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘areaservice’: Cannot create inner bean ‘(inner bean)’ of type [org.tempuri.areaservice.AreaServiceImpl] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.tempuri.areaservice.AreaServiceImpl] for bean with name ‘(inner bean)’ defined in null; nested exception is java.lang.ClassNotFoundException: org.tempuri.areaservice.AreaServiceImpl
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    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:662)
    Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.tempuri.areaservice.AreaServiceImpl] for bean with name ‘(inner bean)’ defined in null; nested exception is java.lang.ClassNotFoundException: org.tempuri.areaservice.AreaServiceImpl
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1261)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:433)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
    … 27 more
    Caused by: java.lang.ClassNotFoundException: org.tempuri.areaservice.AreaServiceImpl
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1282)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1253)
    … 29 more
    30.08.2012 13:23:08 org.apache.catalina.core.StandardContext listenerStart
    SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘areaservice’: Cannot create inner bean ‘(inner bean)’ of type [org.tempuri.areaservice.AreaServiceImpl] while setting constructor argument; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.tempuri.areaservice.AreaServiceImpl] for bean with name ‘(inner bean)’ defined in null; nested exception is java.lang.ClassNotFoundException: org.tempuri.areaservice.AreaServiceImpl
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    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:662)
    Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.tempuri.areaservice.AreaServiceImpl] for bean with name ‘(inner bean)’ defined in null; nested exception is java.lang.ClassNotFoundException: org.tempuri.areaservice.AreaServiceImpl
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1261)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:433)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
    … 27 more
    Caused by: java.lang.ClassNotFoundException: org.tempuri.areaservice.AreaServiceImpl
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1282)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1253)
    … 29 more
    30.08.2012 13:23:08 org.apache.catalina.core.StandardContext startInternal
    SCHWERWIEGEND: Error listenerStart
    30.08.2012 13:23:08 org.apache.catalina.core.StandardContext startInternal
    SCHWERWIEGEND: Context [/AreaProj_CXF] startup failed due to previous errors
    30.08.2012 13:23:08 org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext
    30.08.2012 13:23:08 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\tomcat\webapps\docs
    30.08.2012 13:23:08 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\tomcat\webapps\examples
    30.08.2012 13:23:08 org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    30.08.2012 13:23:08 org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    30.08.2012 13:23:08 org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: attributeAdded(‘org.apache.jasper.compiler.TldLocationsCache’, ‘org.apache.jasper.compiler.TldLocationsCache@848ecc’)
    30.08.2012 13:23:08 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\tomcat\webapps\host-manager
    30.08.2012 13:23:08 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\tomcat\webapps\manager
    30.08.2012 13:23:08 org.apache.catalina.startup.HostConfig deployDirectory
    INFO: Deploying web application directory C:\tomcat\webapps\ROOT
    30.08.2012 13:23:08 org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler [« http-bio-8080 »]
    30.08.2012 13:23:08 org.apache.coyote.AbstractProtocol start
    INFO: Starting ProtocolHandler [« ajp-bio-8009 »]
    30.08.2012 13:23:08 org.apache.catalina.startup.Catalina start
    INFO: Server startup in 917 ms
    ================================
    Here is the wsdl.

    ===================================================

    Lucia Ion

  20. Lucia Ion
    août 30, 2012 à 11:37

    I observerd that the wsdl was not pasted
    Here it is :

    ==============================================

  21. amrita
    septembre 13, 2012 à 5:35

    I got this– anyone seen this?

    IWAB0014E Unexpected exception occurred.

    java.lang.NullPointerException
    at org.eclipse.jst.ws.internal.cxf.core.utils.LaunchUtils.launch(LaunchUtils.java:100)
    at org.eclipse.jst.ws.internal.cxf.creation.core.commands.Java2WSCommand.execute(Java2WSCommand.java:90)
    at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:419)

  22. septembre 15, 2012 à 6:47

    You will need to configure the cfx runtime in eclispe. read step 1 of the tutorial

  23. sd
    décembre 18, 2012 à 11:27

    Hi Angelo,
    Very Nice Article…Easy to understand…
    i am eagerly waiting for Step 3…
    Here…u explained bottom up approach…Java Class to Web Services(WSDL)
    i want to generate java class from given WSDL…that means TOP DOWN APPROACH….any idea how to generate java classes from given WSDL?

    • décembre 18, 2012 à 2:21

      I’m happy this article please you. I have never played with TOP DOWN APPROACH. Sorry.

  24. Neil
    janvier 16, 2013 à 6:17

    Thanks for the post! I really hope you could finish part 3, which would be greatly appreciated!

  25. LP
    janvier 19, 2013 à 9:42

    Hello Angelo:

    Excellent step1 and step2 articales!! The best I found so far after surfing the Internet for the last 2 weeks.

    Thank you very much for the detailed steps and screen shots. They are extremely helpful! I am eagerly waiting for step3 also. 🙂

    Regards,
    LP

  26. 3
    janvier 24, 2013 à 3:43

    what step 3 ????

    • janvier 24, 2013 à 4:21

      Not published for the moment, because it’s not finished (no time to finish it).

  27. Najus
    février 5, 2013 à 8:53

    I have done exactly as above but I am facing this problem. What might be the problem?

    Feb 05, 2013 2:35:31 PM org.apache.cxf.service.invoker.AbstractInvoker invoke
    SEVERE: Invocation without a binding operation.
    Feb 05, 2013 2:35:31 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
    WARNING: Interceptor for {http://ws.sample.org/}HelloServiceImplService has thrown exception, unwinding now
    org.apache.cxf.interceptor.Fault: No binding operation info while invoking unknown method with params unknown.
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:59)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:218)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:163)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:137)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:158)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:243)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:168)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:219)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    Feb 05, 2013 2:35:31 PM org.apache.cxf.services.HelloServiceImplService.HelloServiceImplPort.HelloServiceImpl
    INFO: Outbound Message
    —————————
    ID: 4
    Response-Code: 500
    Encoding: UTF-8
    Content-Type: text/xml
    Headers: {}
    Payload: soap:ServerNo binding operation info while invoking unknown method with params unknown.

    • Ros
      février 8, 2013 à 9:28

      Hi Najus, I’ve got the same problem. I guess, it’s because we are using more recent versions of cxf than in the articel (2.4.2). I’m using 2.7.3. I don’t know how to solve this yet.

      • Najus
        février 14, 2013 à 5:17

        Hmm..Did you solve it?

  28. And i am working on apache cxf but i am working on bug which was, unexpected tag in soap response. we are testing webservice with soap-ui framework.
    mars 5, 2013 à 1:29

    Hi,

    The example is very good……….

    And i am working on apache cxf but i am working on bug which was, unexpected tag in soap response. we are testing webservice with soap-ui framework.

  29. ToulouPhilou
    avril 11, 2013 à 1:19

    same problems with CXF 2.7.4

  30. Raul
    Mai 6, 2013 à 3:26

    No bloody logging with CXF 2.7.4. LogInInterceptor and LogOutInterceptor are not working in CXF 2.7.4.
    Any idea any one ?

    • Najus
      Mai 20, 2013 à 6:07

      I have been working with 2.7.2 and both LogInInterceptor and LogOutInterceptor are working. You need to add those in the cxf-servlet.xml as to get it work. Hope it helps

  31. Raul
    Mai 6, 2013 à 3:27

    Ros :
    Hi Najus, I’ve got the same problem. I guess, it’s because we are using more recent versions of cxf than in the articel (2.4.2). I’m using 2.7.3. I don’t know how to solve this yet.

    Not able to solve the problem of configuring Logging interceptors 😦

  32. DP
    Mai 20, 2013 à 4:39

    Did anyone able to resolve « Invocation without a binding operation. » while using CXF 2.7.4 ? How about you Angelo ?

    • Mai 24, 2013 à 6:56

      I have never tested with CXF 2.7.4 because today I use JAX-RS instead of JAX-WS.

    • Igor Walitscheff
      juillet 3, 2013 à 3:14

      Use CXF version 2.6.8. This will fix it.

  33. Priya K
    juillet 3, 2013 à 3:14

    Iam able to hit the url & c the wsdl, but when I try to test the services, I get the webfault in the response. Can you help? I c that even the wsdl looks the same

    soap:Server

    No binding operation info while invoking unknown method with params unknown.

    • hjy
      octobre 9, 2013 à 7:21

      For me, it works using soapUI as rupanshu suggested

  34. rupanshu
    août 27, 2013 à 8:52

    If you are not able to view the results using the links given above you can use Poster(a google chrome plugin) to post url and it needs a soap message as input to give correct output

    You can use SOAP ui to generate soap message.

    SOAP ui requires wsdl as input and it generates proper soap messages to give input for the link.

  35. avril 4, 2014 à 10:27

    Thank you for this detailed post. I was breaking my head trying to install maven and CXF directory mixup. Your screenshots cleared the confusion. Thanks a lot.
    Please post the 3rd part soon. All the best for that.

  36. Victor
    août 27, 2014 à 9:29

    Thank you a lot for your excellent tutorial.
    I have followed all of steps but I am getting the following exception when starting Tomcat 7:

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘gestorcreditows’: Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {http://interfaces.webservice.tarjetamovilserver.dsv.com.ar/}GestorCreditoWSService.

    Do you have any idea about this error?
    Thank you very much in advance!

  37. novembre 26, 2014 à 3:26

    Address: http://localhost:8080/jaxwswithcxf/services/HelloServiceImplPort/hello
    Http-Method: GET
    Content-Type:
    Headers: {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8], accept-encoding=[gzip, deflate, sdch], accept-language=[vi-VN,vi;q=0.8,fr-FR;q=0.6,fr;q=0.4,en-US;q=0.2,en;q=0.2], connection=[keep-alive], Content-Type=[null], cookie=[COOKIE_SUPPORT=true; GUEST_LANGUAGE_ID=en_US], host=[localhost:8080], user-agent=[Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.65 Safari/537.36]}
    ————————————–
    Nov 26, 2014 10:20:52 PM org.apache.cxf.service.invoker.AbstractInvoker invoke
    SEVERE: Invocation without a binding operation.
    Nov 26, 2014 10:20:52 PM org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
    WARNING: Interceptor for {http://ws.sample.org/}HelloServiceImplService has thrown exception, unwinding now
    org.apache.cxf.interceptor.Fault: No binding operation info while invoking unknown method with params unknown.
    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:59)

    ——————
    plz help me

  38. sigma20
    mars 1, 2015 à 1:58

    i have followed all the steps, but when i launch my app, it still gives me a 404 error eve though my web.xml now looks like this:

    soc1

    index.html
    index.htm
    index.jsp
    default.html
    default.htm
    default.jsp

    Apache CXF Endpoint
    cxf
    cxf
    org.apache.cxf.transport.servlet.CXFServlet
    1

    cxf
    /services/*

    60

    contextConfigLocation
    WEB-INF/beans.xml

    org.springframework.web.context.ContextLoaderListener

    • sigma20
      mars 1, 2015 à 2:01

      oops sorry the web.xml kinda got messed up in the comments but the point is, it does contain the servlet tags and all.
      What else should i look into in order to solve this issue.

  39. senthilkumar
    juillet 14, 2015 à 10:16

    Very Good Example. Working 100% fine.

  40. Nico
    décembre 1, 2015 à 10:02

    waiting for the 3rd step :/

  41. janvier 20, 2016 à 9:36

    thanks for your tutorial. I am waiting for the next step 🙂

  1. août 24, 2011 à 4:01
  2. août 24, 2011 à 8:02
  3. août 25, 2011 à 5:41
  4. février 19, 2012 à 8:39

Répondre à Raul Annuler la réponse.