- Now to test the service , we will run the java client class we created earlier.
- Run the java client class in eclipse
- In console window , we should see the output of System.out.print , as in our case result should be
We created the our first Web Service , Such a easy job Isn't it? :)
nice and useful instruction. Thanks
ReplyDeletethere are more errors in your example
ReplyDelete1.TestService should be interface
2.TestServiceStub.ServiceFunctionResponse res = stub.serviceFunction(obj);
TestServiceStub.DataBean data=new TestServiceStub.DataBean();
How you will access the methods in the above step
I dont any reason why testservice should be a interface .......class is ok ....its just a example to show a service side ...its not a genric thing .....
ReplyDeleteplease see this for syntax to access methods :
http://websaxis2tut.blogspot.com/2010/05/writing-java-client-general.html
once u get the data in databean usit get_return() u can use normal java syntax to access methods of databean .
have you tried sending object from client to server?
ReplyDeleteReturning object from server to client works fine, but i am getting error on passing object from client to server.
Any special instructions?
Found your website perfect for my needs. It contains wonderful and helpful posts. I have read most of them and learned a lot from them. You are doing some great work. Thank you for making such a nice website.
ReplyDeleteWeb Services
Nice writing. I think your website should come up much higher in the search results than where it is showing up right now...
ReplyDeleteHi,
ReplyDeleteVery nice article.
I also worked on this but in different way..
check out this link: vishalbolgger.blogspot.in
cheers
Hi.. i am facing a problem after following this tutorial. I am getting an exception:
ReplyDeleteorg.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {webservice1/types}name
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at webservice1.TestDynamicServiceStub.fromOM(TestDynamicServiceStub.java:514)
at webservice1.TestDynamicServiceStub.getLongest(TestDynamicServiceStub.java:193)
at webservice1.TestDynamicServiceClient.main(TestDynamicServiceClient.java:22)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement {webservice1/types}name
at webservice1.xsd.DataBean$Factory.parse(DataBean.java:656)
at types.webservice1.GetLongestResponse$Factory.parse(GetLongestResponse.java:422)
at webservice1.TestDynamicServiceStub.fromOM(TestDynamicServiceStub.java:508)
... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement {webservice1/types}name
at webservice1.xsd.DataBean$Factory.parse(DataBean.java:650)
... 4 more
...when I run the client code. Also, my client code is a bit different that yours as things might have changed from Codegen v1.4 to Codegen v 1.6 (which am using). I used the TCP/IP Monitor in eclipse to monitor the request and response, they seem fine to me. What could be the prob ? Can you please help ? Thanks ! -Mandeep
This comment has been removed by the author.
ReplyDeleteHi Mandeep Singh,
ReplyDeleteDid you get any solution for your problem?
I am also getting same error..
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {webservice1/types}name...
....
Hi Mandeep Singh,
ReplyDeleteDid you any solution for your problem?
I am also getting same error..
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {webservice1/types}name...
....