Question

Nowdays there is the server (gsoap) written by c++. I have c# application (c# 4.0, winforms). I generate wsdl from this service. So I can call some functions in my app.

But the duration of this functions is more than hour. I think, that the best way is:

1) I call this function in thread in my application.

2) Another person call this function in separate thread in their application.

But this person tell me that it is impossible. She says, that "in gsoap there is no such functionality as thread"

Is it true? I do not understand why it is impossible..

Était-ce utile?

La solution

1) I call this function in thread in my application.

2) Another person call this function in separate thread in their application.

If by application you mean the webservice client application the short answer is no that in itself won't cause gsoap to handle requests on multiple threads. gsoap doesn't provide any multithreading functionality out of the box. Launching a separate thread in the client application doesn't launch a corresponding thread on the (gsoap) server.

Your hunch though that multiple threads could be used to handle requests from multiple clients is right. However you'll need to create and manage those threads yourself in the gsoap application. You may find the this discussion helpful - gSOAP Multithreading

Autres conseils

When you have a service-call that is running for an hour or more...wouldn't it be better to modify your service-interface? You could return an "id" of some sort (integer, or maybe a GUID). And have a call IsFinished(id), which returns the current status. When IsFinished returns true, the User can then retrive the result via a GetResult(id) call.

This is more work on the interface side, but maybe it makes your server easier to maintain. And it is cleaner on the client side.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top