Hello,
i am new to web services, i want to call a web service from a
java file.
i have written code like this,
String wsdlURL = "http://localhost:8080/FRT/services/DataSyncService?wsdl";
String namespace = "http://spireline.com";
//String serviceName = "HelloWebService";
String serviceName = "DataSyncService";
QName serviceQN = new QName(namespace, serviceName);
ServiceFactory serviceFactory;
try {
serviceFactory = ServiceFactory.newInstance();
/* The "new URL(wsdlURL)" parameter is optional */
try {
Service service = serviceFactory.createService(new URL(wsdlURL), serviceQN);
DataSyncServiceService ds = (DataSyncServiceService) service.getPort(DataSyncServiceService.class);
System.err.println("DataSyncService Location Is " + ds.getDataSyncServiceAddress());
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
so will this code work?..let me know.. and tx