I am using gSoap and I have a similar problem. I have to program a server. The client should send a subscription request (that would include its URL). The server stores this information, and replies to the client. This is done. However, how does the server send the notifications to the client when the events take place?
I have written the rest of the services, where the server responses the requests of the client. But I have no idea about how to do the rest of the program.
I would need to create three kinds of functions:
1) A method for the client to to subscribe:
int __ns1__SubscribeToEventNotifications(
struct soap* p_soap,
_ns1__SubscribeToEventNotifications *ns1__SubscribeToEventNotifications,
_ns1__SubscribeToEventNotificationsResponse,
&ns1__SubscribeToEventNotificationsResponse
);
2) A method for the server to notify an enevent to the subscribed clients:
int __ns1__NotifyEventHappened(
struct soap* p_soap,
_ns1__EventHappened *ns1__EventHappened,
_ns1__EventHappenedResponse &ns1__NotifyEventHappenedResponse
);
3) A method for the client to unsubscribe:
int __ns1__UnsubscribeFromEventNotifications(
struct soap* p_soap,
_ns1__UnsubscribeFromEventNotifications,
*ns1__UnsubscribeFromEventNotifications,
_ns1__UnsubscribeFromEventNotificationsResponse,
&ns1__UnsubscribeFromEventNotificationssResponse
);
In SOAP web service callback architecture?, Glen Best wrote:
"You can push the notification from the server to the client if you know the client's SOAP endpoint address. The client can transfer it's SOAP endpoint address within original SOAP request payload. Sometime later the server can send a SOAP request to the client."
How is this request from server to client done?
Thanks in advance, David Marcos
Related
I have created a sample chat application using .NET Framework WebAPI project using the reference: https://www.c-sharpcorner.com/article/push-notification-in-web-application-using-web-api-and-pushcontentstream)
enter link description here
I tried to create an MFC client application to communicate with this server.
For that used WinHttp functions. But while sending request using "WinHttpSendRequest" API, it is waiting for some time (~30seconds) and returns success. The request received at WebAPI chat server without delay when the "WinHttpSendRequest" API is called.
Then while calling "WinHttpReceiveResponse" API, it fails with timeout error.
The sample MFC client application can communicate with other servers which can send HTTP response other than content-type: text/event-stream.
So my doubt is, is it possible to create an http client in c++ to subscribe for PUSH notification and receive PUSH notification (content-type: text/event-stream)?
My aim is to create a client in c++ using Windows default libraries.
Please give your valuable advice. Thank you.
Use "WinHttpSetTimeouts" API to set receive timeout as infinite (-1). Then "WinHttpSendRequest" API will wait until a response (PUSH notification) is received from server.
After receiving the response, subscribe for the PUSH notification by calling "WinHttpSendRequest" again. That is subscription should be done after receiving each PUSH notification.
We have a legacy server that receive requests in 2 ways:
Http REST requests via Jetty
Raw TCP sockets
We have a new requirement to process a raw request (delivered via TCP) and delegate this request to be processed by Jetty internally as if it would arrived via regular HTTP request.
Is that possible?
If not I guess the naive way would be to create an HTTP client and post it to ourselves as soon as we get data on the TCP socket.
I would like to test my web service listener class. The listener class can able to send and receive soap request and response respectively using C++11 and cURL. But My listener needs to receive push messages as well which I am not sure whether my listener able to do it or not. I have WSDL (2)files of the actual web service. Where in I have a message formats for responses.
Basically I want to configure SOAP UI which accepts connection request, if it is connected it should start pushing messages to the connected client. Is there any possibility to implement such scenario in SOAP UI? {if there is any other ways to the implement the same also welcome}
Once I have connected with the web service the connection will left open. Whenever the service have new message, it will simply send the message to the client with out the need of any request from client. I hope now it is clear.
I am trying to send a message from NetSuite to another system via http SOAP, but I was told that I have send a signed soap message. NetSuite only has an operation called nlapiRequestURL(url, postdata, headers); I am trying to use this method to send over a manually created SOAP message. What I am having problems with is figuring out how to add the cert to the header. Has anyone does this before?
What I have learned about signing a soap message with the certificate is that I need private key and public in the local keystore. This tutorial in java shows how to do it, but how would I do something similar in NetSuite.
https://dzone.com/articles/signing-soap-messages
One possible solution is you write your own proxy web server in Java
or any other server side language for that matter.
Below is the summary of my suggestion:
1) Send the request details from NetSuite to proxy server using a
Suitelet or scheduled script.
2) In the proxy server create the signed SOAP request and send to the
vendor API
3) Now, to respond back to NetSuite there are two options a) you
keep the connection open with NetSuite until you get the response and
send it back to NetSUite's script b)you respond back to a NetSuite
RESTlet, which makes the design asynchronous and can be good specially
if the turn around time is more than 45 seconds.
Also, I would suggest to write web server using HTTPS, with your server having a trusted CA signed certificate, so, that communication between web server and NetSuite is secure. And this way your communication would be secure (P.S. I can't answer the question that is SSL 100% secure, there are good discussion on http://security.stackexchange.com on that topic).
Which HTTP Method is used to send SOAP messages?
I guess, if you are working at the servlet level,you could define the HTTP method(would there still be restrictions?).
But if all that is hidden, and I'm using a simple JAX WS webservice, which HTTP method would(should??) the request and response messages have?
I think JAX-WS and most other implementations use post for transmitting requests
you can verify it by capturing the request in TCP IP monitor