当前位置: 首页>>代码示例>>Java>>正文


Java SOAPMessage类代码示例

本文整理汇总了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)));
}
 
开发者ID:veithen,项目名称:visualwas,代码行数:12,代码来源:DummyTransport.java

示例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);
	}

}
 
开发者ID:CodeSphere,项目名称:termitaria,代码行数:31,代码来源:Axis2Utils.java

示例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);
	}

}
 
开发者ID:CodeSphere,项目名称:termitaria,代码行数:31,代码来源:Axis2Utils.java

示例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());
}
 
开发者ID:veithen,项目名称:visualwas,代码行数:7,代码来源:DummyTransport.java


注:本文中的org.apache.axiom.soap.SOAPMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。