1

I have an application with JAX-WS client.

<jaxws:client name="http://XXXXXX"
              wsdlLocation="YYYYY.wsdl"
              createdFromAPI="true">
    <jaxws:properties>
        <entry key="ws-security.sts.client" value-ref="ZZZZZZZ" />
    </jaxws:properties>
</jaxws:client>

When the application is started during the webservice downtime, the spring context fails and the application doesn't start at all.

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [XXXX]: Constructor threw exception; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'https://YYYYY.wsdl'.: java.net.UnknownHostException: YYYYY
Caused by: java.net.UnknownHostException: YYYYY

How to configure the application in such a way that it starts and the spring config doesn't fail.
I understand that the web service client won't work as long as the web service is down.
I need the application to start and use the web service once it is available.

Azan Zak
  • 11
  • 2

1 Answers1

0

You can put WSDL file to your classpath and locate it in wsdlLocation.

Like wsdlLocation="yyyyy.wsdl"

Or you can handle it programatically. Details here

Zico
  • 2,349
  • 2
  • 22
  • 25
  • "put WSDL file to your classpath" -> That's what I tried. But this don't help much as the WSDLs have imports that themselves have `schemaLocation`s that might be unavailable. – Azan Zak May 23 '17 at 11:49