• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
I'm just a poor boy, I need no sympathy, because I'm easy come, easy go, little high, little low, little ad
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic