Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9031701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:47:50+00:00 2026-06-16T07:47:50+00:00

I have written a small sample web service, using Apache CXF (CXFServlet) and Spring

  • 0

I have written a small sample web service, using Apache CXF (CXFServlet) and Spring (ContextLoaderListener) I have registered the CXFServlet to listen on the / url. And I am declaring my beans in beans.xml.

When I start the web service with tomcat and go to the service url, then I can see the web service definition (e.g. methods, endpoint, wsdl link). But the problem is that when I click on the wsdl link, then I do not get the WSDL file, but instead I am recursively forwarded back to the same page, but each time the name of the web service address is appended:

  1. localhost:8080/Test/accountEndpoint
  2. localhost:8080/Test/accountEndpointaccountEndpoint
  3. localhost:8080/Test/accountEndpointaccountEndpointaccountEndpoint

The service is a “code-first” service which a @WebService annotated java interface and a implementation class.

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                        http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>Test</display-name>
    <servlet>
            <servlet-name>cxf</servlet-name>
            <display-name>cxf</display-name>
            <description>Apache CXF Endpoint</description>
            <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>/</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>

beans.xml

<?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.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-servlet.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />

    <bean id="account" class=".....AccountImpl" />

    <jaxws:endpoint id="accountEndpoint" implementor="#account"
        address="accountEndpoint" />
</beans>

As I understand it, CXF should automatically generate the WSDL file and provide it to me, when I click on the link, so I do not understand why that is not happening.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:47:52+00:00Added an answer on June 16, 2026 at 7:47 am

    Specify the address this way, with a leading slash:

    <jaxws:endpoint id="accountEndpoint" implementor="#account"
        address="/accountEndpoint" />
    

    Sorry, making a change, the above is not correct:

    You are right, I am able to replicate the behavior with mapping CXFServlet to the “default” servlet path mapping of /, the fix that I could get to work for myself is to map it to /* instead:

    <servlet-mapping>
            <servlet-name>cxf</servlet-name>
            <url-pattern>/*</url-pattern>
    </servlet-mapping>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small web server written using node.js, express and serial port which
I have written a small custom web server application in C running on Linux.
I have written a small sample page below to show you what I mean.
I have written a small application in C# using Visual Studio 2010. It is
I have written a small Sample program to see about Eclipse Conditional Break Points
I have written a small makefile for a few simple C programs that compiles
I have written a small program just like hello the world , everything was
I have written a small chat app that uses mysql + php to facilitate
I have written a small app that puts my bluetooth in discoverable mode for
I have written a small .net Windows Forms application. And now I decided to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.