I want to use the HTTPInvoker Component to POST /GET data from a servlet.
I didnt find any example and this wiki page :
http://servicemix.goopen.org/site/http.html
does talk about it but does not provide any example..

I tried it as follows but no success...

Heres the part in servicemix.xml :
        <sm:activationSpec componentName="hservice"     
                                   service="foo:hservice"
                                   endpoint="hservice">
                                  <sm:component>
                                    <bean 
class="org.apache.servicemix.components.http.HttpInvoker">
                                     <property name="url"
value="http://localhost:8080/ServiceMixTest/MockServlet"/>
                                    </bean>
                                  </sm:component>
                </sm:activationSpec>
======
Heres how I send some data :

        InOut inout = createInOutExchange(new QName(Constants.MY_NAMESPACE,
"hservice"), null, null);
        inout.setProperty(Constants.PROPERTY_CORRELATIONID, id);
        NormalizedMessage msg = inout.createMessage();
  msg.setProperty("key1","value1");      
  msg.setProperty("key2","value2");      
  inout.setInMessage(msg);
      
        send(inout);

===

None of this is actually working...
Is that the right way to define a HTTPInvoker in the servicemix.xml ?
Can I also pass in the "URL" using : 
inout.setProperty("url","http://localhost:8080/ServiceMixTest/MockServlet";);

How do I pass the parameters to the servlet ? I want the "key1" and "key2"
params to be sent to the servlet ( as GET or POST ).

I see the following error in the log :

DEBUG - DeliveryChannelImpl.traceMessageExchange(342) | Sent:
MessageExchange[
  id: ID:PATPC-3976-1150604064812-5:0
  status: Error
  role: provider
  service: {http://servicemix.org/demo/}hservice
  endpoint: hservice
  in: 
  error: Error executing http request
]

Thanks for any suggestions.
Pat
--
View this message in context: 
http://www.nabble.com/HTTPInvoker-usage-t1805698.html#a4921098
Sent from the ServiceMix - User forum at Nabble.com.

Reply via email to