Calling a SOAP service using REST service

13,010

Solution 1

You cannot use a REST service framework to access a SOAP Web-Service. This are two completely different technologies.

It's like you're asking how to drive with a locomotive on a motorway...

Solution 2

You can call the SOAP service using restful API. In SOAP the xml is built dynamically. You can built the soap request XML in your program and call the SOAP URI with this xml as string parameter.

Share:
13,010

Related videos on Youtube

RBz
Author by

RBz

Emigrant Coder

Updated on June 22, 2022

Comments

  • RBz
    RBz almost 2 years

    I want to call a SOAP service using REST service. Can anybody please share some example programme or snippets where we can invoke a soap service using JAX-RS(Jersey) written REST service. I am using jdk 1.7 & eclipse juno. What will we be using to refer to the soap service? Please note that I am entirely new to webservice, so examples will be a huge help!

  • RBz
    RBz over 9 years
    I didnt know anything about this but i found an answer saying it is just a normal thing to do at this link stackoverflow.com/questions/17986498/calling-soap-in-jersey Is this answer wrong or my understandin?? @Uwe Plonus
  • Uwe Plonus
    Uwe Plonus over 9 years
    @RBz Perhaps you question is not clear. If you want to wrap a SOAP service with a REST Service then this is possible as described in the answer mentioned. If you want to call a SOAP Service using a REST service then this is simple impossible.
  • RBz
    RBz over 9 years
    Can you please define what we mean by wrapping? Please forgive my ignorence, i dont understand how both are different. @Uwe Plonus
  • Uwe Plonus
    Uwe Plonus over 9 years
    @RBz Wrapping means that you create a REST service and call a SOAP service out of the newly created REST service. Calling means that you create a REST service and want to call a SOAP service with this.
  • RBz
    RBz over 9 years
    I cant say I am clear about what you are saying. Reading your answer and the comments together. Can you give an example so that i can relate? @Uwe Plonus
  • Uwe Plonus
    Uwe Plonus over 9 years
    @RBz to explain it with pseudo code: Using MyService extends RESTClient to access a SOAP service does not work (Calling). Using MyService extends RESTService and handle() { call SOAPService } will work as you create a new web service that is a REST service and call from this new service a SOAP web service (Wrapping).
  • RBz
    RBz over 9 years
    So practically its safe to say that we can invoke/use a soap service inside rest. Thats what i was trying to understand. Thanks @Uwe Plonus