本文整理匯總了Java中javax.wsdl.factory.WSDLFactory.newWSDLReader方法的典型用法代碼示例。如果您正苦於以下問題:Java WSDLFactory.newWSDLReader方法的具體用法?Java WSDLFactory.newWSDLReader怎麽用?Java WSDLFactory.newWSDLReader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.wsdl.factory.WSDLFactory
的用法示例。
在下文中一共展示了WSDLFactory.newWSDLReader方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: validateVersion
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的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: getWSDL11Parser
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
public static synchronized WSDL11Parser getWSDL11Parser(String wsdlLocation) throws WSDLException, IOException {
WSDL11Parser parser = null;
if (parsers == null) {
parsers = new TreeMap<String, WSDL11Parser>();
} else {
parser = parsers.get(wsdlLocation);
}
if (parser == null) {
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
Definition definition = reader.readWSDL(wsdlLocation);
parser = new WSDL11Parser(definition);
parsers.put(wsdlLocation, parser);
}
return parser;
}
示例3: readWSDL
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
/**
* Read the WSDL document and create a WSDL Definition.
*
* @param wsdlLocation location pointing to a WSDL XML definition.
* @return the Definition.
* @throws WSDLException If unable to read the WSDL
*/
public static Definition readWSDL(final String wsdlLocation) throws WSDLException {
InputStream inputStream = null;
try {
URL url = getURL(wsdlLocation);
inputStream = url.openStream();
InputSource source = new InputSource(inputStream);
source.setSystemId(url.toString());
Document wsdlDoc = XMLHelper.getDocument(source);
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlFactory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
return reader.readWSDL(url.toString(), wsdlDoc);
} catch (Exception e) {
throw new WSDLException(WSDLException.OTHER_ERROR,
SOAPMessages.MESSAGES.unableToReadWSDL(wsdlLocation), e);
} finally {
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException ioe) {
LOGGER.error(ioe);
}
}
}
}
示例4: createWSDLDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
static Definition createWSDLDefinition(URL wsdlURL) {
Definition wsdlDefinition = null;
try {
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
wsdlDefinition = reader.readWSDL(wsdlURL.toString());
}
catch (Exception e) {
TestLogger.logger
.debug("*** ERROR ***: Caught exception trying to create WSDL Definition: " +
e);
e.printStackTrace();
}
return wsdlDefinition;
}
示例5: createWSDLDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
static public Definition createWSDLDefinition(URL wsdlURL) {
Definition wsdlDefinition = null;
try {
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
wsdlDefinition = reader.readWSDL(wsdlURL.toString());
wsdlDefinition.setDocumentBaseURI(wsdlURL.toString());
}
catch (Exception e) {
System.out.println(
"*** ERROR ***: Caught exception trying to create WSDL Definition: " + e);
e.printStackTrace();
}
return wsdlDefinition;
}
示例6: readWsdl
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
public static Definition readWsdl(URL wsdlURL) {
Definition definition = null;
try {
if (wsdlURL != null) {
WSDLFactory factory = WSDLFactory.newInstance();
WSDLReader reader = factory.newWSDLReader();
//reader.setFeature("javax.wsdl.importDocuments", true);
definition = reader.readWSDL(null, wsdlURL.toString());
}
}
catch (Throwable t) {
Engine.logEngine.error("(WSDLUtils) error while reading WSDL", t);
}
return definition;
}
示例7: parseWSDLDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
/**
* Parse the WSDL definition using WSDL4J.
*/
protected Definition parseWSDLDefinition() throws WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlFactory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
reader.setFeature("javax.wsdl.importDocuments", true);
Definition definition = reader.readWSDL(this.wsdlLocation);
return definition;
}
示例8: getWSDLDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
private Definition getWSDLDefinition(final String wsdlLocation) throws Exception
{
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
return wsdlReader.readWSDL(null, wsdlLocation);
}
示例9: getWSDLDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
private Definition getWSDLDefinition(String wsdlLocation) throws Exception
{
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
wsdlReader.setFeature("javax.wsdl.importDocuments", false);
wsdlReader.setFeature("javax.wsdl.verbose", false);
Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
return definition;
}
示例10: getWSDLDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
private Definition getWSDLDefinition(String wsdlLocation) throws Exception
{
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
Definition definition = wsdlReader.readWSDL(null, wsdlLocation);
return definition;
}
示例11: parseWSDLDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
/**
* Parse the WSDL definition using WSDL4J.
*/
private Definition parseWSDLDefinition() throws WSDLException {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlFactory.newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
reader.setFeature("javax.wsdl.importDocuments", true);
Definition definition = reader.readWSDL(this.wsdlLocation);
return definition;
}
示例12: WSDLMetadataProcessor
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
public WSDLMetadataProcessor(String wsdl) throws TranslatorException {
try {
WSDLFactory wsdlFactory = WSDLFactory.newInstance();
WSDLReader reader = wsdlFactory.newWSDLReader();
this.definition = reader.readWSDL(wsdl);
} catch (WSDLException e) {
throw new TranslatorException(e);
}
}
示例13: getDefinition
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的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);
}
}
示例14: load
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的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")));
}
示例15: readWSDL
import javax.wsdl.factory.WSDLFactory; //導入方法依賴的package包/類
public Definition readWSDL(String fileName) throws WSDLException {
Definition wsdlDefinition = null;
WSDLFactory factory = WSDLFactoryImpl.newInstance();
WSDLReader reader = factory.newWSDLReader();
try {
File f = new File(fileName);
URL url = null;
if (f.exists()) {
log.info(fileName + " as a local file doesn't exist.");
url = f.toURI().toURL();
} else {
url = ClassUtil.getResource(fileName, this.getClass());
}
if (url==null){
log.info(fileName + " as a class path resource doesn't exist.");
throw new WSDLException("null input", fileName);
}
URI uri = url.toURI();
WSDLLocator locator = new WSDLLocatorImpl(uri);
wsdlDefinition = reader.readWSDL(locator);
} catch (URISyntaxException e) {
log.error(e.getMessage(), e);
} catch (MalformedURLException ex) {
log.error(ex.getMessage(), ex);
}
return wsdlDefinition;
}