That's right! Thanks a lot.
Joao
-----Original Message-----
From: Guillaume Nodet [mailto:[EMAIL PROTECTED]
Sent: quarta-feira, 3 de Maio de 2006 12:17
To: [email protected]
Subject: Re: Can't obtain response from sm...
Properties are not returned back from the http component.
You should set an xml content on the out message and you will receive it...
Cheers,
Guillaume Nodet
On 5/3/06, João Luz <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I've tried RemoteServiceClient and now I'm trying with HttpConnector as a
> binding component..
> I'm using lwcontainer and deploying on it a service assembly.
>
> The client is like this:
> HttpClient client = new HttpClient();
> GetMethod get = new
> GetMethod("http://localhost:8912/test?testProperty=111");
> try {
> client.executeMethod(get);
> → System.out.println(get.getResponseBodyAsString());
> } catch (Exception e) {
> e.printStackTrace();
> }finally {
> get.releaseConnection();
> }
>
>
> Component bean is:
> public class TestBroker extends TransformComponentSupport {
>
> private static final Log log = LogFactory.getLog(TestBroker.class);
>
> protected boolean transform(MessageExchange exchange,
> NormalizedMessage in, NormalizedMessage out) throws MessagingException {
> String test = (String) in.getProperty("testProperty");
> System.out.println("Property received:" + test);
> out.setProperty("testProperty", test + " -- added");
> return true;
> }
> }
>
> HttpConnector and Component are configured like this:
>
> <sm:activationSpec componentName="loanBrokerHttpBinding"
> destinationService="lb:test-broker">
> <sm:component>
> <bean
> class="org.apache.servicemix.components.http.HttpConnector">
> <property name="host"
> value="localhost"/>
> <property name="port" value="8912"/>
> </bean>
> </sm:component>
> </sm:activationSpec>
> <sm:activationSpec componentName="test-broker"
> service="lb:test-broker">
> <sm:component>
> <bean class="loanbroker.TestBroker" />
> </sm:component>
> </sm:activationSpec>
>
> My problem is that I don't receive the message back, but the component
> receive the request since it print "Property Received: 111"
>
>
> Thanks in advance,
> João
>