@Test public void testSerializeFromDom() throws Exception { Element element = XmlUtil.loadDocument(fromResource("xml/request1.xml")).getDocumentElement(); WebServiceMessage message = messageHelper.serialize(element); assertNotNull(message); }
public WebServiceMessage serialize(Object data) throws Exception { Assert.notNull(data, "data can not be null"); MethodParameter parameter = new SmockMethodParameter(getTargetClass(data),-1); MessageContext messageContext = new DefaultMessageContext(messageFactory); for (MethodReturnValueHandler methodReturnValueHandler : adapter.getMethodReturnValueHandlers()) { if (methodReturnValueHandler.supportsReturnType(parameter)) { methodReturnValueHandler.handleReturnValue(messageContext, parameter, data); return messageContext.getResponse(); } } return null; }
MessageHelper { public WebServiceMessage serialize(Object data) throws Exception { Assert.notNull(data, "data can not be null"); MethodParameter parameter = new SmockMethodParameter(getTargetClass(data),-1); MessageContext messageContext = new DefaultMessageContext(messageFactory); for (MethodReturnValueHandler methodReturnValueHandler : adapter.getMethodReturnValueHandlers()) { if (methodReturnValueHandler.supportsReturnType(parameter)) { methodReturnValueHandler.handleReturnValue(messageContext, parameter, data); return messageContext.getResponse(); } } return null; } }
MessageHelper { public WebServiceMessage serialize(Object data) throws Exception { Assert.notNull(data, "data can not be null"); MethodParameter parameter = new SmockMethodParameter(getTargetClass(data),-1); MessageContext messageContext = new DefaultMessageContext(messageFactory); for (MethodReturnValueHandler methodReturnValueHandler : adapter.getMethodReturnValueHandlers()) { if (methodReturnValueHandler.supportsReturnType(parameter)) { methodReturnValueHandler.handleReturnValue(messageContext, parameter, data); return messageContext.getResponse(); } } return null; } MessageHelper(WebServiceMessageFactory messageFactory); }
MessageHelper { public WebServiceMessage serialize(Object data) throws Exception { Assert.notNull(data, "data can not be null"); MethodParameter parameter = new SmockMethodParameter(getTargetClass(data),-1); MessageContext messageContext = new DefaultMessageContext(messageFactory); for (MethodReturnValueHandler methodReturnValueHandler : adapter.getMethodReturnValueHandlers()) { if (methodReturnValueHandler.supportsReturnType(parameter)) { methodReturnValueHandler.handleReturnValue(messageContext, parameter, data); return messageContext.getResponse(); } } return null; } MessageHelper(WebServiceMessageFactory messageFactory); @SuppressWarnings("unchecked") T deserialize(WebServiceMessage message, Class<T> targetClass); WebServiceMessage serialize(Object data); }
MessageHelper { public WebServiceMessage serialize(Object data) throws Exception { Assert.notNull(data, "data can not be null"); MethodParameter parameter = new SmockMethodParameter(getTargetClass(data),-1); MessageContext messageContext = new DefaultMessageContext(messageFactory); for (MethodReturnValueHandler methodReturnValueHandler : adapter.getMethodReturnValueHandlers()) { if (methodReturnValueHandler.supportsReturnType(parameter)) { methodReturnValueHandler.handleReturnValue(messageContext, parameter, data); return messageContext.getResponse(); } } return null; } MessageHelper(WebServiceMessageFactory messageFactory); @SuppressWarnings("unchecked") T deserialize(WebServiceMessage message, Class<T> targetClass); WebServiceMessage serialize(Object data);  }