• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Advice / Help on calling a Web Service from a Java Swing App.

 
Ranch Hand
Posts: 272
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Java 8 and I would like some advice on how to accomplish the same result as this sample code Labelary ZPL Web Service which is unfortunately written for Java 11.



I am vaguely aware that some API's were moved out of Java 11 and if at all possible I would like a solution which is both compliant with Java 8 and Java 11.

Web services are something to which I have no experience of and a pointer at a suitable 3rd party library would save me a lot of hunting around.

My first attempt has come across Apache CXF and I downloaded it, but the associated lib folder contains an overwhelming number of jar files to choose from. I'm not using Maven in my project.

Dave
 
Saloon Keeper
Posts: 6698
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about the client side or the server side? The code you posted is client side, but CXF is server side.

What's more, CXF implements SOAP, whereas these days most WS are implemented using REST.
 
David Garratt
Ranch Hand
Posts: 272
Mac Eclipse IDE Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry - the client side. To replicate the functionality of the example code (Java 11) but I need to perform the same using Java 8

Thanks
 
Tim Moores
Saloon Keeper
Posts: 6698
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. In that case, you may be just fine with using HttpUrlConnection and related classes. Those have been part of Java since forever.
 
Sheriff
Posts: 22037
108
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or switch to Apache HttpClient. I've been using that one for years, lately even with version 5, since that supports HTTP/2.
 
reply
    Bookmark Topic Watch Topic
  • New Topic