SOAP POST method performs GET? - java

I have a SOAP webservice that is currently POST method, however I saw on my logs that when client is consuming my service there are two calls being made, 1 is to GET the wsdl file then POST to the webservice? Should it be POST call only?

You can think of the WSDL file as a sort of blueprint for a SOAP service. Given the WSDL, your client application can figure how to use the SOAP service. So I see nothing wrong with your client app first doing a GET to download the WSDL, following by a POST to actually consume the SOAP service.

Related

Calling SOAP service inside REST service

I want to code for a REST service using Restlet framework that wraps a third party SOAP service with some XML data. So whenever I call the REST service with some XML data that REST service internally calls that third party SOAP service with the XML data that I provided and the response travels from that third party SOAP API to REST API and from REST API to me.
I have gone through this questions;
Calling a SOAP service using REST service
Calling SOAP in Jersey
But it didn't help me a lot, So it would be great if anyone provide me the links or tutorial where I can get any help. Thanks.
I think that the following links could help you if you want to implement by hand:
Restlet tutorial - http://restlet.com/technical-resources/restlet-framework/tutorials/2.3
Writing a SOAP Client - https://docs.oracle.com/cd/E19340-01/820-6767/aeqgc/index.html
The key challenge here is to convert request elements into the SOAP request since SOAP only uses HTTP as a transport protocol (both headers and payload) and the same for response (extract headers and payload to build the REST response). With Restlet, you need to leverage its REST API for this. See this link: http://restlet.com/technical-resources/restlet-framework/guide/2.3/core/http-headers-mapping.
I also saw these tools that seem to provide a proxy to adapt a SOAP service as REST service:
Exposing SOAP Services as REST Resources - http://www.membrane-soa.org/service-proxy-doc/4.0/rest2soap-gateway.htm, https://github.com/membrane/service-proxy
a RESTful API proxy to a SOAP-based service - http://apigee.com/docs/api-services/content/exposing-soap-service-api-proxy
Hope it helps you,
Thierry

Post Request Payload to SOAP Webservice using Java

Using request payload, web service, operation names, soap action and all the required details, I need to invoke a soap web service. This has to be done without generating the proxy and any other classes.
I get the request payload as a String, corresponding webservice and operation details to my program and I need to directly post the payload to the webservice by attaching the required webservice policy.
Please suggest the way to achieve it. Kindly let me know if it is not clear
Thanks

SOAP service and REST Client in one app

I am working on a webservice app that takes SOAP requests on one end with a id, I wrote java beans and generated wsdl. It is working fine independently. Then I made a REST Client using apache HttpClient using the interface CloseableHttpClient. This part works independently as well when I make a rest request with a static ID.
Now when I merged the REST client code with the soap service and try to test it using SoapUI, I get :
java.lang.reflect.InvocationTargetException.
The webservice is working fine but when I call the REST client the thread hangs up at when trying to execute.
CloseableHttpResponse response = httpclient.execute(post);
Im thinking there's some design issues with how I'm merging this. Right now, I'm calling im Instantiating the object that makes the rest call within the Soap Request class and calling the method from within the soap request class
Can anyone please help me point to the right direction about how I should design it. I was not able to find any examples on this either online
Thanks

HTTPGET request of a soap webservice in java application

I had written a method in soap web service which returns the data from database. now i am facing the problem to write HTTP GET request in java application. Any help and suggestions will be appreciated
Thank you
Why you are not using jax-ws or apache axis2 or apache CXF for consuming your webbservice ? Direct http invoke will be little tricky and you will required to construct your soap message and some http headers to call soap based service directly http client. check the http client for soap service here How to call a SOAP webservice with a simple String (xml in string format)

CXF: getting SOAP request and response XML on the client-side

I'd like to have a CXF client which allows me to see the SOAP XML request made and response received.
Use case: I'm writing a test GUI for the service for people who don't have access to my CXF service's logs to get an idea what the SOAP requests need to look like and what gets returned. (Since the interface is rather complicated, a generic / dynamic GUI like SOAP UI isn't helpful).
I've already read about CXF interceptors and know how I could hook them to my client (one for the "receive" and one for the "send" phase). But I can't think of a way of making the interceptor pass the request/response XML somehow back to the client's request.
Any suggestions / ideas?
You should take a look at the code of org.apache.cxf.interceptor.Logging{In|Out}Interceptor.

Categories