简体   繁体   中英

Generate WSDL with XSD schema from JAX-WS

I have a JAX-WS annotated Webservice, and when I deploy it into a WildFly 8.1.0 Final I have something like this:

<wsdl:types>
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.viactt.pt" targetNamespace="http://www.viactt.pt" version="1.0">
    <xs:import namespace="http://www.viactt.pt"/>
    <xs:element name="wsAccountArray" type="ns1:wsAccountArray"/>
  </xs:schema>
</wsdl:types>

when what I want is something like this:

<wsdl:types>
  <xsd:schema>
    <xsd:import namespace="http://www.viactt.pt" schemaLocation="ViaCTTIntegrationService_schema1.xsd"/>
  </xsd:schema>
</wsdl:types>

So, basically, I want the WildFly/JAX-WS to put some types in a separate XSD schema file instead of just showing them in the WSDL file.

Can I do this via some annotation or via some configuration file?

Us XJC plugin of maven(maven-jaxb2-plugin) to re-generate the JAXB object from wsdl . Click Here for the Tutorial. You can also see . One more blog is having complete tutorial of it. Click Here to see.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM