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 Dimuthu Upeksha <di...@wso2.com> on 2013/11/26 12:51:30 UTC

Problem with creating client and service

Hi all,
I'm new to Axis2 and I went through some tutorials provided by Apache. I
managed to setup an Axiom service and client successfully. Then I tried to
use that same Axiom service with an ADB client. However I can not
understand how to pass parameters to Axiom services using ADB. In axiom
clients parameters are passed as OMElements. But in ADB such method is not
provided. I can provide further details. First I need to know whether it is
possible to call services written Axiom using clients created in ADB?

Thank You
Dimuthu Upeksha

Re: Problem with creating client and service

Posted by Dimuthu Upeksha <di...@wso2.com>.
Here is my problem
My service class is [1]. It contains an operation called CreateOrder
WSDL created for it is [2]
Stub Class is [3]

When I try to use stub class inner classes to invoke CreateOrder operation,

////////////////////////////

public class Client {

      public static void main(String ar[]) {

              CreateOrder createOrder = newOrderProcessorStub.CreateOrder();

              createOrder.setCreateOrder(param); //Here param type is
Object not OMElement

     }

}

//////////////////

As I understood  parameter that should be passed to setCreateOrder method
should be an OMElement object. But now it is an Java.lang.Object. If I pass
an OMElement object it gives a serialising exception.

In fact I just need to know what is the parameter that should be passed to
setCreateOrder() method.

Thank you

[1] https://www.dropbox.com/s/3uw1rjve0gxbpia/OrderProcessor.java

[2] https://www.dropbox.com/s/pj022zwqj8c3uys/OrderProcessor.wsdl

[3] https://www.dropbox.com/s/1amvjvlpbqz78u5/OrderProcessorStub.java

Dimuthu


On Sun, Dec 1, 2013 at 2:24 AM, Deepal jayasinghe <de...@gmail.com> wrote:

> In the service you can take any type object, and that does not have any
> relationship with the stub. The reason is communication between the
> service and client happen through XML (SOAP). Axis2 knows how to
> serialize and deserialize the objects.
>
> Deepal
> > Hi Deepal,
> > Thank you for your response. Yes I made a stub. It contains a method
> > to access web service operations with a parameter of the type of
> > "Object". Actually the parameters for operations in Axiom services are
> > OMElements. So I created an OMElements with necessary data and passed
> > it to the method provided by stub. When I run the client it gave an
> > exception mentioning a serialising problem. Do you have an idea about
> > the cause for this problem?
> >
> > Dimuthu
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

Re: Problem with creating client and service

Posted by Deepal jayasinghe <de...@gmail.com>.
In the service you can take any type object, and that does not have any
relationship with the stub. The reason is communication between the
service and client happen through XML (SOAP). Axis2 knows how to
serialize and deserialize the objects.

Deepal 
> Hi Deepal,
> Thank you for your response. Yes I made a stub. It contains a method
> to access web service operations with a parameter of the type of
> "Object". Actually the parameters for operations in Axiom services are
> OMElements. So I created an OMElements with necessary data and passed
> it to the method provided by stub. When I run the client it gave an
> exception mentioning a serialising problem. Do you have an idea about
> the cause for this problem?
>
> Dimuthu


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Problem with creating client and service

Posted by Deepal jayasinghe <de...@gmail.com>.
In the case of stub (code generated), Axis2 handles the serialization,
so does not need to implement any additional interfaces.

Deepal
> Make sure all the parameters passed to methods and returning from
> methods implement serializable interface.
>
> Regards,
> Nagendra
> *Raja Nagendra Kumar*
> Founder & C.T.O 	
> *Mobile:* +91-9886723872
> 	*Email:* nagendra.raja@tejasoft.com <ma...@tejasoft.com>
> *IM:* nagendra.raja (Skype)
>  *http://in.linkedin.com/in/nagkumar*
> 	*TejaSoft Innovations Pvt Ltd*
> <http://www.tejasoft.com>
> Factor 4 Results
>
> See who we know in common
> <http://www.linkedin.com/e/wwk/5094208/?hs=false&tok=0bfzEZotG8slI1>
> Want a signature like this?
> <http://www.linkedin.com/e/sig/5094208/?hs=false&tok=0uLVu92uq8slI1> 
>
>
> On 11/30/2013 5:51 PM, Dimuthu Upeksha wrote:
>> Hi Deepal,
>> Thank you for your response. Yes I made a stub. It contains a method
>> to access web service operations with a parameter of the type of
>> "Object". Actually the parameters for operations in Axiom services
>> are OMElements. So I created an OMElements with necessary data and
>> passed it to the method provided by stub. When I run the client it
>> gave an exception mentioning a serialising problem. Do you have an
>> idea about the cause for this problem?
>>
>> Dimuthu


Re: Problem with creating client and service

Posted by Raja Nagendra Kumar <na...@tejasoft.com>.
Make sure all the parameters passed to methods and returning from 
methods implement serializable interface.

Regards,
Nagendra
*Raja Nagendra Kumar*
Founder & C.T.O 	
*Mobile:* +91-9886723872
	*Email:* nagendra.raja@tejasoft.com <ma...@tejasoft.com>
*IM:* nagendra.raja (Skype)
*http://in.linkedin.com/in/nagkumar*
	*TejaSoft Innovations Pvt Ltd*
<http://www.tejasoft.com>
Factor 4 Results

See who we know in common 
<http://www.linkedin.com/e/wwk/5094208/?hs=false&tok=0bfzEZotG8slI1> 
Want a signature like this? 
<http://www.linkedin.com/e/sig/5094208/?hs=false&tok=0uLVu92uq8slI1>


On 11/30/2013 5:51 PM, Dimuthu Upeksha wrote:
> Hi Deepal,
> Thank you for your response. Yes I made a stub. It contains a method 
> to access web service operations with a parameter of the type of 
> "Object". Actually the parameters for operations in Axiom services are 
> OMElements. So I created an OMElements with necessary data and passed 
> it to the method provided by stub. When I run the client it gave an 
> exception mentioning a serialising problem. Do you have an idea about 
> the cause for this problem?
>
> Dimuthu

Re: Problem with creating client and service

Posted by Dimuthu Upeksha <di...@wso2.com>.
Hi Deepal,
Thank you for your response. Yes I made a stub. It contains a method to
access web service operations with a parameter of the type of "Object".
Actually the parameters for operations in Axiom services are OMElements. So
I created an OMElements with necessary data and passed it to the method
provided by stub. When I run the client it gave an exception mentioning a
serialising problem. Do you have an idea about the cause for this problem?

Dimuthu

Re: Problem with creating client and service

Posted by Deepal Jayasinghe <de...@opensource.lk>.
For ADB, you need to generate the stub (using the code generation tool)
and use the stub to call the service. Alternatively you can use
RPCServiceClient.

Deepal

> Hi all,
> I'm new to Axis2 and I went through some tutorials provided by Apache.
> I managed to setup an Axiom service and client successfully. Then I
> tried to use that same Axiom service with an ADB client. However I can
> not understand how to pass parameters to Axiom services using ADB. In
> axiom clients parameters are passed as OMElements. But in ADB such
> method is not provided. I can provide further details. First I need to
> know whether it is possible to call services written Axiom using
> clients created in ADB?
>
> Thank You
> Dimuthu Upeksha

-- 
Blog - http://blogs.deepal.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org