You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "KARR, DAVID (ATTSI)" <dk...@att.com> on 2010/11/06 02:19:24 UTC
Confused about "enableAsyncMapping" and namespaces
I have a bindings file that's working fine for generating synchronous
calls. I now need to configure one that I can call async. I looked up
the doc page that describes how to do this, and I found some issues with
namespaces to be confusing. The errors I get when I run it confirm that
I'm confused about it.
I'm using "org.apache.cxf.tools.wsdlto.WSDLToJava"
This is essentially the bindings.xml file I started with:
---------------------------
<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
jaxb:version="2.0">
<jaxb:globalBindings>
<jaxb:serializable uid="1"/>
</jaxb:globalBindings>
.. many jaxb:bindings elements elided
<jaxb:bindings schemaLocation="...Request.xsd" node="/xsd:schema">
<jaxb:schemaBindings>
<jaxb:package name="..."/>
</jaxb:schemaBindings>
</jaxb:bindings>
.. many jaxb:bindings elements elided
</jaxb:bindings>
----------------------
Again, this has been working fine so far.
In order to implement async for this one request, I added the following
attribute to the top-level element:
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
I changed one bindings element to this:
----------------
<jaxb:bindings schemaLocation="...Request.xsd" node="/xsd:schema">
<jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
<jaxb:schemaBindings>
<jaxb:package name="..."/>
</jaxb:schemaBindings>
</jaxb:bindings>
----------------
When I run this, I get the following:
-------------------------
WSDLToJava Error: Thrown by JAXB: Unsupported binding namespace
"http://java.sun.com/xml/ns/jaxws". Perhaps you meant
"http://java.sun.com/xml/ns/jaxb/xjc"? at line 13 column 1 of schema
file:...
org.apache.cxf.tools.common.ToolException: Thrown by JAXB: Unsupported
binding namespace "http://java.sun.com/xml/ns/jaxws". Perhaps you meant
"http://java.sun.com/xml/ns/jaxb/xjc"? at line 13 column 1 of schema
file:...
at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error
(JAXBBindErrorListener.java:35)
at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerIm
pl.java:286)
--------------------------
Curiously, that "file:" path refers to the request schema specified in
the "bindings" element.
Looking at the CXF docs, I'm now confused by what namespace these
elements are supposed to be in.
Re: Confused about "enableAsyncMapping" and namespaces
Posted by Freeman Fang <fr...@gmail.com>.
Hi,
My comment inline
On 2010-11-6, at 上午9:19, KARR, DAVID (ATTSI) wrote:
> I have a bindings file that's working fine for generating synchronous
> calls. I now need to configure one that I can call async. I looked
> up
> the doc page that describes how to do this, and I found some issues
> with
> namespaces to be confusing. The errors I get when I run it confirm
> that
> I'm confused about it.
>
> I'm using "org.apache.cxf.tools.wsdlto.WSDLToJava"
>
> This is essentially the bindings.xml file I started with:
>
> ---------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> jaxb:version="2.0">
> <jaxb:globalBindings>
> <jaxb:serializable uid="1"/>
> </jaxb:globalBindings>
> .. many jaxb:bindings elements elided
> <jaxb:bindings schemaLocation="...Request.xsd" node="/xsd:schema">
> <jaxb:schemaBindings>
> <jaxb:package name="..."/>
> </jaxb:schemaBindings>
> </jaxb:bindings>
> .. many jaxb:bindings elements elided
> </jaxb:bindings>
> ----------------------
>
This is jaxb databinding file
> Again, this has been working fine so far.
>
> In order to implement async for this one request, I added the
> following
> attribute to the top-level element:
>
> xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
>
> I changed one bindings element to this:
> ----------------
> <jaxb:bindings schemaLocation="...Request.xsd" node="/xsd:schema">
> <jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
> <jaxb:schemaBindings>
> <jaxb:package name="..."/>
> </jaxb:schemaBindings>
> </jaxb:bindings>
> ----------------
<jaxws:enableAsyncMapping>true</jaxws:enableAsyncMapping>
is jaxws binding file, you shouldn't put it in jaxb:binding element,
this mismatch cause that error.
Here is a example to use jaxws bindings file
<bindings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="hello_world_async.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<bindings node="wsdl:definitions">
<enableAsyncMapping>true</enableAsyncMapping>
</bindings>
</bindings>
You may need take a look at jaxws_async example shipped with kit to
get more details
Freeman
>
> When I run this, I get the following:
>
> -------------------------
> WSDLToJava Error: Thrown by JAXB: Unsupported binding namespace
> "http://java.sun.com/xml/ns/jaxws". Perhaps you meant
> "http://java.sun.com/xml/ns/jaxb/xjc"? at line 13 column 1 of schema
> file:...
> org.apache.cxf.tools.common.ToolException: Thrown by JAXB: Unsupported
> binding namespace "http://java.sun.com/xml/ns/jaxws". Perhaps you
> meant
> "http://java.sun.com/xml/ns/jaxb/xjc"? at line 13 column 1 of schema
> file:...
> at
> org
> .apache.cxf.tools.wsdlto.databinding.jaxb.JAXBBindErrorListener.error
> (JAXBBindErrorListener.java:35)
> at
> com
> .sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerIm
> pl.java:286)
> --------------------------
>
> Curiously, that "file:" path refers to the request schema specified in
> the "bindings" element.
>
> Looking at the CXF docs, I'm now confused by what namespace these
> elements are supposed to be in.
--
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