How to do a SOAP Web Service call from Java class

This example will show you how to do a SOAP web service call from Java class. Normally you would use the web service library for invoking the SOAP service but in some cases this could be useful and quick. For example, you may have problems generating a client proxy with a web service library or if you only need some small specific parts of the response. It is just a SOAP call over HTTP, from a plain piece of Java code without using any Java library. In fact you can invoke SOAP service from any language being web service platform independent.

Now in order to consume the service or SOAP web service call from Java class, we must have the service deployed somewhere. So please read Spring SOAP WebService Producers using Gradle before consuming this SOAP service. We will create here client which will consume the service in the given link. If you want to use library to consume the service then you can read Spring SOAP WebService Consumers using Gradle

Continue reading “How to do a SOAP Web Service call from Java class”

Send Any File using SOAP Webservice

This tutorial shows how we can send file using SOAP based webservice. The type of the file can be anything, i.e., text, image, pdf, MS doc etc. For this type of application we need to create two applications – one will work as a client application(which sends a file) and other one will work as a server application(which receives a file). So the server application will deploy the service whereas client application will consume the service. In server application we will have logic for what will be done with the file content after receiving the file. Using the client application we will upload the file and send through the SOAP service.

In this example both client and server applications are web based application. In client application we will upload the file using JSP, Servlet and send it to the server application which then saves the received file to the specific location on disk.

Please feel free to contact me for any kind of help. Continue reading “Send Any File using SOAP Webservice”