SOAP UI as a server to push messages to the client connected - c++

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.

Related

What is this distributed communication model called (client-server-engine)?

I'm looking for a communication model that is constructed the following way:
One or more clients can connect to a server
One (chess-)engine connects to the server
The information flow is only one way, e.g if any client sends a message to the server, the server will forward the message to the engine. But if the engine responds, it should first send the respond to the server which forwards the response to the specific client.
Additionally, do you have any ideas or code examples on how to program that using c++ with boost/beast?

Is it possible to write a c++ client using WinHttp APIs to receive PUSH notification from an HTTP Server?

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.

Soap request to a client in gSoap

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

Setting up a HTTP Receiver in Tibco Businessworks for an existing Web Service

So currently I managed to reach an existant Web Service and use one of it's functions to alter a database.
However, the Web Service does not respond with a Soap Response, but with just the HTTP Respond Code 200, which I want to use to create a "Success!"-like notification.
Using BusinessWorks I was able to to connect the process with a HTTP Receiver in the Modeler-View, but it doesn't work and gives me the error message
"Process configuration error. The activity [HTTPReceiver] in the process [webservices.module.IWSContract] cannot have an input transition."
My goal is to catch the HTTP Response Code 200 from the Web Service, and optionally display it to the user.
As you mention you use TIBCO BW 6. this should be the "Invoke" activity instead of SOAPRequestreply (Basic Palette -> Invoke)
You need to use a SOAP Request-Reply activity to invoke the web service. Technically, the "HTTP 200" response won't be visible but you will get an empty output in case of a success:
You can then choose to return whatever success message to the user.

How to call web service Asynchronously in Tibco BW?

I am able to call web service synchronously in tibco BW using SOAP Request Reply but unable to call asynchronously.
Can anyone please help me how to call web service asynchronously in tibco.
Asynchronous web service calls is accomplished using SOAP over JMS. A SOAP/JMS binding must be declared in the WSDL and the web service provider must be listening on the associated queue or topic.
You can use the SOAP Request Reply activity to call a web service over JMS.
It depends on the transport, if you use a HTTP transport you must always wait for a response. Waiting for a HTTP response doesn't mean you have to execute the functionality at that moment, if you are able to save the request at server side you may response with just a 200, the response could event be blank. If you use JMS transport, it will provide loosly coupling in time, that means, the point in time when an action is requested does not have to be the same as when the server process the action. If you plan to use the service under heavy load, jms transport is preferred as it is non-blocking, and use of hardware resources is more predictible.
Webservices may define in the wsdls http transport, jms transport or even both at the same time.
If the WSDL does not have response message, then the SoapRequestReply will not wait for response and will work asynchronously.
In Asynchronously communication client or request input will do it's work without waiting for response instantaneously after sending the message.
We can use SOAP over JMS to accomplish Asynchronous web service calls. A SOAP/JMS binding must be stated in the WSDL and the web service provider must be listening on the related queue or topic. We can utilize the SOAP Request Reply activity to call a web service over JMS.
If you utilizing JMS transport, it will give loosely coupling in time, that means, the point in time when an action is requested does not have to be the same as when the server process the action. If you are planning to utilize the service under heavy load, JMS transport is preferred as it is non-blocking, and use of hardware resources is more predictable.