Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the least painful way to consume SOAP web services in Java

Most projects, we seem to do some kind of SOAP web service consumption. And every time, it feels like being hit repeatedly over the head with a brick. For example, we end up with:

  • Dozens of generated classes our developers barely understand
  • Awkward APIs (especially when consuming .NET web services)
  • Hacks to deal with the fact that we normally generate from a local WSDL file (the remote service rarely exists at the time we start development)

In Python, I've used Suds (https://fedorahosted.org/suds), which provides a really natural (but obviously less type-safe) API. I know this is comparing apples and oranges, but there has got to be a less painful way to call a remote web service than generating so much code.

We'll probably use this in the Play framework for the time being, although I'd like something generic if possible. We also use Spring a lot, although I'm looking into Guice right now for a simpler alternative.

Martin

like image 722
optilude Avatar asked Jan 23 '11 12:01

optilude


People also ask

What is SOAP web service in Java?

SOAP stands for Simple Object Access Protocol. It is a XML-based protocol for accessing web services. SOAP is a W3C recommendation for communication between two applications. SOAP is XML based protocol. It is platform independent and language independent.

How do you call a SOAP Web service from REST API in spring boot?

Steps to Consume a SOAP service :Create spring boot project and Get the WSDL from the provider . Convert the WSDL to Stub. Understand the request ,response and the types ,operations using any tool like SOAP UI. Form the request object by mapping data and call the soap uri with marshal the java objects as XML.

How do you use SOAP API?

To consume a SOAP Web Service in your application, do the following: In the Logic tab, open the Integrations folder. Right-click the SOAP element and select Consume SOAP Web Service.... In the displayed dialog, specify the location of the Web Service definition (WSDL) and click Consume.


2 Answers

i've had pretty good experience using the apache axis2 librarys. Any point against those?

(forgot the link: http://axis.apache.org/axis2/java/core/ )

like image 180
Blitz Avatar answered Oct 06 '22 01:10

Blitz


Check Apache CXF (http://www.coderanch.com/t/224490/Web-Services/java/Axis-Vs-CXF). It is very easy to use.

like image 32
Marcin Michalski Avatar answered Oct 06 '22 01:10

Marcin Michalski