2010-12-20 21 views
6

Apache CXF kullanarak java istemcisinden bir web hizmeti çağırmaya çalışıyorum. Aşağıda müşteri kod snippet'im var.CXF Web hizmeti istemci hatası

Client client = new ClientImpl(new URL("http://localhost:8080/socialkast-web/services/skservice?wsdl")); 
Object[] results = client.invoke("uploadVideoMetaData", new Object[] {metaData}); 
    String result = (String)results[0]; 

Tarayıcıdan wsdl dosyasına erişebilmem de ayrıştırma hatası alıyorum. Aşağıdaki istisna yığınıdır.

INFO: Pre-instantiating singletons in org.s[email protected]14f5a31: defining beans [cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.corba.CorbaBindingFactory,org.apache.cxf.binding.corba.wsdl.WSDLExtensionRegister#0,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.javascript.JavascriptQueryHandlerRegistry,org.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.management.InstrumentationManager,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,org.apache.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.binding.http.HttpBindingFactory,org.apache.cxf.ws.security.policy.WSSecurityPolicyLoader,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry,org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.PolicyBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMManager,org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMAssertionBuilder,org.apache.cxf.binding.corba.wsdl.WSDLExtensionRegister#1]; root of factory hierarchy 
org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. 
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:69) 
at org.apache.cxf.endpoint.ClientImpl.<init>(ClientImpl.java:152) 
at org.apache.cxf.endpoint.ClientImpl.<init>(ClientImpl.java:121) 
at tv.socialkast.client.ws.WSClient.<init>(WSClient.java:42) 
at tv.socialkast.upload.client.gui.UploadDirectoryChooser$DoneActionListener.actionPerformed(UploadDirectoryChooser.java:382) 
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) 
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) 
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) 
at javax.swing.DefaultButtonModel.setPressed(Unknown Source) 
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) 
at java.awt.Component.processMouseEvent(Unknown Source) 
at javax.swing.JComponent.processMouseEvent(Unknown Source) 
at java.awt.Component.processEvent(Unknown Source) 
at java.awt.Container.processEvent(Unknown Source) 
at java.awt.Component.dispatchEventImpl(Unknown Source) 
at java.awt.Container.dispatchEventImpl(Unknown Source) 
at java.awt.Component.dispatchEvent(Unknown Source) 
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
at java.awt.Container.dispatchEventImpl(Unknown Source) 
at java.awt.Window.dispatchEventImpl(Unknown Source) 
at java.awt.Component.dispatchEvent(Unknown Source) 
at java.awt.EventQueue.dispatchEvent(Unknown Source) 
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
at java.awt.EventDispatchThread.run(Unknown Source) 
**Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:8080/socialkast-web/services/skservice?wsdl'.: java.net.ConnectException: Connection refused: connect** 
at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source) 
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) 
at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source) 
at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:232) 
at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:161) 
at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:67) 
... 29 more 

Lütfen burada neleri kaçırdığımı öğrenin.

Teşekkürler.

cevap

0

Yeterince basit: Sunucunuz yanıt vermiyor.

Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'http://localhost:8080/socialkast-web/services/skservice?wsdl'.: java.net.ConnectException: Connection refused: connect at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source 
+0

Tarayıcıdan aynı wsdl url'ye (http: // localhost: 8080/socialkast-web/services/skservice? Wsdl) eriştiğimde, tarayıcıda görüntülenen doğru wsdl dosyasını aldığımı lütfen unutmayın. – Alex

+0

HTTP taşımacılığını sınıf yoluna koymanız belki ihmal edilebilir mi? Cxf.apache.org adresinden bir test vakası ile bir JIRA göndermenizi öneririm, size orada yardımcı olmak daha kolay olurdu. – bmargulies

+0

eminim bir jira gönderirim. HTTP taşımacılığını sınıf yoluna koyma ile ilgili adımları detaylandırır mısınız? – Alex

1

Bu gerçekten açık bir şey olabilir, ancak hizmetinizi tarayıcınızdan almaya çalıştınız mı? Örneğin, için web tarayıcısı ile wsdl almak deneyin: Oraya yapamıyorsanız, belki sunucu çalışmıyor

http://localhost:8080/socialkast-web/services/skservice?wsdl 

.