本文整理汇总了Java中org.oscm.app.contants.CTMGApiVersion类的典型用法代码示例。如果您正苦于以下问题:Java CTMGApiVersion类的具体用法?Java CTMGApiVersion怎么用?Java CTMGApiVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CTMGApiVersion类属于org.oscm.app.contants包,在下文中一共展示了CTMGApiVersion类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateVersion
import org.oscm.app.contants.CTMGApiVersion; //导入依赖的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: addVersionInformation
import org.oscm.app.contants.CTMGApiVersion; //导入依赖的package包/类
/**
* Helper method to add a version information into the header of the
* outbound SOAP message. The version information is read from a property
* file.
*
* @param service
* @return
*/
private Service addVersionInformation(Service service) {
ClientVersionHandler versionHandler = new ClientVersionHandler(
CTMGApiVersion.version);
return versionHandler.addVersionInformationToClient(service);
}