private String getSOAPResponseXML(Object clientstub) { String returnValue = null; org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub)clientstub; Call call = stub._getCall(); if (call != null) { MessageContext ctx = call.getMessageContext(); // If I registered a handler // returnValue = (String) ctx.getProperty( ClientHandler.SOAP_RESPONSE ); // or use: try { Message msg = call.getResponseMessage(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); // NOTE: If we never get a response (a request handler throws an uncaught error // this can cause a java.lang.NullPointerException msg.writeTo(baos); returnValue = baos.toString(); } catch (java.io.IOException ex) { log.debug("Error in getSOAPResponseXML", ex); } catch (javax.xml.soap.SOAPException ex) { log.debug("Error in getSOAPResponseXML", ex); } } return returnValue; } // getSOAPResponseXML
protected void configureSecurity(Call call, WSDLActivityConfigurationBean bean) throws Exception { // If security settings require WS-Security - configure the axis call // with appropriate properties URI securityProfile = bean.getSecurityProfile(); if (securityProfile .equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_PLAINTEXTPASSWORD) || securityProfile .equals(SecurityProfiles.WSSECURITY_USERNAMETOKEN_DIGESTPASSWORD) || securityProfile .equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_PLAINTEXTPASSWORD) || securityProfile .equals(SecurityProfiles.WSSECURITY_TIMESTAMP_USERNAMETOKEN_DIGESTPASSWORD)) { UsernamePassword usernamePassword = getUsernameAndPasswordForService(bean, false); call.setProperty(Call.USERNAME_PROPERTY, usernamePassword.getUsername()); call.setProperty(Call.PASSWORD_PROPERTY, usernamePassword.getPasswordAsString()); usernamePassword.resetPassword(); } else if (securityProfile.equals(SecurityProfiles.HTTP_BASIC_AUTHN)){ // Basic HTTP AuthN - set HTTP headers // pathrecursion allowed UsernamePassword usernamePassword = getUsernameAndPasswordForService(bean, true); MessageContext context = call.getMessageContext(); context.setUsername(usernamePassword.getUsername()); context.setPassword(usernamePassword.getPasswordAsString()); usernamePassword.resetPassword(); } else { logger.error("Unknown security profile " + securityProfile); } }
/** * @param pFacade */ protected void initFacade(IFacade pFacade) { if (pFacade instanceof ExtendedFacade) { try { // get envelope SOAPEnvelope lEnvelope = mCall.getMessageContext().getResponseMessage().getSOAPEnvelope(); // instantite tc record provider TcRecordProvider lRecordProvider = new TcRecordProvider(); // extract records lRecordProvider.extractTcRecord(lEnvelope); // update facade ((ExtendedFacade) pFacade).setTcRecords(lRecordProvider.getTcRecord()); // instantite fedcatinfo provider FederatedCatalogInfoProvider lInfoProvider = new FederatedCatalogInfoProvider(); // extract fedcatinfo lInfoProvider.extractFedCatInfo(lEnvelope); // update facade ((ExtendedFacade) pFacade).setFedCatInfo(lInfoProvider.getFederatedCatalogIDs()); } catch (AxisFault axisFault) { LOG.error("Error setting up the facade security information."); LOG.error("Reason: {}", axisFault.getFaultReason()); LOG.error("Fault string: {}", axisFault.getFaultString()); } catch (SOAPException e) { LOG.error("Error setting up the facade security information."); LOG.error("Reason: {}", e.getMessage()); } } }
((org.apache.axis.Message)request).setMessageContext(call.getMessageContext()); Attachments attachments = ((org.apache.axis.Message) request).getAttachmentsImpl();
((org.apache.axis.Message)request).setMessageContext(call.getMessageContext()); Attachments attachments = ((org.apache.axis.Message) request).getAttachmentsImpl();
((org.apache.axis.Message)request).setMessageContext(call.getMessageContext()); Attachments attachments = ((org.apache.axis.Message) request).getAttachmentsImpl();
builder.withException(e); } finally { MessageContext messageContext = stub._getCall().getMessageContext(); RequestInfo.Builder requestInfoBuilder = new RequestInfo.Builder() .withMethodName(stub._getCall().getOperationName().getLocalPart())
builder.withException(e); } finally { MessageContext messageContext = stub._getCall().getMessageContext(); RequestInfo.Builder requestInfoBuilder = new RequestInfo.Builder() .withMethodName(stub._getCall().getOperationName().getLocalPart())