本文整理汇总了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());
}