我正在开发的应用程序调用了许多webservice。就在最近,我集成了另一个web服务,它需要wsit client.xml来进行Soap身份验证。
现在可以工作了,但是所有其他的SOAP服务都停止了工作。
每当调用它们中的任何一个时,我都会看到这样的消息
INFO: WSP5018: Loaded WSIT configuration from file: jar:file:/opt/atlasconf/atlas.20130307/bin/soap-sdd-1.0.0.jar!/META-INF/wsit-client.xml.我怀疑这就是导致服务调用失败的原因。
对于某些soap服务调用,如何使wsit client.xml被忽略?
谢谢
发布于 2013-04-08 20:22:05
通过使用Container和Loader为wsit client.xml配置动态位置修复了此问题。这样它就不会自动加载。为此,我首先为应用程序实现了一个容器,如下所示
public class WsitClientConfigurationContainer extends Container {
private static final String CLIENT_CONFIG = "custom/location/wsit-client.xml";
private final ResourceLoader loader = new ResourceLoader() {
public URL getResource(String resource) {
return getClass().getClassLoader().getResource(CLIENT_CONFIG);
}
};
@Override
public <T> T getSPI(Class<T> spiType) {
if (spiType == ResourceLoader.class) {
return spiType.cast(loader);
}
return null;
} }
然后,为了在代码中使用它,我这样做
URL WSDL_LOCATION = this.getClass().getResource("/path/to/wsdl/mysvc.wsdl");
WSService.InitParams initParams = new WSService.InitParams();
initParams.setContainer(new WsitClientConfigurationContainer());
secGtwService = WSService.create(WSDL_LOCATION, SECGTWSERVICE_QNAME, initParams);它就像魔法一样工作
https://stackoverflow.com/questions/15837201
复制相似问题