• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Regarding Web Service Call from Java

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you asking this question? You're in a position to try the code, we're not.
 
reply
    Bookmark Topic Watch Topic
  • New Topic