當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。