我有一个存储在字符串/字节数组中的wsdl。有没有办法从String或字节数组生成javax.wsdl.Definition?我检查了文档here,但找不到办法。
任何样品或指针?
答案 0 :(得分:1)
找到答案:
public void getWSDLDefinition(byte[] wsdl) {
try {
WSDLReader wsdlReader = javax.wsdl.factory.WSDLFactory.newInstance().newWSDLReader();
// switch off the verbose mode
wsdlReader.setFeature(JAVAX_WSDL_VERBOSE_MODE, false);
wsdlReader.setFeature("javax.wsdl.importDocuments", false);
Definition wsdlDefinition = wsdlReader.readWSDL(null, new InputSource(new ByteArrayInputStream(wsdl)));
} catch (Exception e) {}
}