You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by go-gators <sw...@samsung.com> on 2006/05/03 03:25:35 UTC

How to invoke JBI component(service) from JSP ?

I have successfully deployed servicemix-3.0 snapshot in Tomcat.
How do I invoke JBI component directly using JSP ?

I have looked at the example testfiles and they do that using
ServiceMixClient class.
In the test examples, ServiceMixClient class is created using
ClassPathXmlApplicationContext([SPECIFIC service.xml location path]).
However in the jsp files, there should be some other way to get the context
insted of specifying service.xml file path (applicationContext.xml in the
tomcat case)

Is there simple JSP client that invokes JBI component ?

Thanks
--
View this message in context: http://www.nabble.com/How-to-invoke-JBI-component%28service%29-from-JSP--t1547039.html#a4202718
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to invoke JBI component(service) from JSP ?

Posted by Guillaume Nodet <gn...@gmail.com>.
The httpBinding is a binding component that wait for incoming http request.
You have to target its target: the foo:echo component.

Cheers,
Guillaume Nodet

On 5/3/06, go-gators <sw...@samsung.com> wrote:
>
> Following is what I did, but I still don't get response....
>
>
> ........
> <%
>
> ServletContext sc = request.getSession().getServletContext();
> WebApplicationContext wact =
> WebApplicationContextUtils.getRequiredWebApplicationContext(sc);
>
> ServiceMixClient client = (ServiceMixClient) wact.getBean("client");
> InOut exchange = client.createInOutExchange();
>
> NormalizedMessage inMessage = exchange.getInMessage();
> inMessage.setProperty("name", "James");
> //inMessage.setContent(new StreamSource(new
> StringReader("<hello>world</hello>")));
> QName service = new QName("http://servicemix.apache.org/demo/",
> "httpBinding");
> exchange.setService(service);
>
> client.sendSync(exchange);
>
> NormalizedMessage outMessage = exchange.getInMessage();
> out.println(outMessage);
> %>
> ...........
> --
> View this message in context: http://www.nabble.com/How-to-invoke-JBI-component%28service%29-from-JSP--t1547039.html#a4203727
> Sent from the ServiceMix - User forum at Nabble.com.
>
>

Re: How to invoke JBI component(service) from JSP ?

Posted by go-gators <sw...@samsung.com>.
Following is what I did, but I still don't get response....


........
<%

ServletContext sc = request.getSession().getServletContext();
WebApplicationContext wact =
WebApplicationContextUtils.getRequiredWebApplicationContext(sc);

ServiceMixClient client = (ServiceMixClient) wact.getBean("client");
InOut exchange = client.createInOutExchange();

NormalizedMessage inMessage = exchange.getInMessage();
inMessage.setProperty("name", "James");
//inMessage.setContent(new StreamSource(new
StringReader("<hello>world</hello>")));
QName service = new QName("http://servicemix.apache.org/demo/",
"httpBinding");
exchange.setService(service);

client.sendSync(exchange);

NormalizedMessage outMessage = exchange.getInMessage();
out.println(outMessage);
%>
...........
--
View this message in context: http://www.nabble.com/How-to-invoke-JBI-component%28service%29-from-JSP--t1547039.html#a4203727
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to invoke JBI component(service) from JSP ?

Posted by go-gators <sw...@samsung.com>.
Try to build without testing .

 maven -Dmaven.test.skip=true build
--
View this message in context: http://www.nabble.com/How-to-invoke-JBI-component%28service%29-from-JSP--t1547039.html#a4220199
Sent from the ServiceMix - User forum at Nabble.com.


Re: How to invoke JBI component(service) from JSP ?

Posted by fbertos <fb...@intecna.es>.

Hi,

Can you help me, please?

I'm trying to deploy ServiceMix 3.0-Snapshot in Tomcat with errors.
I'm using maven 1.0.2 to generate the servicemix-web.war file, but I'm
getting the following error:

test:test:
    [junit] Running org.apache.web.jmx.JMXWriterTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] [ERROR] TEST org.apache.web.jmx.JMXWriterTest FAILED

BUILD FAILED
File...... /root/.maven/cache/maven-test-plugin-1.6.2/plugin.jelly
Element... fail
Line...... 181
Column.... 54
There were test failures.
Total time: 13 seconds
Finished at: Wed May 03 10:53:17 CEST 2006 

Thanks

fbertos.
--
View this message in context: http://www.nabble.com/How-to-invoke-JBI-component%28service%29-from-JSP--t1547039.html#a4206612
Sent from the ServiceMix - User forum at Nabble.com.