I'm using some CXF-generated stubs to call a web service, without connecting to the internet. I've done this before, but this particular web service uses ws-addressing which causes some additional issues. This is the section of code where we obtain a reference to the "MessagingManager" - the generated service class which we're trying to call.
W3CEndpointReferenceBuilder w3cerBuilder = new W3CEndpointReferenceBuilder(); w3cerBuilder.address("https://www.foo.org/MessagingManager"); W3CEndpointReference w3ceReference = w3cerBuilder.build(); MyService myService = w3ceReference.getPort(MyService.class, new AddressingFeature()); This getPort() call invokes org.apache.cxf.jaxws.spi.ProviderImpl.getPort(). This getPort implementation eventually delegates to org.apache.cxf.jaxb.JAXBDataBinding, which generates a JAXB schema file, "schema1.xsd". This generated file references the http://www.w3.org/2006/03/addressing/ws-addr.xsd schema, which is downloaded at runtime. If an internet connection is unavailable, this results in an error, "Unable to locate imported document at 'http://www.w3.org...". What's the best way to call a ws-addressing web service without an internet connection? - Aaron