You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Martin Mulder <ma...@dia.groningen.nl> on 2008/04/21 15:13:37 UTC

HTTP requests with parameters

Hi,

I'm trying to create a http provider which performs an HTTP GET with
parameters. (non-SOAP)

so the URL should be: http://testurl/getProducts?cat=<cat>&type=<type>

the idea was to create a SOAP consumer which has a action getProducts
and has to set the <cat> and <type> parameters for the GET URL.


Is this possible, because I am trying it for over a week, and couldn't
get it working......



Thank a lot,

Martin 
 

Re: HTTP requests with parameters

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Apr 23, 2008 at 2:30 PM, Johannes Elsinghorst
<Jo...@gmx.net> wrote:
> so  it should work like:
>
>
>  <bean id="marshaler"
> class="com.mycompany.marhsler.MyHttpProviderMarshaler">
>   <property name="Method" value="POST" />
>  </bean>
>  ?

If you have a setter method in your MyHttpProviderMarshaler named
setMethod(), then yes, that should work.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: HTTP requests with parameters

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
so  it should work like:

<bean id="marshaler" class="com.mycompany.marhsler.MyHttpProviderMarshaler">
  <property name="Method" value="POST" />
</bean>
?

cheers, Johannes


> Actually the DefaultProviderMarshaler is already configured in the
> start() method. You can extend and override it with your own custom
> class to provide your own custom funcetionality. Then you'd configure
> it in the xbean.xml like so:
>
> <bean id="marshaler" class="com.mycompany.marhsler.MyHttpProviderMarshaler">
>   <property name="foo" value="blah" />
>   <property name="bar" value="blech" />
> </bean>
>
> There is no providerMarshaler property. There's only a marshaler property.
>
> Bruce
>   


Re: HTTP requests with parameters

Posted by Bruce Snyder <br...@gmail.com>.
On Wed, Apr 23, 2008 at 1:53 PM, Johannes Elsinghorst
<Jo...@gmx.net> wrote:
> Gert ,
>  how can i configure the Marshaller in the xbean.xml?
>  I know I can put it in using  <bean id="providerMarshaler"
> class="org.apache.servicemix.http.endpoints.DefaultHttpProviderMarshaler" />
>  but this way i can't configure its properties right?

Actually the DefaultProviderMarshaler is already configured in the
start() method. You can extend and override it with your own custom
class to provide your own custom funcetionality. Then you'd configure
it in the xbean.xml like so:

<bean id="marshaler" class="com.mycompany.marhsler.MyHttpProviderMarshaler">
  <property name="foo" value="blah" />
  <property name="bar" value="blech" />
</bean>

There is no providerMarshaler property. There's only a marshaler property.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: HTTP requests with parameters

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
Gert ,
how can i configure the Marshaller in the xbean.xml?
I know I can put it in using  <bean id="providerMarshaler" 
class="org.apache.servicemix.http.endpoints.DefaultHttpProviderMarshaler" />
but this way i can't configure its properties right?

cheers, Johannes
> Martin,
>
> You can use a HttpProviderMarshaler instance together with the new 
> <http:provider/> endpoint to achieve this.  In fact, the 
> DefaultHttpProviderMarshaler will probably allow you to this already 
> if you...
> - specify the method as GET
> - specify a locationUriExpression to determine the URL with the 
> parameters therein
>
> Hth,
>
> Gert
>
> Martin Mulder wrote:
>> Hi,
>>
>> I'm trying to create a http provider which performs an HTTP GET with
>> parameters. (non-SOAP)
>>
>> so the URL should be: http://testurl/getProducts?cat=<cat>&type=<type>
>>
>> the idea was to create a SOAP consumer which has a action getProducts
>> and has to set the <cat> and <type> parameters for the GET URL.
>>
>>
>> Is this possible, because I am trying it for over a week, and couldn't
>> get it working......
>>
>>
>>
>> Thank a lot,
>>
>> Martin  
>>
>>   
>


Re: HTTP requests with parameters

Posted by Gert Vanthienen <ge...@skynet.be>.
Martin,

You can use a HttpProviderMarshaler instance together with the new 
<http:provider/> endpoint to achieve this.  In fact, the 
DefaultHttpProviderMarshaler will probably allow you to this already if 
you...
- specify the method as GET
- specify a locationUriExpression to determine the URL with the 
parameters therein

Hth,

Gert

Martin Mulder wrote:
> Hi,
>
> I'm trying to create a http provider which performs an HTTP GET with
> parameters. (non-SOAP)
>
> so the URL should be: http://testurl/getProducts?cat=<cat>&type=<type>
>
> the idea was to create a SOAP consumer which has a action getProducts
> and has to set the <cat> and <type> parameters for the GET URL.
>
>
> Is this possible, because I am trying it for over a week, and couldn't
> get it working......
>
>
>
> Thank a lot,
>
> Martin 
>  
>
>