I have a WSDL file for a service implemented in .NET. I also have the same file with some โsettingsโ made by a third party to make the file valid for wsimport , mainly from the form:
<s:annotation> <s:appinfo> <jaxb:property name="result"/> </s:appinfo> </s:annotation>
I would like to be able to handle the source WSDL from the provider plus these overrides, but I would like to specify them from the outside. I see that I can use the -b option for wsimport to โbind filesโ, and I tried to write an override file that currently looks like this:
<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>
I checked that "MyElementName" really exists in the element found here:
<?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" />
I get this warning (and therefore no changes) from wsimport :
[ERROR] XPath evaluation of "//xs:element[@name='MyElementResult']" results in empty target node line 4 of file:/Users/..../wsdl/custom-bindings.xjb
Am I missing something in my ads? Do I have the wrong XPath expression? If I get my XPath / overrides, are they formatted correctly to achieve the same result as if I edited the original WSDL?
Is this possible using external files, or will I have to re-modify any future versions of WSDL with the same changes?
source share