Hello Jitendra,
Thanks for responding. I tried to generate the code using your <bindings> entry, and wsimport still complains with the expression resulting in an empty target node. In the JAX-WS RI, there's a sample WSDL that imports another XSD file. It's located in /samples/wsimport_catalog. The files are HelloService.wsdl and HelloTypes.xsd. Would it be possible to provide a custom-server.xml for this example that puts the common types (from the imported XSD) into a separate package? That particular sample application doesn't provide a bindings file, unfortunately.
Thanks,
Ryan
________________________________
From: Jitendra Kotamraju [mailto:Jitendra.Kotamraju_at_Sun.COM]
Sent: Wed 8/16/2006 5:43 PM
To: users_at_jax-ws.dev.java.net
Subject: Re: Example custom-server.xml bindings file
For specifying one package for everything, you don't even require a
customization file.
wsimport -p com.myservice.generated.server MyService.wsdl
Yes, if you want to customize packages w.r.t namespaces then you require
customization files. I think your "node" is incorrect. Something like
the following should work for you.
For e.g:
<jaxws:bindings
node="ns1:definitions/ns1:types/xs:schema[@targetNamespace='
http://www.company.com/MyService/Common']"
xmlns:xs="
http://www.w3.org/2001/XMLSchema"
xmlns:ns1="
http://www.company.com/MyService">
<ns2:schemaBindings xmlns:ns2="
http://java.sun.com/xml/ns/jaxb">
<ns2:package name="com.service.common"/>
</ns2:schemaBindings>
</jaxws:bindings>
Jitu
Ryan LeCompte wrote:
> So I'm getting a little further along with this, however I'm still
> unable to make the imported XSD types written into their own specific
> package. Take a look at my custom-server.xml bindings file:
>
> <bindings
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> wsdlLocation="TestService.wsdl"
> xmlns="http://java.sun.com/xml/ns/jaxws">
> <bindings node="wsdl:definitions">
> <package name="com.service.core"/>
> </bindings>
> <bindings
> node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='http://www.company.com/MyService]">
> <jaxb:schemaBindings>
> <jaxb:package name="com.service.core"/>
> </jaxb:schemaBindings>
> </bindings>
> <bindings
> node="xsd:schema[@targetNamespace='http://www.company.com/MyService/Common]">
> <jaxb:schemaBindings>
> <jaxb:package name="com.service.common"/>
> </jaxb:schemaBindings>
> </bindings>
> </bindings>
>
> And I get the following error:
>
> [wsimport] error: XPath evaluation of
> "xsd:schema[@targetNamespace='http://www.company.com/MyService/Common']"
> results in empty target node
>
> Notice that the namespaces of the main wsdl and imported xsd are
> different. Any help is appreciated.
>
> Thanks,
> Ryan
>
>
> ------------------------------------------------------------------------
> *From:* Ryan LeCompte
> *Sent:* Wed 8/16/2006 9:35 AM
> *To:* users_at_jax-ws.dev.java.net
> *Subject:* Example custom-server.xml bindings file
>
> Hello all,
>
> Does anyone have any example custom-server.xml bindings file for a
> WSDL that uses xsd:import in the WSDL file to import an XSD file? I'm
> having a hard time translating the following JWSDP 1.6 config.xml file
> into a proper customer-server.xml bindings file:
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
> <wsdl location="MyService.wsdl"
> packageName="com.myservice.generated.server">
> <namespaceMappingRegistry>
> <namespaceMapping
> namespace="http://www.company.com/services/common"
> packageName="com.myservice.common.generated.server"/>
> </namespaceMappingRegistry>
> </wsdl>
> </configuration>
> Thanks,
> Ryan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
For additional commands, e-mail: users-help_at_jax-ws.dev.java.net