Immer CXF Fehler: javax.xml.ws.WebServiceException: WSDL-Metadaten nicht zur Verfügung zum erstellen des proxy

Habe ich verwendet, CXF ist wsdl2java generieren von code aus einer WSDL-Datei. Ich dann bauen Sie den code mithilfe der ant-build-xml-Datei (auch erzeugt durch die CXF ist wsdl2java).

Wenn ich meinen code auf meinem lokalen Java-7-Rechner, ist alles gut. Wenn ich den code auf einer linux-box in der cloud mit Java 1.5, bekomme ich die folgende Fehlermeldung:

javax.xml.ws.WebServiceException: WSDL Metadata not available to create the proxy,
either Service instance or ServiceEndpointInterface com.a.b.TheService should have
WSDL information

Habe ich eine Suche um und ich kann nicht finden, alle Informationen, die möglicherweise erklären, den Fehler in meinem Szenario. Ich bin mir nicht sicher, wo Sie anfangen, auf diesen einen. Kann jemand Einblick geben?

Ich erwähnte Java-Versionen vor, wie es ist ein deutlicher Unterschied, aber es kann nichts mit dem problem zu tun.

UPDATE: Hinzufügen in den folgenden code als eine Folge von Syon Anfrage:

private static final String servicesNamespace = "http://www.serviceprovider.com/services/2009/03/02";
private static final String servicesNamespaceSchema = "http://www.serviceprovider.com/services/2009/03/02/schema";
private static String SERVICE_NAME = "TheService";
private QName SERVICE_QNAME;
private TheService m_theService;
...

SERVICE_QNAME = new QName(servicesNamespace, SERVICE_NAME);

I wrote this code quite some time ago, and at the time I wrote the comment below.
I've included it here in case it is helpful:

//The sample code creates an instance of the generated TheService_Service class.
//TheService_Service has references to the local WSDL file that it was generated from, and
//will report an error if it is not found. To prevent that error, we could:
//(1) ensure that the WSDL is available locally in the production environment in the location
//    referenced in the generated Java
//(2) generate the Java from the WSDL located on the web rather than local WSDL, meaning that
//    the WSDL referenced in the generated Java would be a URL to where it is located on
//    serviceproviders's web site.
//(3) Rather than create an instance of TheService_Service, just create an instance of its
//    super class, javax.xml.ws.Service, which has a static method to create an instance of it that
//    does not require the location of the WSDL to be passed to it.
//I am going to choose option (3). Option (2) is a close second.

Service service = Service.create(SERVICE_QNAME);
m_theService = service.getPort(TheService.class);   <-- Fails here

((BindingProvider)m_theService).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointAddress);

Binding binding = ((BindingProvider)m_theService).getBinding();
((SOAPBinding)binding).setMTOMEnabled(false);

Dank,

Paul

Können Sie nach den spezifischen code, die Sie verwenden, um erstellen Sie den proxy?
Hi Syon. Ich habe aktualisiert die post mit dem code. Ich hoffe ich habe alles relevante.

InformationsquelleAutor user265330 | 2013-07-24

Schreibe einen Kommentar