Post Request Payload to SOAP Webservice using Java - 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

Related

Create SOAP service facade in Java

I have a java web application (with Servlets) which has several REST and SOAP based interfaces.
For SOAP interfaces, I have hard coded request XML which I post using Jersey HttpClient and extract data from response XML using StringUtils. I'm not using any special libraries in my application for these interfaces.
Now I have to create one new SOAP interface which uses Asynchronous messaging i.e. I have to give a callback URL where actual response will be sent.
Problem is that this interface requires callback URL to implement some SOAP web-service based on some response WSDL given in interface documentation.
I don't want to implement SOAP server or add libraries for this. I simply want to create a servlet for callback URL which will receive response XML. Is there any way I can achieve this?
I created a servlet with one GET and POST methods mapped to the path of callback URL
GET method provides hardcoded WSDL required by client interface. Port address in this WSDL again points to the callback URL (handled by my servlet) where client interface posts response SOAP XML.
POST method receives response SOAP XML from client interface and parses it to get the result.
This way one servlet acts as SOAP service without adding any external libraries

SOAP POST method performs GET?

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.

What is best way to configure soap based web services in HTML5 based apps

I am developing banking mobile apps using html5 for client as communicate back-end system they provided soap based xml services.
To make a soap request, i doesn't want to write code in ".js" file because of code complexity and not found request and response logs in production phases.
now i want to make separate project to maintain the web-service request and response business logic using java?
from .js, I want to make a http request to call the web service as a response i want to get json an object?.
Please correct me if i was wrong, Please help me how to separate web service logic into a single project?
Note: I doesn't want to configure my soap request through js file.
Regards,
nag
Write a servlet or httphandler(if IIS) that interacts with SOAP services and parses the information and creates a json response for the JS client.
You JS client interacts with servlet/httphandler and handles when it json response when it receives it.

It there any standard way to redirect SOAP request?

The problem is following:
Some client tries to access an SOAP webservce
Webservice implementation anylizes request and comes to conclusion that it is not able to proccess the request itself. However, the webservice knows what some additional webservice should be called instead of one.
???
Client calls "additional webservice" like he did at step 1
It there any specific standard or technique for this?
Use the proper HTTP status code for redirection. A status of 303 See Other comes to mind.

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