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.

Reply via email to