• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webservice for beginners

 
ujwwala tem
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am new to webservice,and I want to work at client side for requirements so what can be the task in a brief for client side for webservices and also guide me for good tutorial link,I am trying to learn throgh google but for easy understanding I am looking for.

Thanks,
Ujwwala
 
Jim Akmer
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually if you work at the client side only, it means that a web service is already deployed and the wsdl is available. So using various generators by JAX WS, cxf or axis what ever framework you decide to use, you create client stubs created by the wsdl processing. After you have the stubs in place you start developing your code so that you can communicate with the web service. A simple tutorial can be found here Design and Develop JAX WS services
 
ujwwala tem
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the info,

I am trying to run as per the totorial,Its running step by steb but at last in the class Orderclient.java for the OrderItem item = new OrderItem();
item.setItemId("11");
item.setQty(11);

order.getOrderItems().add(item); I am not able to add the item,Its giving me as compiler error, I had java6 installed on my m/c I made the settiongs in eclipse also,set the environment variables also,On my m/c there are jdk1.5 also but I am not using them,Please help where could be the problem.

Thanks,
Ujwwala
 
ujwwala tem
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have checked java -version in the command prompt Its giving me for 1.6 I am not able to figure out why the order.getOrderItems().add(item); causing syntax error no add function
 
Bernhard Haeussermann
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please show us some more of the code that precedes the call to the add() method, so we can see what the context is.
Please also give us the exact message string of the compiler error.
What type of object does the getOrderItems() method return?
 
ujwwala tem
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code in orderclient as per the tutorial you had given https://www6.software.ibm.com/developerworks/education/ws-jax/section5.html


So its saying as can not invoke add(OrderItem) on the arraytype OrderItem[] in orderclient.java as I have java6 and in eclipse I have configured all the settings jdk1.6 and all and in environment variables aslo I have set.

Thanks,
Ujwwala
 
Bernhard Haeussermann
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ujwwala,

the problem is not your JDK. In Java, an array does indeed not have an add() method.
I suspect that the problem is in the OrderBean class. Perhaps orderItems should have been a List<OrderItem> and not an OrderItem[].
If the length of the array returned by getOrderItems() is larger than 0 (you can use the length-data member of the array to inspect its length, as in System.out.println(order.getOrderItems().length)), then you could simply assign the OrderItem object to the first element of the array, as in order.getOrderItems()[0] = item; .
If this doesn't work (perhaps because the length of the array is 0), your OrderBean class won't cut it. In this case the problem evidently lies in the client stub generator that you're using. Try using a different one.
 
Jim Akmer
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried the code in my machine, not used an IDE and have java 1.6.0_20 and it works fine. Did you just try to copy-paste the code?
Better is to download the code of the tutorial from Source code of tutorial and try again.
 
dibakar sinha
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am a beginner. I want to learn webservices .Please help me with some tutorial or files , Using example will be great!!!
 
Vijitha Kumara
Bartender
Posts: 3918
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dibakar sinha wrote:I am a beginner. I want to learn webservices .Please help me with some tutorial or files , Using example will be great!!!

Introduction to web services with examples(in NetBeans) can be found here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic