Comment on Tutorial - Java WebService - Create your first web service in Java By Emiley J



Comment Added by : Carlos Kassab

Comment Added at : 2015-02-20 17:18:06

Comment on Tutorial : Java WebService - Create your first web service in Java By Emiley J
This is just the web service, if you want to consume it, you need to create a program to consume it

java javamples.one.TimeServerPublisher

Do not close the publisher and go to folder javasamples/one

run the next command:

wsimport -s . http://127.0.0.1:9876/one?wsdl

It will create a structure of java files and will compile them.

Create file javasamples/one/TimeClient.java

Copy this content inside file TimeClient.java :
import javasamples.one.TimeServer;
import javasamples.one.TimeServerImplService;

public class TimeClient {

/**
* @author Carlos Kassab
*/
public static void main(String[] args) {

TimeServerImplService timeServerService = new TimeServerImplService();
TimeServer timeServer = timeServerService.getTimeServerImplPort();
System.out.println(timeServer.getTimeAsString());
}
}

From the command window, go to folder javasamples/one
Compile program TimeClient.java: javac TimeClient.java

Run program: java TimeClient.java
You should see something like this: Fri Feb 20 11:10:57 CST 2015


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. plz send inheritance concept,how to use final,thi
View Tutorial          By: sobha at 2010-02-14 08:29:33

2. On my blog (http://www.future-edge.nl/blog/adding-
View Tutorial          By: Robert Willems at 2011-11-29 06:26:21

3. sooo nice...:****...love u...
View Tutorial          By: vinoo gopal rao at 2011-07-03 08:54:29

4. thank u its a clear information .i got the solutio
View Tutorial          By: anand at 2011-06-29 09:30:12

5. You explained the this Keyword very well.
&

View Tutorial          By: Karan at 2012-12-04 11:27:35

6. its is good..I am developing a Form based applicat
View Tutorial          By: Bhavani at 2010-10-18 01:39:41

7. imgView.setBackgroundResource(R.drawable.ani); i g
View Tutorial          By: mamu at 2012-10-18 14:41:31

8. Hello there , i am unable to understand read and w
View Tutorial          By: deepak at 2014-12-10 14:04:42

9. Thank u it helps me alot.....
View Tutorial          By: Ramya at 2012-02-22 10:16:14

10. THANX :)
View Tutorial          By: Saurabh at 2012-01-02 16:13:06