SOAP request over HTTP delay - web-services

I am trying to send a SOAP request over HTTP for a web service through the following channels:
Telnet (HP-UX)
C client that opens a socket, writes XML and reads reasponse(HP-UX)
Perl client that does the same thing as the C client above(HP-UX)
Through SOAP UI application (http://www.soapui.org/)(Windows Machine)
While SOAP UI gets a response in about 100ms seconds or so; the rest of the channels get the same response but very slow.
I am wondering what might be the problem. If anybody has any idea about this please let me know.

Possibly the connection stays open per default for subsequent requests (not uncommon for webservers which expect you to request all kinds of javascript files, images, css files directly afterwards). You might want to try to send the Connection: close header.

Check the protocol , may be you are using HTTP1.0 not HTTP1.1

Related

Choosing the scenario of using Web Sockets in standard HTTP REST API

I will be happy to get advice from more experienced developers about adding Web Sockets into my HTTP-based project.
That’s the thing. I have developed the REST API based service. Everything works well enough, but… In some special cases my server needs a long time to serve client requests. It may be from 1 minute to several hours (and even days)! I implement some not-so-good algorithm to address this issue:
Client sends HTTP request
Server replies about registering request
Client starts sending HTTP requests to get necessary data (if response does not have needed information the client sends another request and so on)
That is all in a nutshell.
And it seems to be a bad scenario and I am trying to integrate web sockets for adding duplex-channels in this architecture. I hope that my API will be able to send info about updated data as soon as possible without the necessity of many requests from the client.
But I am a bit confused in choosing one of two ways to use web socket (WS).
Variant A.
The server only tells the client via WS that data is ready. And the client gets data by standard request-response HTTP method from REST API.
Variant B.
The server sends all data to the client via WS without HTTP at all.
What variant is more suitable? Or maybe some other variants?
I do not want to remove HTTP at all. I just try to implement WS for a particular kind of end-points.
Variant A would be more suitable and easy to implement. You can send message to the client after the data is ready, and he can then send request for the data. It will be like a simple chat websocket, and will serve your purpose.

How to change soap context's mode in Gsoap when deploying a service using mod_gsoap?

So I am deploying a web service developed using gsoap using mod_gsoap. I wanted to set SOAP_IO_KEEPALIVE and SOAP_IO_CHUNK modes of the soap context object to accept chunked requests. How do I achieve this?
Or is there any other way to accept chunked requests? Right now the server responds as soon as it receives the first chunk without waiting for the rest.
The documentation says:
Warning
Do not use any of the SOAP_IO flags to initialize or set the
context, such as SOAP_IO_KEEPALIVE and SOAP_IO_CHUNK.
The Apache server controls the connection settings and HTTP payload parameters to send and receive HTTP requests. Data is received with ap_get_client_block, which de-chunks the content when chunked.

Receiving http requests with winsock

For educational purposes I am trying to make a web api in c++. the web api needs to be able to listen for http requests(GET, POST etc.), when it receives a http request it needs to be able to send data back to the client. Because it is for educational purposes I would like to do it without unnecessary libraries. Now the first thing I need to do is make the api able to receive requests and respond on that, after some research on google I found out that winsock is probably the most basic way to setup sockets for windows but I could find very little on receiving http requests.
My question is: Is it possible with winsock to receive a http request from the browser, and send data back to the browser?.
My question is: Is it possible with winsock to receive a http request from the browser, and send data back to the browser?
Yes. ^^
It is, Because HTTP is a protocol that (usually) uses TCP as the underlying transportation protocol.
But trying to build a real HTTP layer on top of a simple win32 socket is a bit too much even for an experienced C++ developer.
Many un-experienced C++ developers would probably dismiss this task as a "well, you just need to read some data, parse the headers, assemble your own HTTP response and send it back".
but..
You will have to support
TLS, with all the nasty private keys/public keys implementation
Redirection
Chunked Transfer
G-Zip transfer
and the list goes on and on..
So practically speaking, if you just want to to accept a socket, read some data and send some basic HTTP response than yes. If you want a reliable, professional HTTP library - probably no.
You can check this page https://github.com/ReneNyffenegger/cpp-webserver to see simple winsock server implementation for HTTP. Web server implementation is not so difficult. Of course you should have time for it.

How can I see incoming Requests in IIS7?

I have a created web service that takes 2 complex types as parameters. I can use the auto-generated WSDL to create a new application that calls my web service and it works perfectly.
However, a 3rd party consumer is having trouble calling my web service. I see their incoming request in the IIS7 log file and a 500 error is being returned to them.
I suspect that their request is malformed. I would like to be able to see the entire <soap:envelope> that IIS7 is receiving so that I can troubleshoot the issue. I am using Windows Server 2008 and IIS7.
How can I do this?
I would open up a copy of WireShark while they are putting their request through. You can then see each packet which comes to your server. Wireshark is cool because it can put all of the packets back together so you can see the full HTTP request they're sending.

How to create a web wervice in java/Axis2 which should keep publishing data

I am a new to Axis2 and SOAP. I recently working on a Axis2 SOAP project, I have create a SOAP server and SOAP client by using java and axis2 implementing session scope. The problem is when I send a request, it returns response back only once. I am unable to make web service keep publishing data periodically untill the session end. Can any body help me...
Thanks in advance
I might be wrong, but I think since you work with HTTP you can't make the
response permanent until you make your client perform calls permanently / periodically.
Permanent Requests --> Permanent Responses
I echo KB22's response - HTTP has a request-response flow, so your service is receiving a single request and sending back a single response. Implementing session scope means that you have a logical session for multiple request/responses to be tied together. You have a few options here:
Make the client wait until you have all the data to send back in one response. However, if this takes too long you may well get timeout issues on the client.
Change your model, so that you send in multiple requests and get back the data in pieces.
Change your model to a polling style, where you keep sending requests (and receive empty responses) until all the data is ready to be sent back.
Change your protocol to something that is asynchronous (e.g. JMS) so that you send in a request to a queue and at some later time the response turns up on the queue for your client to read.