6

.NET で実装されたサービスの WSDL ファイルがあります。私はまた、ファイルを許容できるようにするためにサードパーティによって作成されたいくつかの「カスタマイズ」を含む同じファイルを持っていますwsimport。ほとんどの形式は次のとおりです。

<s:annotation>
  <s:appinfo>
    <jaxb:property name="result"/>
  </s:appinfo>
</s:annotation>

ベンダーからの元のWSDL とこれらのオーバーライドを処理できるようにしたいのですが、それらを外部から指定したいと考えています。-b「ファイルのバインド」のオプションを使用できることがわかり、wsimport現在次のようなオーバーライド ファイルを作成しようとしました。

<jxb:bindings version="1.0"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <jxb:bindings node="//xs:element[@name='MyElementResult']">
    <jxb:property name="result"/>
  </jxb:bindings>
</jxb:bindings>

ここにある要素に「MyElementName」が実際に存在することを確認しました。

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
     xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
     xmlns:tns="vendor-uri"
     xmlns:s="http://www.w3.org/2001/XMLSchema"
     xmlns:s2="http://microsoft.com/wsdl/types/"
     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
     xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
     targetNamespace="vendor-namespace"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

  [...]
  <s:element name="MyElementResponse">
    <s:complexType>
      <s:sequence>
        <s:element minOccurs="0" maxOccurs="1" name="MyElementResult" type="tns:Result" />

からこの警告が表示されます (したがって、変更はありません) wsimport

[ERROR] XPath evaluation of "//xs:element[@name='MyElementResult']" results in empty target node
  line 4 of file:/Users/..../wsdl/custom-bindings.xjb

宣言に何か不足がありますか? XPath 式が間違っていますか? XPath/オーバーライドが機能するようになった場合、元の WSDL を編集した場合と同じ結果を得るために、XPath/オーバーライドは正しくフォーマットされていますか?

これは外部ファイルを使用しても可能ですか? または、同じ変更を加えて WSDL の将来のバージョンを再変更する必要がありますか?

4

1 に答える 1