本文整理匯總了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);
}