Hi,

Given the error you encounter here, please refer to a related discussion from CXF-3249[1],
The error you saw
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag</HEAD>; expected </META>. is actually caused by when you try to access wsdl from your code, the server just return you a error page. I guess it could be a network configuration issue(like firewall or virus scan software) on your machine.
[1]https://issues.apache.org/jira/browse/CXF-3249

Freeman
On 2011-2-9, at 下午11:36, Alex Labad wrote:

Hi all,

I have the following error while trying to generate a dynamic client through
a proxy:

It happens with any web service we try to access, or even when we create a
service and call it with a consumer generated with wsdl2java.
Any idea?

INFO: Pre-instantiating singletons in
org .springframework .beans.factory.support.DefaultListableBeanFactory@1e2befa:
defining beans
[cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.b us.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring. Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProc essor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configura tion.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apach e.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.Con duitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.ph ase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache. cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerReg istry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.en dpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHand lerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apach e.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager ,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cx f.binding.corba.CorbaBindingFactory,org.apache.cxf.binding.corba.wsdl. WSDLExtensionRegister#0,org.apache.cxf.jaxws.context.WebServiceContext ResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,or g.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.so ap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfig urer,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.ws.ad dressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressin g.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.address ing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.javascript.J avascriptQueryHandlerRegistry,org.apache.cxf.transport.local.LocalTran sportFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionB uilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder ,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,or g.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache. cxf.management.InstrumentationManager,org.apache.cxf.transport.http_je tty.JettyHTTPTransportFactory,org.apache.cxf.transport.jms.JMSTranspor tFactory,org.apache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.binding.http.HttpBindingFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,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];
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 .dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java: 253)
   at
org .apache .cxf .endpoint .dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java: 178)
(.......)
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </HEAD>;
expected </META>.
at [row,col,system-id]: [5,6,"
http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx?wsdl
"]
   at
org .apache .cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:228)
   at
org .apache .cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:161)
   at
org .apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java: 67)
   ... 7 more
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag
</HEAD>; expected </META>.
at [row,col,system-id]: [5,6,"
http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx?wsdl
"]
   at
com .ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java: 630) at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:461)
   at
com .ctc .wstx.sr.BasicStreamReader.reportWrongEndElem(BasicStreamReader.java: 3258)
   at
com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java: 3200)
   at
com .ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java: 2832) at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java: 1019)
   at
org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:951)
at org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java: 869)
   at
org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:911)
at org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java: 869)
   at
org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:911)
at org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java: 869)
   at
org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:911)
   at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:798)
   at
org .apache .cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:219)
   ... 9 more


Just in case it helps: This is the client creation code:
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
           //POINTING AT THE CONFIGURAITON FILES.
           List<String> bindingFiles = new ArrayList<String>();
           bindingFiles.add("javabindings.xml");
           return factory.createClient(url,
Thread.currentThread().getContextClassLoader(), bindingFiles);

Many thanks in advance!
Alex


--
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org

Reply via email to