本文整理匯總了Java中javax.wsdl.xml.WSDLReader.setExtensionRegistry方法的典型用法代碼示例。如果您正苦於以下問題:Java WSDLReader.setExtensionRegistry方法的具體用法?Java WSDLReader.setExtensionRegistry怎麽用?Java WSDLReader.setExtensionRegistry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.wsdl.xml.WSDLReader
的用法示例。
在下文中一共展示了WSDLReader.setExtensionRegistry方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validateVersion
import javax.wsdl.xml.WSDLReader; //導入方法依賴的package包/類
void validateVersion(String wsdlUrl) {
WSDLLocator locator = new BasicAuthWSDLLocator(wsdlUrl, null, null);
WSDLFactory wsdlFactory;
Definition serviceDefinition;
try {
wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
// avoid importing external documents
wsdlReader.setExtensionRegistry(new WSVersionExtensionRegistry());
serviceDefinition = wsdlReader.readWSDL(locator);
Element versionElement = serviceDefinition
.getDocumentationElement();
if (!CTMGApiVersion.version.equals(versionElement.getTextContent())) {
LOGGER.warn("Web service mismatches and the version value, expected: "
+ CTMGApiVersion.version
+ " and the one got from wsdl: "
+ versionElement.getTextContent());
}
} catch (WSDLException e) {
LOGGER.warn("Remote wsdl cannot be retrieved from CT_MG. [Cause: "
+ e.getMessage() + "]", e);
}
}
示例2: readInTheWSDLFile
import javax.wsdl.xml.WSDLReader; //導入方法依賴的package包/類
/**
* Read the WSDL file
*
* @param uri
* @throws WSDLException
*/
public Definition readInTheWSDLFile(final String uri) throws WSDLException {
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature("javax.wsdl.importDocuments", true);
ExtensionRegistry extReg = WSDLFactory.newInstance().newPopulatedExtensionRegistry();
extReg.registerExtensionAttributeType(Input.class,
new QName(AddressingConstants.Final.WSAW_NAMESPACE, AddressingConstants.WSA_ACTION),
AttributeExtensible.STRING_TYPE);
extReg.registerExtensionAttributeType(Output.class,
new QName(AddressingConstants.Final.WSAW_NAMESPACE, AddressingConstants.WSA_ACTION),
AttributeExtensible.STRING_TYPE);
reader.setExtensionRegistry(extReg);
return reader.readWSDL(uri);
}
示例3: getDefinition
import javax.wsdl.xml.WSDLReader; //導入方法依賴的package包/類
public static Definition getDefinition(IFile pathToWsdl) throws CoreException {
try {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader newWSDLReader = wsdlFactory.newWSDLReader();
newWSDLReader.setExtensionRegistry(wsdlFactory.newPopulatedExtensionRegistry());
newWSDLReader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false);
return newWSDLReader.readWSDL(pathToWsdl.getLocationURI().toString());
} catch (WSDLException e) {
throw getCoreException(null, e);
}
}
示例4: load
import javax.wsdl.xml.WSDLReader; //導入方法依賴的package包/類
public static Definition load(String wsdlLocation, String filenamePrefix) throws InvocationTargetException, WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader newWSDLReader = wsdlFactory.newWSDLReader();
newWSDLReader.setExtensionRegistry(wsdlFactory.newPopulatedExtensionRegistry());
newWSDLReader.setFeature(com.ibm.wsdl.Constants.FEATURE_VERBOSE, false);
return newWSDLReader.readWSDL(new InMemoryWSDLLocator(wsdlLocation, new WSDLLoader().load(wsdlLocation, filenamePrefix
+ "%d.wsdl")));
}
示例5: getReader
import javax.wsdl.xml.WSDLReader; //導入方法依賴的package包/類
/**
* Get a WSDLReader.
*
* @return WSDLReader.
* @throws WSDLException on error.
*/
private WSDLReader getReader() throws WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry();
wsdlReader.setExtensionRegistry(registry);
wsdlReader.setFeature("javax.wsdl.verbose", true);
wsdlReader.setFeature("javax.wsdl.importDocuments", true);
return wsdlReader;
}
示例6: getReader
import javax.wsdl.xml.WSDLReader; //導入方法依賴的package包/類
/**
* Get a WSDLReader.
*
* @return WSDLReader.
* @throws WSDLException
* on error.
*/
private WSDLReader getReader() throws WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
ExtensionRegistry registry = wsdlFactory.newPopulatedExtensionRegistry();
wsdlReader.setExtensionRegistry( registry );
wsdlReader.setFeature( "javax.wsdl.verbose", true );
wsdlReader.setFeature( "javax.wsdl.importDocuments", true );
return wsdlReader;
}