users@jax-ws.java.net

Re: Example custom-server.xml bindings file

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Wed, 16 Aug 2006 14:43:10 -0700

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
>