Hi,
This code works for 1.2. If you have a WSDL 2 document (which you can write
pretty easily) you can use wsdl2java on ut to generate stubs and skeletons.
########
OMElement data = ... ;
EndpointReference epr = ...;
Options options = new Options();
options.setTo(epr);
//set the correct REST invocation properties.
options.setProperty(org.apache.axis2.Constants.Configuration.MESSAGE_TYPE
,
ServerConstants.HTTPConstants.MEDIA_TYPE_X_WWW_FORM);
options.setProperty(
org.apache.axis2.Constants.Configuration.HTTP_METHOD,
org.apache.axis2.Constants.Configuration.HTTP_METHOD_POST );
ServiceClient sender =
new ServiceClient(null,null);
sender.setOptions(options);
OMElement response = sender.sendReceive(data);
#########
Thanks,
Keith
On 5/25/07, Vikas <[EMAIL PROTECTED]> wrote:
Hi Friends,
Can we call REST service by POST way?
In axis2 1.1.1,
http://127.0.0.1:8080/axis2/rest/Version/getVersion
and in 1.2, it is
http://127.0.0.1:8080/axis2/services/Version/getVersion this is HTTP
GET way of calling.
Then
i) Can we call same service with HTTP POST way?
ii) How to set parameters to HTTP POST way so they can be send to service
by REST way?
With best regards
Vikas R. Khengare
----- Original Message -----
*From:* keith chapman <[EMAIL PROTECTED]>
*To:* [email protected]
*Sent:* Friday, May 25, 2007 3:19 PM
*Subject:* Re: Rest APIs
Axis 1.2 got rid of having a separate servlet for REST. Now both REST and
SOAP are handled by the same servlet (If needed REST can be dissabled). In
1.1.1 axis2/rest calls the REST servlet while axis2/services calls the
main servlet. This is the reason for the change.
Thanks,
Keith.
On 5/25/07, Ognjen Blagojevic <[EMAIL PROTECTED]> wrote:
>
> > Can anybody help me to enable rest APIs in my webservices with Axis2?
>
> What seems to be the problem? Rest is already enabled. In axis2 1.1.1,
> you could test it at
>
> http://127.0.0.1:8080/axis2/rest/Version/getVersion
>
> and in 1.2, it is
>
> http://127.0.0.1:8080/axis2/services/Version/getVersion
>
>
> Regards,
> Ognjen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/
--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/