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


Java WebServiceMessage.getPayloadSource方法代码示例

本文整理汇总了Java中org.springframework.ws.WebServiceMessage.getPayloadSource方法的典型用法代码示例。如果您正苦于以下问题:Java WebServiceMessage.getPayloadSource方法的具体用法?Java WebServiceMessage.getPayloadSource怎么用?Java WebServiceMessage.getPayloadSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.ws.WebServiceMessage的用法示例。


在下文中一共展示了WebServiceMessage.getPayloadSource方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getMessage

import org.springframework.ws.WebServiceMessage; //导入方法依赖的package包/类
/**
 * Retrieves the XML message from the WebServiceMessage obj using the transformer,
 * returns null in case source is null
 * 
 * @param source to retrieve the SOAP message
 * @return String XML formatted
 * @throws Exception
 */
private String getMessage(WebServiceMessage message) throws Exception {
    Source source = message.getPayloadSource();
    if (source != null) {
        Transformer transformer = createNonIndentingTransformer();
        StringWriter writer = new StringWriter();
        transformer.transform(source, new StreamResult(writer));
        
        //Retrieve msg and remove break line if requested
        String msg = writer.toString();  
        if (removeNewline) {
            msg = StringUtils.remove(msg, System.getProperty("line.separator"));
        }
        
        //Return processed message
        return msg;
    }
    return null;
}
 
开发者ID:SpartaTech,项目名称:sparta-spring-webservice-utils,代码行数:27,代码来源:PayloadLoggingClientInterceptor.java

示例2: responseMarshaller

import org.springframework.ws.WebServiceMessage; //导入方法依赖的package包/类
/**
 * Retorna un {@link ResponseMatcher} que marshaliza el resultado.
 * 
 * <p>
 * Este {@link ResponseMatcher} no realiza ninguna acción, siempre valida y
 * se encarga de parsear el resultado
 * </p>
 * 
 * @return dummy {@link ResponseMatcher}
 */
public ResponseMatcher responseMarshaller() {

	return new ResponseMatcher() {

		@Override
		public void match(WebServiceMessage request,
				WebServiceMessage response) throws IOException,
				AssertionError {

			WebServiceMessage dos = response;
			Source source = dos.getPayloadSource();
			result = unmarshaller.unmarshal(source);
		}
	};
}
 
开发者ID:fpuna-cia,项目名称:karaku,代码行数:26,代码来源:BaseTestWebService.java

示例3: validate

import org.springframework.ws.WebServiceMessage; //导入方法依赖的package包/类
public void validate(WebServiceMessage message, XmlValidator validator) throws IOException{
	Source requestSource = message.getPayloadSource();
       if (requestSource != null) {
           SAXParseException[] errors = validator.validate(requestSource);
           if (!ObjectUtils.isEmpty(errors)) {
               handleRequestValidationErrors(message, errors);
           }
           logger.debug("Request message validated");
       }
       else
       {
      	 logger.warn("Request source is null");
       }
}
 
开发者ID:lukas-krecan,项目名称:spring-ws-test,代码行数:15,代码来源:SchemaValidator.java

示例4: getValidationRequestSource

import org.springframework.ws.WebServiceMessage; //导入方法依赖的package包/类
protected Source getValidationRequestSource(WebServiceMessage request) {
	Source source = request.getPayloadSource();
	validateSchema(source);
	return source;
}
 
开发者ID:leosilvadev,项目名称:simplebank,代码行数:6,代码来源:ValidationInterceptor.java

示例5: preprocessControlMessage

import org.springframework.ws.WebServiceMessage; //导入方法依赖的package包/类
@Override
protected Source preprocessControlMessage(WebServiceMessage input)
{
	Source inputSource = input!=null?input.getPayloadSource():null;
	return templateProcessor.processTemplate(getControlMessage(), inputSource, parameters);
}
 
开发者ID:lukas-krecan,项目名称:smock,代码行数:7,代码来源:TemplateAwareMessageMatcher.java

示例6: preprocessSource

import org.springframework.ws.WebServiceMessage; //导入方法依赖的package包/类
@Override
protected Source preprocessSource(URI uri, WebServiceMessage input,	WebServiceMessageFactory messageFactory) {
	Source inputSource = input!=null?input.getPayloadSource():null;
	return templateProcessor.processTemplate(getSource(), inputSource, parameters);
}
 
开发者ID:lukas-krecan,项目名称:smock,代码行数:6,代码来源:TemplateAwareMessageCreator.java


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