本文整理匯總了Java中org.apache.axiom.soap.SOAPMessage類的典型用法代碼示例。如果您正苦於以下問題:Java SOAPMessage類的具體用法?Java SOAPMessage怎麽用?Java SOAPMessage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SOAPMessage類屬於org.apache.axiom.soap包,在下文中一共展示了SOAPMessage類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addExchange
import org.apache.axiom.soap.SOAPMessage; //導入依賴的package包/類
public void addExchange(URL request, URL response) throws IOException {
SOAPMessage requestMessage;
InputStream in = request.openStream();
try {
requestMessage = OMXMLBuilderFactory.createSOAPModelBuilder(domMetaFactory, in, null).getSOAPMessage();
requestMessage.build();
} finally {
in.close();
}
requestMatcher.add(new Exchange((Document)requestMessage, new CannedResponse(response)));
}
示例2: signSoapEnvelope
import org.apache.axiom.soap.SOAPMessage; //導入依賴的package包/類
/**
* Signs the Axis 2 envelope using Spring Wss4jSecurityInterceptor defined in applicationContext-security.xml
* @throws WSClientException
*/
public SOAPEnvelope signSoapEnvelope(SOAPEnvelope envelope) throws WSClientException{
logger.debug("signSoapEnvelope START");
try {
//create SOAP factory used to generate SOAPMessages and AxiomSoapMessages
SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
SOAPMessage apacheAxiomSoapMessage = soapFactory.createSOAPMessage();
AxiomSoapMessage springAxiomSoapMessage = new AxiomSoapMessage(soapFactory);
//set the apacheAxiomSoapMessage envleope
apacheAxiomSoapMessage.setSOAPEnvelope(envelope);
springAxiomSoapMessage.setAxiomMessage(apacheAxiomSoapMessage);
//create a new Spring WS Message Context with the request message builded from the axis 2 envelope
DefaultMessageContext springMessageContext = new DefaultMessageContext(springAxiomSoapMessage, new AxiomSoapMessageFactory());
//get the Wss4jSecurityInterceptor and sign the request message
Wss4jSecurityInterceptor wss4jSecurityInterceptor = (Wss4jSecurityInterceptor) TSContext.getApplicationContext().getBean(wsSecurityInterceptorBean);
wss4jSecurityInterceptor.handleRequest(springMessageContext);
springAxiomSoapMessage = (AxiomSoapMessage) springMessageContext.getRequest();
envelope = springAxiomSoapMessage.getAxiomMessage().getSOAPEnvelope();
logger.debug("signSoapEnvelope END");
return envelope;
} catch (Exception exc) {
throw new WSClientException(ICodeException.REPORTS_WSCLIENT_SIGN_REQUEST_MESSAGE, exc);
}
}
示例3: signSoapEnvelope
import org.apache.axiom.soap.SOAPMessage; //導入依賴的package包/類
/**
* Signs the Axis 2 envelope using Spring Wss4jSecurityInterceptor defined in applicationContext-security.xml
* @throws WSClientException
*/
public SOAPEnvelope signSoapEnvelope(SOAPEnvelope envelope) throws WSClientException{
logger.debug("signSoapEnvelope START");
try {
//create SOAP factory used to generate SOAPMessages and AxiomSoapMessages
SOAPFactory soapFactory = OMAbstractFactory.getSOAP11Factory();
SOAPMessage apacheAxiomSoapMessage = soapFactory.createSOAPMessage();
AxiomSoapMessage springAxiomSoapMessage = new AxiomSoapMessage(soapFactory);
//set the apacheAxiomSoapMessage envleope
apacheAxiomSoapMessage.setSOAPEnvelope(envelope);
springAxiomSoapMessage.setAxiomMessage(apacheAxiomSoapMessage);
//create a new Spring WS Message Context with the request message builded from the axis 2 envelope
DefaultMessageContext springMessageContext = new DefaultMessageContext(springAxiomSoapMessage, new AxiomSoapMessageFactory());
//get the Wss4jSecurityInterceptor and sign the request message
Wss4jSecurityInterceptor wss4jSecurityInterceptor = (Wss4jSecurityInterceptor) AuditContext.getApplicationContext().getBean(wsSecurityInterceptorBean);
wss4jSecurityInterceptor.handleRequest(springMessageContext);
springAxiomSoapMessage = (AxiomSoapMessage) springMessageContext.getRequest();
envelope = springAxiomSoapMessage.getAxiomMessage().getSOAPEnvelope();
logger.debug("signSoapEnvelope END");
return envelope;
} catch (Exception exc) {
throw new WSClientException(ICodeException.REPORTS_WSCLIENT_SIGN_REQUEST_MESSAGE, exc);
}
}
示例4: invoke
import org.apache.axiom.soap.SOAPMessage; //導入依賴的package包/類
@Override
public ListenableFuture<SOAPResponse> invoke(InvocationContext context, SOAPEnvelope request) {
SOAPMessage clonedRequest = domMetaFactory.createStAXSOAPModelBuilder(request.getXMLStreamReader()).getSOAPMessage();
normalize(clonedRequest.getSOAPEnvelope());
return requestMatcher.match((Document)clonedRequest).produce(context.getExecutor());
}