Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Experts
First of all sorry for this strange question, but please keep in mind I’m a completely noob in Web developing. In this situation I have to give a hand to Web developer to use some special algorithms which I can provide only in W32.

My idea was/is to support a W32 DLL which can be called by the Web Part. So far so good but if I think more about this, I stick completely.

Assume I support a W32 DLL with a method
"char* DoRequest(char* XMLUTF8Data)"
receiving the input as XMLUTF8Data(RQST= "DoThis" or RQST= "DoThat") and returning the result also as XMLUTF8Data.

Still, so far so good. But assume now my DoRequest needs several minutes to process certain request. So I cannot block the Web Part for several minutes. Also I like to give the Web Part the chance at least to poll the current progress (I know polling is bad, but I have no other idea at the moment).

Therefore next idea: Ok Web Part gives me a unique "Transaction ID" for a DoRequest(RQST= "DoThis", TID= "xyz") which needs long processing time and my DoRequest returns immediately. Web Part can afterwards poll the progress with DoRequest(RQST= "ProgressDoThis", TID= "xyz"). But to hold a list of pending transactions I need to be sure that always one and the same W32 DLL Instance will be called. How can I guarantee this? And also always the same DLL instance means process parallel requests I have to organize by myself... Or do I have to go the harder way and pass all requests to a process?

My feeling is, I’m completely on a wrong way / wrong design. Can anybody give me an input in which direction I have to go?

Thank you very much in advance.
Regards

N.B: Web Server is MS- IIS

What I have tried:

Read a lot of documents about Web stuff (WebServices, IIS and lot more) but I am flooded by all the Information and don't find a clear way :(
Posted
Comments
Kornfeld Eliyahu Peter 16-Feb-16 15:33pm    
Maybe a WCF/SOAP wrapper for the DLL...You can call them asynchronously...
[no name] 17-Feb-16 7:11am    
Thank you very much for your Feedback. I tried it with a WCF Web Service. What I recognized is, that only one instance of my DLL will be loaded, even two parallel request are running. So this maybe can be the solution even I have than to parallelize the Calculation Jobs on W32 by myself.

Thanks again.
Bruno
Kornfeld Eliyahu Peter 17-Feb-16 7:17am    
It happens only if your DLL is single threaded...
But you may overcome it anyway by WCF Instancing...
https://msdn.microsoft.com/en-us/library/ms731193(v=vs.110).aspx
http://www.codeproject.com/Articles/86007/ways-to-do-WCF-instance-management-Per-call-Per
[no name] 17-Feb-16 8:15am    
Thank you very much for this. At the first glance this Looks exactly what I'm looking for. But because of my "not-knowledge" I did not even know the keywords to Google for it.
Kornfeld Eliyahu Peter 17-Feb-16 8:17am    
If it works out for you, write an article/tip about how to do it!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900