Here's my situation:
- I have a
wsdl
, "translated" to a header file like this:wsdl2h -o file.h file.wsdl
- Then, I executed
soapcpp2 -Icorrect_path -j file.h
- On "server side" I implemented the service, using
soapXXXService.[h|cpp]
- On "server side" again, I used
soap_init2
(withSOAP_IO_KEEPALIVE
), I havesoap_bind
,soap_accept
,soap_copy
, etc. and it seems to work perfectly fine (see below) - On "client side", I use the generated
proxy
object (again usingSOAP_IO_KEEPALIVE
), construct the message and send it to the server - The "server" receives this message and sends back ACK (custom
XML
) - The "client" receives the
ACK
and everything is perfectly fine.
So, what I want to do now is make the "server" return the "real" response to the "client" and the "client" has to return back an ACK
to the "server".
How is this possible? (it should be)
"What have you tried?"
Two things come to my mind.
The first is to somehow reuse the socket's file descriptor, returned from soap_accept
, to send the "real response" back to the server. But Is this even possible?
Unix sockets are full duplex, so this is technically possible, but does gSoap
restricts this? Because I didn't see anything about this in the documentation.
The second option, that comes to my mind is to create the same "service" in the "client", to make it possible to receive messages (the "real response") and to return ACK
the same way it's done in the "server". But this would mean, that the "server" must also has an instance of proxy
object to be able to send this so called "real response".
And this sounds really ugly and horrible to me. Not that I'll be surprised if this is the only option, but..
Edit: for the second option - this would mean, that the client should have a listener port, should handle incoming connections, etc. Does not sound like a client to me..
I understand, that I may be missing some fundamental part(s) of how gSoap
works, but I read the whole user documentation and the "getting started" guide and I didn't find anything about this.
Please, let me know if something is not clear
EDIT: Here's the scenario, I want to achieve:
- client sends request to the server
- server returns ACK as response (like the standard ACK) - signals successfully received request
- later, the server sends response to the client (that's the real response)
- the client returns ACK again - signals successfully received response
And this scenario could be in the opposite direction, too: server could also send request to the client. That would mean - the same scenario as above, but replacing "client" <-> "server".
NOTE: both request/response
and ACK
ARE SOAP messages.
SOAP
) and I cannot eliminate anything. My client should be able to communicate with other servers, too. – Fatso