Thanks Jim. I've figured out why it didn't work for me. It seems that this
binding file won't work because I am importing my type definitions (which
are in a seperate xsd file) as opposed to including them inline in the WSDL
document itself. Here's what the preamble of my WSDL looks like:
<?xml version="1.0" encoding="utf-8"?>
<definitions
targetNamespace="http://www.test.com/TestService/"
xmlns:tns="http://www.test.com/TestService/"
xmlns:test="http://www.test.com/test"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<import namespace="http://www.test.com/test" location="types.xsd"/>
...
I verified this by removing the import and in-lining my types, and
everything works.
My problem is that I don't know how to construct a binding file that works
when an import is used. Do I now need to specify a schemaLocation
attribute? If so, what is the value? And what would be the proper value for
the node attribute on the <jaxb:bindings> element in this case?
Could someone provide an example of a binding file that would work?
Thanks,
Jesse.
jim ma wrote:
>
> Hi Jesse,
>
> I just tried this binding file with hello_world.wsdl and it works.
>
> Can you check if there is some typo/error in your wsdl and make sure the
>
> xpath expression is right for your wsdl .
>
> Cheers
>
> Jim Ma
>
>
> On Sun, Mar 2, 2008 at 7:13 PM, Jesse McLaughlin <[EMAIL PROTECTED]>
> wrote:
>
>>
>> Hi there,
>>
>> I am trying to use CXF to generate a JAXB client from a WSDL, and I want
>> all
>> the generated objects to implement java.io.Serializable. To do this, I
>> pass
>> the following bindings file to WSDL2Java, using the -b option:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <jaxws:bindings node="wsdl:definitions/wsdl:types/xsd:schema"
>> xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
>> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>> <jaxb:globalBindings>
>> <jaxb:serializable/>
>> </jaxb:globalBindings>
>> </jaxws:bindings>
>>
>> When I run WSDL2Java, it gives me the following error:
>>
>> "WSDLToJava Error : Could not find any node with the XPath expression:
>> //wsdl:definitions/wsdl:types/xsd:schema"
>>
>> The client is generated normally if I don't pass this file. I am using
>> CXF
>> 2.0.4 with JDK5 on OS X.
>>
>> Note that I have read on JIRA that since CXF 2.0.3, neither the
>> wsdlLocation
>> nor schemaLocation attributes are required when doing this sort of
>> customization (https://issues.apache.org/jira/browse/CXF-1094).
>>
>> Does anyone know what I am doing wrong here or why it does not work?
>>
>> Thanks,
>> Jesse.
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15786637.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/WSDL2Java-error-when-using-%3Cjaxb%3Aserializable-%3E-binding-customization-tp15786637p15799909.html
Sent from the cxf-user mailing list archive at Nabble.com.