Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I specify JAXB customizations externally to a WSDL file?
    primarykey
    data
    text
    <p>I have a WSDL file for a service implemented in .NET. I also have the same file with some "customizations" made by a 3rd-party to make the file tolerable to <code>wsimport</code>, mostly of the form:</p> <pre><code>&lt;s:annotation&gt; &lt;s:appinfo&gt; &lt;jaxb:property name="result"/&gt; &lt;/s:appinfo&gt; &lt;/s:annotation&gt; </code></pre> <p>I'd like to be able to process the <em>original</em> WSDL from the vendor plus these overrides, but I'd like to specify them externally. I see that I can use the <code>-b</code> option for <code>wsimport</code> for "binding files" and I've tried to write an override file that currently looks like this:</p> <pre><code>&lt;jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; &lt;jxb:bindings node="//xs:element[@name='MyElementResult']"&gt; &lt;jxb:property name="result"/&gt; &lt;/jxb:bindings&gt; &lt;/jxb:bindings&gt; </code></pre> <p>I've verified that "MyElementName" does in fact exist, in an element found here:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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/"&gt; [...] &lt;s:element name="MyElementResponse"&gt; &lt;s:complexType&gt; &lt;s:sequence&gt; &lt;s:element minOccurs="0" maxOccurs="1" name="MyElementResult" type="tns:Result" /&gt; </code></pre> <p>I'm getting this warning (and therefore no changes) from <code>wsimport</code>:</p> <pre><code>[ERROR] XPath evaluation of "//xs:element[@name='MyElementResult']" results in empty target node line 4 of file:/Users/..../wsdl/custom-bindings.xjb </code></pre> <p>Am I missing something in my declaration(s)? Do I have my XPath expression incorrect? If I get my XPath/overrides working, is it formatted correctly in order to achieve the same result as if I had edited the original WSDL?</p> <p>Is this even possible using external files, or will I have to re-modify any future versions of the WSDL with these same changes?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload