Commit 384c3271 authored by Quxl's avatar Quxl

x

parent a1d9b6ce
...@@ -50,14 +50,10 @@ public class SAPServiceFactory { ...@@ -50,14 +50,10 @@ public class SAPServiceFactory {
private String getAbsolutePath(String WSDLPATH) { private String getAbsolutePath(String WSDLPATH) {
if(absolutePath == null) { if(absolutePath == null) {
synchronized (absolutePath) { ApplicationHome home = new ApplicationHome(getClass());
if(absolutePath == null) { File jarFile = home.getSource();
ApplicationHome home = new ApplicationHome(getClass()); File folder = jarFile.getParentFile();
File jarFile = home.getSource(); absolutePath = folder.getAbsolutePath();
File folder = jarFile.getParentFile();
absolutePath = folder.getAbsolutePath();
}
}
} }
return "file:///" + absolutePath + "/" + WSDLPATH; return "file:///" + absolutePath + "/" + WSDLPATH;
} }
...@@ -66,23 +62,19 @@ public class SAPServiceFactory { ...@@ -66,23 +62,19 @@ public class SAPServiceFactory {
public WSS4JOutInterceptor getWSS4JOutInterceptor() { public WSS4JOutInterceptor getWSS4JOutInterceptor() {
if(wss4JOutInterceptor == null) { if(wss4JOutInterceptor == null) {
synchronized (wss4JOutInterceptor) { Map<String, Object> pro = new HashMap<String, Object>();
if(wss4JOutInterceptor == null) { pro.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
Map<String, Object> pro = new HashMap<String, Object>(); pro.put(WSHandlerConstants.USER, username);
pro.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN); pro.put(WSHandlerConstants.PASSWORD_TYPE, PasswordType.PasswordText.name());
pro.put(WSHandlerConstants.USER, username); pro.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
pro.put(WSHandlerConstants.PASSWORD_TYPE, PasswordType.PasswordText.name()); public void handle(Callback[] callbacks) {
pro.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() { for (int i = 0; i < callbacks.length; i++) {
public void handle(Callback[] callbacks) { WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
for (int i = 0; i < callbacks.length; i++) { pc.setPassword(password);
WSPasswordCallback pc = (WSPasswordCallback) callbacks[i]; }
pc.setPassword(password);
}
}
});
wss4JOutInterceptor = new WSS4JOutInterceptor(pro);
} }
} });
wss4JOutInterceptor = new WSS4JOutInterceptor(pro);
} }
return wss4JOutInterceptor; return wss4JOutInterceptor;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment