How to customize the schema inlined inside an imported WSDL

前端 未结 2 1756
Happy的楠姐
Happy的楠姐 2021-01-19 05:52

I have a.wsdl & b.wsdl where a.wsdl imports b.wsdl. Now I have to customize the schema inside b.wsdl using wsimport and JAXB. but using below customizat

相关标签:
2条回答
  • 2021-01-19 06:02

    Have you tried adding the following attributes to the <jaxws:bindings> element?

     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    

    and

     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    

    You're referencing the xsd and wsdl namespaces in your xpath expression, but until you define the URI's for them, they won't match up with the URI's in the target documents.

    0 讨论(0)
  • 2021-01-19 06:19

    After going through given website I modified the external binding file to use wsdlLocation="b.wsdl" instead of node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='b']" which did the magic.

    This will make sure that the inline schema defined in WSDL will customized as required.

    <bindings 
     xmlns="http://java.sun.com/xml/ns/jaxb"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl"
     version="2.0">    
      <bindings wsdlLocation="b.wsdl">
        <globalBindings>
          <javaType name="java.util.Calendar" xmlType="xsd:dateTime"
            parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
            printMethod="javax.xml.bind.DatatypeConverter.printDate"
          />
         </globalBindings>  
      </bindings>
    </bindings>
    

    http://fusesource.com/docs/framework/2.1/jaxws/JAXWSCustomTypeMappingOverview.html

    0 讨论(0)
提交回复
热议问题