本文整理汇总了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);
}
};
}
示例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");
}
}
示例4: getValidationRequestSource
import org.springframework.ws.WebServiceMessage; //导入方法依赖的package包/类
protected Source getValidationRequestSource(WebServiceMessage request) {
Source source = request.getPayloadSource();
validateSchema(source);
return source;
}
示例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);
}
示例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);
}