How to customize the schema inlined inside an imported WSDL

蓝咒 提交于 2019-12-01 17:59:44

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!