public static ServiceBean serviceBeanRequest(String serviceMapStr)
throws XmlException, IOException {
int notAfterInactiveMinutes = 15;
ServiceBean serviceBean = new ServiceBean();
ServiceMapDocument serviceMapDocument = ServiceMapDocument.Factory
.parse(new StringReader(serviceMapStr));
ServiceMapType serviceMapType = serviceMapDocument.getServiceMap();
ServiceType serviceType = serviceMapType.getService();
serviceBean.setServiceDescription(serviceType.getServiceDescription());
if (serviceMapType.getLifeTime() != null) {
notAfterInactiveMinutes = serviceMapType.getLifeTime()
.getNotAfterInactiveMinutes();
}
MethodType method = findOperationWithApplication(serviceMapType);
ApplicationType appType = method.getApplication();
ApplicationName appxbeanName = method.getApplication()
.getApplicationName();
String appName = new QName(appxbeanName.getTargetNamespace(),
appxbeanName.getStringValue()).toString();
MethodBean methodBean = new MethodBean(method.getMethodName(), method
.getMethodDescription(), method.isSetStageOutputDataFiles(),
method.isSetForceFileStagingToWorkDir(), appType
.isSetUseLEADNameListFile(), appType
.isSetUseLEADNameListPropertiesFile());
InputParameterType[] inputparams = method.getInputParameterArray();
for (int index = 0; index < inputparams.length; index++) {
InputParameterType inputParameterType = inputparams[index];
methodBean.addInputParms(new ParamObject(inputParameterType
.getParameterName(), inputParameterType.getParameterType()
.toString(), index, inputParameterType
.getParameterDescription()));
}
OutputParameterType[] outparams = method.getOutputParameterArray();
for (int index = 0; index < outparams.length; index++) {
OutputParameterType outputParameterType = outparams[index];
methodBean.addOutputParms(new ParamObject(outputParameterType
.getParameterName(), outputParameterType.getParameterType()
.toString(), index, outputParameterType
.getParameterDescription()));
}
serviceBean.setApplicationName(appName);
serviceBean.setServiceName(serviceMapType.getService().getServiceName()
.getStringValue());
serviceBean.setApplicationName(appxbeanName.getStringValue());
serviceBean.setNotAfterInactiveMinutes(notAfterInactiveMinutes);
serviceBean.setMethodBean(methodBean);
serviceBean.setObjectNamespace(serviceMapType.getService()
.getServiceName().getTargetNamespace());
return serviceBean;
}