I can not guess whats going wrong in your code .
may below code help you !!!!!
I retrieved soft coding in below manner
String softCodingKey = new String("JC550001");
Element softCodingRecord;
try {
//retrieve from SoftCoding record
softCodingRecord =
(Element)SoftCodingRecordAccess.getSoftCodingRecord(context,
softCodingKey);
if (softCodingRecord != null) {
//1. WS URL
String url =
SoftCodingRecordAccess.getSoftcodingRecordFieldvalue(context,
"endpoint",
softCodingRecord);
//2. username
String softCodingUsername =
SoftCodingRecordAccess.getSoftcodingRecordFieldvalue(context,
"username",
softCodingRecord);
//3. password
String softCodingPassword =
SoftCodingRecordAccess.getSoftcodingRecordFieldvalue(context,
"password",
softCodingRecord);
QName serviceName =
new QName("MCSeFMSSecurityAPI", "MCSeFMSSecurityAPI");
SecurityAPIPortType SecurityAPIManager = null;
if (url != null &&
((softCodingUsername == null) && (softCodingPassword ==
null))) {
SBFLogger.getInstance().debug(context,
"Only Softcoding URL is set");
URL wsdlLocation = new URL(url);
MCSeFMSSecurityService =
new MCSeFMSSecurityAPI(wsdlLocation, serviceName);
SecurityAPIManager =
MCSeFMSSecurityService.getSecurityAPIPortType();
} else if (url != null && softCodingUsername != null &&
softCodingPassword != null) {
SBFLogger.getInstance().debug(context,
"Softcoding URL , Username & Password are set");
MCSeFMSSecurityService =
new MCSeFMSSecurityAPI(SecurityAPIPortTypeClient.class.getResource("MCSeFMSSecurityAPI.wsdl"),
serviceName);
/*
HeaderHandler hh = new HeaderHandler();
hh.setSoftCodingUsername(softCodingUsername);
hh.setSoftCodingPassword(softCodingPassword);
SBFLogger.getInstance().debug(context,
"Username & Password are set in HeaderHandler");
HeaderHandlerResolver handlerResolver =
new HeaderHandlerResolver(hh);
MCSeFMSSecurityService.setHandlerResolver(handlerResolver);
*/
SecurityAPIManager =
MCSeFMSSecurityService.getSecurityAPIPortType();
/*
Map<String, Object> reqContext =
((BindingProvider)SecurityAPIManager).getRequestContext();
reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
url);
reqContext.put(BindingProvider.USERNAME_PROPERTY,
softCodingUsername);
reqContext.put(BindingProvider.PASSWORD_PROPERTY,
softCodingPassword); */
} else {
SBFLogger.getInstance().debug(context, "No Softcoding");
MCSeFMSSecurityService = new MCSeFMSSecurityAPI();
SecurityAPIManager =
MCSeFMSSecurityService.getSecurityAPIPortType();
}
Regards
Pintya