Hello,

I am trying to implement a dynamic client such as presented here 
http://cxf.apache.org/docs/dynamic-clients.html .

The target WSDL has naming conflicts that force me to use a binding file to be 
able to use wrapper objects. That works fine when I am using the maven 
cxf-codegen-plugin to generate a static client. But when I try to do it 
dynamically, the following exception occurs :


java.lang.RuntimeException: Fatal error compiling schema from WSDL at 
{https://url?WSDL}: Unexpected <jaxws:bindings> appears at line 2 column 247
    at 
org.apache.cxf.endpoint.dynamic.DynamicClientFactory$InnerErrorListener.fatalError(DynamicClientFactory.java:778)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at 
org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:89)
    at com.sun.proxy.$Proxy35.fatalError(Unknown Source)
    at 
com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.fatalError(SchemaCompilerImpl.java:307)
    at 
com.sun.tools.internal.xjc.util.ErrorReceiverFilter.fatalError(ErrorReceiverFilter.java:72)
    at 
com.sun.xml.internal.xsom.impl.parser.ParserContext$2.fatalError(ParserContext.java:196)
    at 
com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx.unexpectedX(NGCCRuntimeEx.java:491)
    at 
com.sun.xml.internal.xsom.impl.parser.state.NGCCHandler.unexpectedEnterElement(NGCCHandler.java:180)
    at 
com.sun.xml.internal.xsom.impl.parser.state.Schema.enterElement(Schema.java:391)
    at 
com.sun.xml.internal.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:244)
    at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
    at 
com.sun.tools.internal.xjc.util.SubtreeCutter.startElement(SubtreeCutter.java:93)
    at 
com.sun.tools.internal.xjc.reader.ExtensionBindingChecker.startElement(ExtensionBindingChecker.java:135)
    at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
    at 
com.sun.tools.internal.xjc.reader.xmlschema.parser.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:113)
    at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
    at 
com.sun.tools.internal.xjc.reader.xmlschema.parser.CustomizationContextChecker.startElement(CustomizationContextChecker.java:178)
    at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:551)
    at 
com.sun.tools.internal.xjc.reader.internalizer.DOMForestScanner$LocationResolver.startElement(DOMForestScanner.java:132)
    at 
com.sun.xml.internal.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:229)
    at 
com.sun.xml.internal.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:112)
    at 
com.sun.tools.internal.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:77)
    at 
com.sun.tools.internal.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:85)
    at 
com.sun.tools.internal.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:89)
    at 
com.sun.tools.internal.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:254)
    at 
com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:332)
    at 
com.sun.xml.internal.xsom.impl.parser.ParserContext.parse(ParserContext.java:113)
    at com.sun.xml.internal.xsom.parser.XSOMParser.parse(XSOMParser.java:156)
    at com.sun.xml.internal.xsom.parser.XSOMParser.parse(XSOMParser.java:145)
    at com.sun.tools.internal.xjc.ModelLoader.createXSOM(ModelLoader.java:519)
    at 
com.sun.tools.internal.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:254)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at 
org.apache.cxf.common.util.ReflectionInvokationHandler.invoke(ReflectionInvokationHandler.java:89)
    at com.sun.proxy.$Proxy33.bind(Unknown Source)
    at 
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:340)
    at 
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:275)
    at 
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:210)
    at com.test.client.DynamicClientTest.main(DynamicClientTest.java:146)
Caused by: org.xml.sax.SAXParseExceptionpublicId: 
file:/home/user/git/test/target/classes/com/test/client/incident_binding.xml; 
systemId: 
file:/home/user/git/test/target/classes/com/test/client/incident_binding.xml; 
lineNumber: 2; columnNumber: 247; Unexpected <jaxws:bindings> appears at line 2 
column 247
    at 
com.sun.xml.internal.xsom.impl.parser.NGCCRuntimeEx.unexpectedX(NGCCRuntimeEx.java:489)
    ... 34 more


And here is the binding file :


<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings wsdlLocation="incident.wsdl" 
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"; 
xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; jaxb:version="2.0">
    <jaxws:bindings node="wsdl:definitions">
        <jaxws:enableWrapperStyle>false</jaxws:enableWrapperStyle>
    </jaxws:bindings>
</jaxws:bindings>


What am I missing ?

Emmanuel GUITON

Ingénieur R&D

Fixe +33 1 70 92 84 16

215 Avenue Georges Clemenceau, 92024 Nanterre


[cid:[email protected]]






www.cloud-temple.com<https://www.cloud-temple.com>






Suivez-nous sur les réseaux sociaux :
[cid:[email protected]]<https://www.facebook.com/TheCloudTemple>
 [cid:[email protected]] 
<https://www.linkedin.com/company/cloud-temple>  
[cid:[email protected]] <https://twitter.com/@CloudTemple>  
[cid:[email protected]] 
<https://www.youtube.com/cloudtemple?sub_confirmation=1>
Pensez à la planète, n'imprimez ce mail que si nécessaire.

Reply via email to