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. Thank you! :) But I have a question, why is that t
View Tutorial          By: choco at 2010-01-03 02:16:18

2. hi can u send me the complete working code for sen
View Tutorial          By: Amit Adhikaree at 2011-03-22 17:47:49

3. Thanks for the info
View Tutorial          By: info at 2010-01-31 12:17:58

4. @Eric

You would have to know the lo

View Tutorial          By: Guy at 2010-09-27 17:18:31

5. ' REFERENCIA EN EL PROYECTO (Microsoft Excel 12.0
View Tutorial          By: Anonymous at 2015-04-21 03:10:41

6. Thank You very much :)
View Tutorial          By: RaghuCK at 2010-09-09 13:53:26

7. site is good.explaining the concept with nice pro
View Tutorial          By: AJOY KUMAR MANDAL at 2012-11-22 01:57:26

8. can you clearly reveal how to create crystal repor
View Tutorial          By: halim at 2011-07-02 00:28:48

9. your code error

because i try to ru

View Tutorial          By: Nasser at 2013-01-09 10:33:34

10. thanks
View Tutorial          By: snooker at 2013-02-04 19:45:40