use of org.apache.axis2.databinding.types.soapencoding.Integer in project pentaho-platform by pentaho.
the class AbstractAxisServiceContentGenerator method processAxisFault.
/**
* Handles processing of Axis exceptions.
*
* @param msgContext
* The message context that experienced an error
* @param out
* The output stream to write to
* @param e
* The error that occurred
*/
protected void processAxisFault(MessageContext msgContext, OutputStream out, Throwable e) {
// $NON-NLS-1$
IParameterProvider pathParams = parameterProviders.get("path");
// is this HTTP?
boolean http = msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE) != null;
if (http) {
// $NON-NLS-1$
HttpServletResponse res = (HttpServletResponse) pathParams.getParameter("httpresponse");
// If the fault is not going along the back channel we should be 202ing
if (AddressingHelper.isFaultRedirected(msgContext)) {
res.setStatus(HttpServletResponse.SC_ACCEPTED);
} else {
// set the status of the HTTP response
String status = (String) msgContext.getProperty(Constants.HTTP_RESPONSE_STATE);
try {
if (status == null) {
res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} else {
int sc = Integer.parseInt(status);
if (sc >= 400) {
res.sendError(sc);
} else {
res.setStatus(sc);
}
}
} catch (IOException e1) {
if (status == null) {
res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} else {
int sc = Integer.parseInt(status);
res.setStatus(sc);
}
}
AxisBindingOperation axisBindingOperation = (AxisBindingOperation) msgContext.getProperty(Constants.AXIS_BINDING_OPERATION);
if (axisBindingOperation != null) {
AxisBindingMessage fault = axisBindingOperation.getFault((String) msgContext.getProperty(Constants.FAULT_NAME));
if (fault != null) {
Integer code = (Integer) fault.getProperty(WSDL2Constants.ATTR_WHTTP_CODE);
if (code != null) {
res.setStatus(code.intValue());
}
}
}
}
}
try {
// now process the fault
handleFault(msgContext, out, http, e);
} catch (IOException axisFault) {
// $NON-NLS-1$
String message = Messages.getInstance().getErrorString("WebServiceContentGenerator.ERROR_0003_PROCESSING_FAULT");
getLogger().error(message, axisFault);
}
}
use of org.apache.axis2.databinding.types.soapencoding.Integer in project carbon-business-process by wso2.
the class BPELBindingContextImpl method deactivateMyRoleEndpoint.
public void deactivateMyRoleEndpoint(QName processID, Endpoint endpoint) {
if (log.isDebugEnabled()) {
log.debug("Deactivating my role endpoint for process: " + processID + " service: " + endpoint.serviceName + " and port: " + endpoint.portName);
}
Integer tenantId = bpelServer.getMultiTenantProcessStore().getTenantId(processID);
BPELProcessProxy processProxy = getBPELProcessProxy(tenantId.toString(), endpoint.serviceName, endpoint.portName);
if (processProxy != null) {
ProcessConfigurationImpl processConf = (ProcessConfigurationImpl) processProxy.getProcessConfiguration();
if (processConf.isUndeploying()) {
AxisService service = processProxy.getAxisService();
Parameter param = service.getParameter(CarbonConstants.PRESERVE_SERVICE_HISTORY_PARAM);
param.setValue("false");
}
removeBPELProcessProxyAndAxisService(tenantId.toString(), endpoint.serviceName, endpoint.portName);
updateServiceList(((ProcessConfigurationImpl) processProxy.getProcessConfiguration()).getTenantId(), endpoint, STATE.REMOVE);
serviceEprMap.remove(processProxy);
}
// else this method also get called for the retired processes where there could be an
// active version of the same process type. Since there is only one service for a
// particular process type, processProxy will be null for all the endpoints except for 1.
}
use of org.apache.axis2.databinding.types.soapencoding.Integer in project carbon-business-process by wso2.
the class BPMNDeployer method undeploy.
/**
* Undeployment operation for Bpmn Deployer
*
* @param bpmnArchivePath archivePatch
* @throws DeploymentException Deployment failure will result in this exception
*/
public void undeploy(String bpmnArchivePath) throws DeploymentException {
if (isWorkerNode()) {
return;
}
if (System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP) != null && Boolean.parseBoolean(System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP)) || System.getProperty(BPMNConstants.RESOLVE_DEPLOYMENT_SYS_PROP) == null) {
File bpmnArchiveFile = new File(bpmnArchivePath);
if (bpmnArchiveFile.exists()) {
if (log.isTraceEnabled()) {
log.trace("BPMN package: " + bpmnArchivePath + " exists in the deployment folder. " + "Therefore, this can be an update of the package and the undeployment will be aborted.");
}
return;
}
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
log.info("Undeploying BPMN archive " + bpmnArchivePath + " for tenant: " + tenantId);
String deploymentName = FilenameUtils.getBaseName(bpmnArchivePath);
try {
tenantRepository.undeploy(deploymentName, true);
} catch (BPSFault be) {
String errorMsg = "Error un deploying BPMN Package " + deploymentName;
throw new DeploymentException(errorMsg, be);
}
}
}
use of org.apache.axis2.databinding.types.soapencoding.Integer in project carbon-business-process by wso2.
the class BPELProcessProxy method createMessageExchange.
private MyRoleMessageExchange createMessageExchange(final MessageContext inMessageContext) {
Integer tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
MyRoleMessageExchange messageExchange;
String messageId = new GUID().toString();
messageExchange = odeBpelServer.getEngine().createMessageExchange("" + messageId, serviceName, inMessageContext.getAxisOperation().getName().getLocalPart(), null, tenantId.toString());
if (log.isDebugEnabled()) {
log.debug("ODE routed to portType " + messageExchange.getPortType() + " operation " + messageExchange.getOperation() + " from service " + serviceName);
}
messageExchange.setProperty("isTwoWay", Boolean.toString(inMessageContext.getAxisOperation() instanceof TwoChannelAxisOperation));
return messageExchange;
}
Aggregations