use of com.predic8.wsdl.Service in project service-proxy by membrane.
the class AdminPageBuilder method createHelpIcon.
private void createHelpIcon(Interceptor i, String id) {
String helpId = i.getHelpId();
if (helpId != null) {
div().style("float:right;");
a().href("http://membrane-soa.org/service-proxy-doc/" + getVersion() + "/configuration/reference/" + helpId + ".htm");
span().classAttr("ui-icon ui-icon-help").title("help").end();
end();
end();
}
}
use of com.predic8.wsdl.Service in project service-proxy by membrane.
the class HelpLinkExistenceTest method doit.
@Test
public void doit() throws Exception {
Set<Class<?>> classes = getElementClasses();
Assert.assertNotEquals(0, classes.size());
HttpClient hc = new HttpClient();
for (Class<?> clazz : classes) {
if (Interceptor.class.isAssignableFrom(clazz)) {
Interceptor i = (Interceptor) clazz.newInstance();
String helpId = i.getHelpId();
String url = "http://membrane-soa.org/service-proxy-doc/" + getVersion() + "/configuration/reference/" + helpId + ".htm";
Response r = hc.call(new Request.Builder().get(url).buildExchange()).getResponse();
try {
Assert.assertEquals(200, r.getStatusCode());
} catch (Throwable e) {
throw new RuntimeException(url, e);
}
}
}
}
use of com.predic8.wsdl.Service in project service-proxy by membrane.
the class RewriteInterceptorIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
interceptor = new RewriteInterceptor();
interceptor.getMappings().add(new Mapping("/blz-service\\?wsdl", "/axis2/services/BLZService?wsdl", null));
Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", 3006), "thomas-bayer.com", 80);
rule.getInterceptors().add(interceptor);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule);
}
use of com.predic8.wsdl.Service in project service-proxy by membrane.
the class MyApplication method main.
public static void main(String[] args) throws Exception {
System.out.println("Starting up");
// create a new service proxy that listens on port 8080 and has a target to localhost:2001
ServiceProxy sp = createServiceProxy();
// create an enclosing WebSocket interceptor to add our own Logging interceptor to it
WebSocketInterceptor ws = new WebSocketInterceptor();
ws.getInterceptors().add(new MyWebSocketLogInterceptor());
// attach the WebSocket interceptor to the service proxy
sp.getInterceptors().add(ws);
// add the service proxy to a new router instance and start it
HttpRouter router = new HttpRouter();
router.add(sp);
router.init();
System.out.println("Starting finished - Waiting for WebSocket communication");
}
use of com.predic8.wsdl.Service in project service-proxy by membrane.
the class WebServiceExplorerInterceptor method createOperationResponse.
@Mapping("[^?]*/operation/([^/?]+)/([^/?]+)/([^/?]+)")
public Response createOperationResponse(QueryParameter params, String relativeRootPath) throws Exception {
try {
final String bindingName = params.getGroup(1);
final String portName = params.getGroup(2);
final String operationName = params.getGroup(3);
final Definitions w = getParsedWSDL();
final Service service = getService(w);
StringWriter sw = new StringWriter();
new StandardPage(sw, null) {
@Override
protected void createContent() {
h1().text("Service Proxy for " + service.getName());
h2().text("Operation: " + operationName).end();
h3().text("Sample Request").end();
pre().text(generateSampleRequest(portName, operationName, bindingName, w)).end();
}
};
return Response.ok(sw.toString()).build();
} catch (IllegalArgumentException e) {
log.error("", e);
return Response.internalServerError().build();
}
}
Aggregations