/ Published in: Groovy
This is excellent for testing (mocking a SOAP server for example), we use an in memory http server in order to answer client requests.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import org.simpleframework.http.Request import org.simpleframework.http.Response import org.simpleframework.http.core.Container import org.simpleframework.transport.connect.Connection import org.simpleframework.transport.connect.SocketConnection Connection connection connection.connect(address); } response.set("Content-Type", "text/xml;charset=utf-8"); response.set("Server", "Apache-Coyote/1.1"); response.setDate("Date", time); } case "/some/url/file": case "/some/url/hello": return 'hello' } } } }