You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Onder SEZGIN <on...@gmail.com> on 2011/12/27 03:16:17 UTC

Axis2 Web Service Client sending request in json format

Hello,

I have been lately googling to find out if I would be able to write Axis2
Web Service client to invoke a Web Service over HTTP using JSON.
I have seen that json support is added and i tried an example to make a Web
Service call through web browser (JSON request / JSON Response)and it
worked.
However, i would like to do the same thing programmatically.

Earlier i'd worked with Axis2 to invoke a Web Service over HTTP using SOAP
and how it was achieved was to create a stub client code and making the
calls by the help of those stub objects.
I was expecting to be able to do the same thing in a similar manner /
approach using JSON. But as far as i can understand from the examples by
just looking through unit test case codes and examples in Axis2, this is
not that easy.

Could you please guide me to have a Web Service client to make a json
request to Web Service?
What are the possible options?

If you can also explain me step by step to have sample server/client code
to be able to run on a single dev box, that would be really appreciated. I
am asking for this because i am not really able to run examples coming
Axis2 package and run the unit test cases?

Best regards
Onder

Re: Axis2 Web Service Client sending request in json format

Posted by Onder SEZGIN <on...@gmail.com>.
Hello,

I have already followed your blogpost. Unfortunately, i could not make much
progress on it.
I am getting similar errors as below.

[INFO] Clustering has been disabled
org.apache.axis2.deployment.DeploymentException: The system is attempting
to engage a module that is not available: DynamicResponseHandler
at
org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:184)
 at
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:135)
at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
 at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:210)
at
ws.example.TemperatureConverterTest2.main(TemperatureConverterTest2.java:33)[INFO]
Module validation failed: The system is attempting to engage a module that
is not available: DynamicResponseHandler

Caused by: org.apache.axis2.AxisFault: The system is attempting to engage a
module that is not available: DynamicResponseHandler
at
org.apache.axis2.engine.AxisConfiguration.engageModule(AxisConfiguration.java:594)
 at
org.apache.axis2.engine.AxisConfiguration.engageGlobalModules(AxisConfiguration.java:715)
at
org.apache.axis2.deployment.DeploymentEngine.engageModules(DeploymentEngine.java:831)
 at
org.apache.axis2.deployment.DeploymentEngine.loadFromClassPath(DeploymentEngine.java:180)
... 4 more

On Tue, Dec 27, 2011 at 12:01 PM, Pulasthi Supun Wickramasinghe <
pulasthi911@gmail.com> wrote:

> Hi
>
> I wrote a blog post on Creating a JSON client for AXIS2[1] a while back i
> hope this will help you up to some extent.
>
>
> [1]
> http://pulasthisupun.blogspot.com/2011/09/creating-json-client-for-axis2.html
>
>
>  On Tue, Dec 27, 2011 at 7:46 AM, Onder SEZGIN <on...@gmail.com>wrote:
>
>> Hello,
>>
>> I have been lately googling to find out if I would be able to write Axis2
>> Web Service client to invoke a Web Service over HTTP using JSON.
>> I have seen that json support is added and i tried an example to make a
>> Web Service call through web browser (JSON request / JSON Response)and it
>> worked.
>> However, i would like to do the same thing programmatically.
>>
>> Earlier i'd worked with Axis2 to invoke a Web Service over HTTP using
>> SOAP and how it was achieved was to create a stub client code and making
>> the calls by the help of those stub objects.
>> I was expecting to be able to do the same thing in a similar manner /
>> approach using JSON. But as far as i can understand from the examples by
>> just looking through unit test case codes and examples in Axis2, this is
>> not that easy.
>>
>> Could you please guide me to have a Web Service client to make a json
>> request to Web Service?
>> What are the possible options?
>>
>> If you can also explain me step by step to have sample server/client code
>> to be able to run on a single dev box, that would be really appreciated. I
>> am asking for this because i am not really able to run examples coming
>> Axis2 package and run the unit test cases?
>>
>> Best regards
>> Onder
>>
>>
>>
>
>
> Best regards
> --
> Pulasthi Supun
> Undergraduate
> Dpt of Computer Science & Engineering
> University of Moratuwa
> Blog : http://pulasthisupun.blogspot.com/
> Git hub profile: <http://pulasthisupun.blogspot.com/>https://github.com/pulasthi
> <https://github.com/pulasthi>
>
>


-- 
Regards
Onder

http://uk.linkedin.com/in/onders

Re: Axis2 Web Service Client sending request in json format

Posted by Pulasthi Supun Wickramasinghe <pu...@gmail.com>.
Hi

I wrote a blog post on Creating a JSON client for AXIS2[1] a while back i
hope this will help you up to some extent.


[1]
http://pulasthisupun.blogspot.com/2011/09/creating-json-client-for-axis2.html


On Tue, Dec 27, 2011 at 7:46 AM, Onder SEZGIN <on...@gmail.com> wrote:

> Hello,
>
> I have been lately googling to find out if I would be able to write Axis2
> Web Service client to invoke a Web Service over HTTP using JSON.
> I have seen that json support is added and i tried an example to make a
> Web Service call through web browser (JSON request / JSON Response)and it
> worked.
> However, i would like to do the same thing programmatically.
>
> Earlier i'd worked with Axis2 to invoke a Web Service over HTTP using SOAP
> and how it was achieved was to create a stub client code and making the
> calls by the help of those stub objects.
> I was expecting to be able to do the same thing in a similar manner /
> approach using JSON. But as far as i can understand from the examples by
> just looking through unit test case codes and examples in Axis2, this is
> not that easy.
>
> Could you please guide me to have a Web Service client to make a json
> request to Web Service?
> What are the possible options?
>
> If you can also explain me step by step to have sample server/client code
> to be able to run on a single dev box, that would be really appreciated. I
> am asking for this because i am not really able to run examples coming
> Axis2 package and run the unit test cases?
>
> Best regards
> Onder
>
>
>


Best regards
-- 
Pulasthi Supun
Undergraduate
Dpt of Computer Science & Engineering
University of Moratuwa
Blog : http://pulasthisupun.blogspot.com/
Git hub profile:
<http://pulasthisupun.blogspot.com/>https://github.com/pulasthi
<https://github.com/pulasthi>