I have a web service (Called ABWebService) that I have created that contacts someone else's webservice (ZWebService). My main project has a reference to ABWebService and also has a reference to ZWebService, which it needs to contact directly. The problem I have is if I create a WebMethod in ABWebService that gets passed an object from ZWebService in the web method it is expecting and object of type ZWebService. But in the Main Project if I call the web method in ABWebService the object type for what I am passing is ABWebService.object, even though the type of object I want to pass to it is ZWebService.object. It then says I can't do this because they are different types. Any suggestions?
caksabre2
Posts
-
Web Services Issue -
Creating a Help FormSorry Henry, but I tried searching on that with the quotes and still didn't find anything. Could you specify and exact page? Thanks
-
Creating a Help FormHello, I really want to create a help page in my C# windows application and was wondering if anyone has any recommendations on best practice for this. Cheers, Chris
-
Multi-threading - Parallel SyncronizationThanks for the reply's. I have changed the code to have 4 threads, and have stopped reallocating the event and it seems to have fixed any sync issues. Thanks
-
Multi-threading - Parallel SyncronizationHello, I have a program that opens multiple user controls, each one needing to run 3 parallel processes. It needs to run all 3 simultaneously, and then when all 3 are complete run a process. This needs to occur every second. What I have done, is create 3 threads, one main thread which when it starts running it calls two .Set() methods for manualevent handlers which then sets the other two threads running. I then have a waitall in the main thread (after the point where it has done its work) which waits for the other two threads to complete. At the end of the two threads I have a waitall which waits for a different manualevent to be reset (which happens when the main thread finishes). Now this all seems to work fine, but when running 4 user controls at once, approximetly every minute the threads somehow get confused and one of the waitall's for the two sub threads get stuck. So I have put a timeout parameter here which is a hack, and doesn't really solve why it is locking up. I can't put all the code in but below is an example of it working. Can anyone help come up with why this is occurring, or a better way of doing this? //Thread Ones Run Method public void ThreadOne() { while(true) { ogEvents[0] = new ManualResetEvent(false); ogEvents[1] = new ManualResetEvent(false); //Do a task here //Wait for the other 2 threads to finish bool blSuccess = WaitHandle.WaitAll(ogEvents, 4000, false); //Do some calcs Thread.Sleep(1000); ogThreadTwo[0].Set(); ogThreadThree[0].Set(); } } //Thread Two's Run Method public void ThreadTwo() { while(true) { //Do some task //Task Finished ogEvents[0].Set(); ogThreadTwo[0] = new ManualResetEvent(false); bool blSuccess = WaitHandle.WaitAll(ogThreadTwo, 4000, false); } } //Thread Three's Run Method public void ThreadThree() { while(true) { //Do some task //Task Finished ogEvents[0].Set(); ogThreadThree[0] = new ManualResetEvent(false); bool blSuccess = WaitHandle.WaitAll(ogThreadThree, 4000, false); } }
-
Closing a User Control from itselfThanks, this worked perfectly :)
-
Closing a User Control from itselfHi, Does anyone know how I can remove a user control from a panel it has been added too, by a button on itself. Like an x button. Cheers, Chris
-
Class Libraries and Web ReferencesWell I have only just started creating this, so I was using Web Services as that is what I know. But if it will work with WCF I will try that instead. Just to add to the complexity the class library needs to be able to access another external web service that isn't mine, and all the applications need to create and pass objects of this web service type. Should I just forget Class Libraries?
-
Class Libraries and Web ReferencesHello, I have two C# Applications one client side, one server side, which communicate via a web service that I am creating also. I wanted to create a class library so that classes that are used between the three applications can be re-used. I want to allow one of the webmethods in the web service to accept an object of one of the classes I have created in the class library but when I try and pass it from either application it says I can't because the types are different. ABSWebService.Market doesn't equal ABSClassLibrary.Market (Event though in the web service it is referencing the Class Library to get the Market). I have tried to cast it to the other type, but this isn't allowed either. Any suggestions?