/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Patches WSDL with the correct endpoint address and the relative paths
* to other documents.
*
* @author Jitendra Kotamraju
* @author Kohsuke Kawaguchi
*/
//
// fields accumulated as we parse through documents
//
// true inside <wsdl:service>/<wsdl:part>/<wsa:EndpointReference>
private boolean inEpr;
// true inside <wsdl:service>/<wsdl:part>/<wsa:EndpointReference>/<wsa:Address>
private boolean inEprAddress;
/**
* Creates a {@link WSDLPatcher} for patching WSDL.
*
* @param portAddressResolver
* address of the endpoint is resolved using this docResolver.
* @param docResolver
* Must not be null.
*/
this.docResolver = docResolver;
}
// patch this attribute value.
if (actualPath == null) {
return; // skip this attribute to leave it up to "implicit reference".
}
+" with absolute location:"+actualPath);
writeAttribute(i, actualPath);
return;
}
writeAttribute(i, value);
return;
}
}
}
super.handleAttribute(i);
}
/**
* Writes out an {@code i}-th attribute but with a different value.
* @param i attribute index
* @param value attribute value
* @throws XMLStreamException when an error encountered while writing attribute
*/
else
}
}
}
}
inEpr = true;
}
if (inEpr) {
inEprAddress = true;
}
}
super.handleStartElement();
}
serviceName = null;
if (inEpr) {
inEpr = false;
}
if (inEprAddress) {
+ " address with "+value);
}
inEprAddress = false;
}
}
super.handleEndElement();
}
// handleCharacters() may be called multiple times.
if (inEprAddress) {
// will write the address with <wsa:Address> end element
return;
}
}
super.handleCharacters();
}
/**
* Returns the location to be placed into the generated document.
*
* @param relPath relative URI to be resolved
* @return
* null to leave it to the "implicit reference".
*/
}
/**
* For the given service, port names it matches the correct endpoint and
* reutrns its endpoint address
*
* @return returns the resolved endpoint address
*/
}
}