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

  • Home
  • SEARCH
  • 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 1023131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:34:07+00:00 2026-05-16T11:34:07+00:00

I have two webapps: a web-service client and a server (both CXF-based, using the

  • 0

I have two webapps: a web-service client and a server (both CXF-based, using the Simple Front-End approach).

This is the server definition:

<simple:server id="server" bindingId="http://schemas.xmlsoap.org/soap/"
    address="/thingy" transportId="http://schemas.xmlsoap.org/soap/"
    serviceName="cs:thingyService"
    serviceClass="com.mycompany.thingy.api.service.ThingyService"
    endpointName="cs:thingyServicePort">
        <simple:serviceBean>
            <bean class="com.mycompany.thingy.server.service.ThingyServiceDelegate">
                <property name="thingyService" ref="thingyService"></property>
            </bean>
        </simple:serviceBean>

        <simple:dataBinding>
            <bean class="org.apache.cxf.aegis.databinding.AegisDatabinding" />
        </simple:dataBinding>
        <simple:binding>
            <soap:soapBinding version="1.1" mtomEnabled="true" />
        </simple:binding>
</simple:server>

And here the client:

<http-conf:conduit name="*.http-conduit">
    <http-conf:client AllowChunking="false" />
</http-conf:conduit>

<simple:client id="thingyService" wsdlLocation="${wsdl.url}?wsdl"
    serviceName="cs:thingyService"
    endpointName="cs:thingyServicePort"
    transportId="http://schemas.xmlsoap.org/soap/"
    address="${wsdl.url}"
    bindingId="http://schemas.xmlsoap.org/soap/"
    serviceClass="com.mycompany.thingy.api.service.ThingyService">
        <simple:dataBinding>
            <bean class="org.apache.cxf.aegis.databinding.AegisDatabinding" />
        </simple:dataBinding>
        <simple:binding>
            <soap:soapBinding mtomEnabled="true" version="1.1" />
        </simple:binding>
</simple:client>

I have an interface called ThingyService (the names have been changed …) that is known to both client and server and the above client definition creates a proxy client that can be injected using this interface.

Everything works beautifully when both webapps are running, specifically when I deploy the server first and then the client. But when the server webapps does not start correctly, the client webapp hangs in an infinite loop trying to create the proxy from the non-existent WSDL.

Basically what I’d like is a proxy around the service proxy that lets the calls pass through when the service is available and throws an adequate exception when the service is down, which I can catch and show a “sorry, we’re offline” page in the gui and resumes service when the web service is available again. I have access to the WSDL in static form through the build process (generated automatically through cxf maven plugins), so I could use this for the initial configuration, so from that point of view I am independent of the server.

Does anybody have any pointers in how to implement this functionality? The server is tomcat. The webapps may or may not be deployed onto the same server during production. The backend uses spring / jpa / cxf, the front end uses spring / wicket.

  • 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-05-16T11:34:07+00:00Added an answer on May 16, 2026 at 11:34 am

    Although the static wsdl creation approach was promising, I chose a different one (mainly because the cxf maven code generation is buggy).

    I wrapped another factoryBean around the existing one, and I attached it to a service provider object that regularly pings the wsdl URL for availability. I keep a service proxy in a cache inside the factory bean, once it is created, and delete it as soon as the service provider ping fails.

    If the service is currently not available, my FactoryBean throws a ServiceNotAvailableException. My front end catches this and shows a nice “Service currently unavailable” page.

    Additionally, an AspectJ aspect catches all writing calls to the service and re-schedules them when the service is available again.

    Here is an excerpt from my spring config:

    <bean id="outerFactoryBean">
        <property name="innerFactory">
            <bean class="org.apache.cxf.frontend.ClientProxyFactoryBean">
                 <!-- translation of spring:client definition from question -->
            </bean>
        </property>
        <property name="serviceProvider" ref="serviceProvider" />
    </bean>
    <bean id="serviceProvider" class="de.mytoys.shop.coupons.web.client.ServiceProvider">
        <property name="wsdlUrl" value="${wsdl.url}?wsdl" />
        <property name="connectionFactory">
            <bean class="org.apache.cxf.transport.http.HttpURLConnectionFactoryImpl" />
        </property>
    </bean>
    
    <task:scheduled-tasks>
        <task:scheduled ref="serviceProvider" method="checkAvailability"
            fixed-delay="1000" />
    </task:scheduled-tasks>
    
    <task:scheduler id="scheduler" pool-size="1" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two VS2008 solutions. Both contain a web application. For both web apps
I have two webapps, that are built together and respectively provide a client and
I have two files client.php and server.php. The client file send a HTTP request
In VS2010 I have two MVC 2 based web apps within the same solution
If I have two webapps, both of which have the same third party library
I have a tomcat server with two webapps (foo and bar) that have an
I have two web apps, one asp-based and one asp.net based. When accessing them
I have two web-sites: example.com and yyy.com They both have similar web apps, but
I have two web application which are deployed in the same J2EE Application server.
I have two applications under tomcat/webapps folder. tomcat/webapps/App1 tomcat/webapps/App2 Both applications share the same

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.