/** * Creates {@link Source} from {@link Resource}. * @param resource * @return */ protected static Source createSource(Resource resource) { try { //we need to read the source multiple times thus using DOMSource return new DOMSource(loadDocument(new ResourceSource(resource))); } catch (IOException ex) { throw new IllegalArgumentException(resource + " could not be opened", ex); } }
/** * Respond with the given {@link org.springframework.core.io.Resource} XML as payload response. * * @param payload the response payload * @return the response callback */ public static ResponseCreator withPayload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return withPayload(new ResourceSource(payload)); }
/** * Respond with the given {@link org.springframework.core.io.Resource} XML as SOAP envelope response. * * @param soapEnvelope the response SOAP envelope * @return the response callback * @since 2.1.1 */ public static ResponseCreator withSoapEnvelope(Resource soapEnvelope) throws IOException { Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null"); return withSoapEnvelope(new ResourceSource(soapEnvelope)); }
/** * Respond with the given {@link org.springframework.core.io.Resource} XML as payload response. * * @param payload the response payload * @return the response callback */ public static ResponseCreator withPayload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return withPayload(new ResourceSource(payload)); }
/** * Expects the given {@link org.springframework.core.io.Resource} XML payload. * * @param payload the XML payload * @return the request matcher */ public static RequestMatcher payload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return payload(new ResourceSource(payload)); }
/** * Respond with the given {@link org.springframework.core.io.Resource} XML as SOAP envelope response. * * @param soapEnvelope the response SOAP envelope * @return the response callback * @since 2.1.1 */ public static ResponseCreator withSoapEnvelope(Resource soapEnvelope) throws IOException { Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null"); return withSoapEnvelope(new ResourceSource(soapEnvelope)); }
/** * Create a request with the given {@link Resource} XML as payload. * * @param payload the request payload * @return the request creator */ public static RequestCreator withPayload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return withPayload(new ResourceSource(payload)); }
/** * Expects the given {@link Resource} XML payload. * * @param payload the XML payload * @return the response matcher */ public static ResponseMatcher payload(Resource payload) throws IOException { return payload(new ResourceSource(payload)); }
/** * Expects the given {@link org.springframework.core.io.Resource} XML SOAP envelope. * * @param soapEnvelope the XML SOAP envelope * @return the request matcher * @since 2.1.1 */ public static RequestMatcher soapEnvelope(Resource soapEnvelope) throws IOException { Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null"); return soapEnvelope(new ResourceSource(soapEnvelope)); }
/** * Create a request with the given {@link Resource} XML as payload. * * @param payload the request payload * @return the request creator */ public static RequestCreator withPayload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return withPayload(new ResourceSource(payload)); }
/** * Expects the given {@link Resource} XML payload. * * @param payload the XML payload * @return the response matcher */ public static ResponseMatcher payload(Resource payload) throws IOException { return payload(new ResourceSource(payload)); }
/** * Respond with the given {@link org.springframework.core.io.Resource} XML as SOAP envelope response. * * @param soapEnvelope the response SOAP envelope * @return the response callback * @since 2.1.1 */ public static ResponseCreator withSoapEnvelope(Resource soapEnvelope) throws IOException { Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null"); return withSoapEnvelope(new ResourceSource(soapEnvelope)); }
/** * Expects the given {@link org.springframework.core.io.Resource} XML payload. * * @param payload the XML payload * @return the request matcher */ public static RequestMatcher payload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return payload(new ResourceSource(payload)); }
/** * Expects the given {@link Resource} XML SOAP envelope. * * @param soapEnvelope the XML SOAP envelope * @return the response matcher * @since 2.1.1 */ public static ResponseMatcher soapEnvelope(Resource soapEnvelope) throws IOException { return soapEnvelope(new ResourceSource(soapEnvelope)); }
/** * Expects the given {@link Resource} XML payload. * * @param payload the XML payload * @return the response matcher */ public static ResponseMatcher payload(Resource payload) throws IOException { return payload(new ResourceSource(payload)); }
/** * Expects the given {@link Resource} XML SOAP envelope. * * @param soapEnvelope the XML SOAP envelope * @return the response matcher * @since 2.1.1 */ public static ResponseMatcher soapEnvelope(Resource soapEnvelope) throws IOException { return soapEnvelope(new ResourceSource(soapEnvelope)); }
/** * Respond with the given {@link org.springframework.core.io.Resource} XML as payload response. * * @param payload the response payload * @return the response callback */ public static ResponseCreator withPayload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return withPayload(new ResourceSource(payload)); }
/** * Create a request with the given {@link Resource} XML as SOAP envelope. * * @param soapEnvelope the request SOAP envelope * @return the request creator * @since 2.1.1 */ public static RequestCreator withSoapEnvelope(Resource soapEnvelope) throws IOException { Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null"); return withSoapEnvelope(new ResourceSource(soapEnvelope)); }
/** * Expects the given {@link org.springframework.core.io.Resource} XML payload. * * @param payload the XML payload * @return the request matcher */ public static RequestMatcher payload(Resource payload) throws IOException { Assert.notNull(payload, "'payload' must not be null"); return payload(new ResourceSource(payload)); }
/** * Create a request with the given {@link Resource} XML as SOAP envelope. * * @param soapEnvelope the request SOAP envelope * @return the request creator * @since 2.1.1 */ public static RequestCreator withSoapEnvelope(Resource soapEnvelope) throws IOException { Assert.notNull(soapEnvelope, "'soapEnvelope' must not be null"); return withSoapEnvelope(new ResourceSource(soapEnvelope)); }