System.InvalidCastException when moving Com based WebService to distributed platform 
Author Message
 System.InvalidCastException when moving Com based WebService to distributed platform

Here's the setup.

I did my development on 1 box.
On that box, I took a Series of DLL's that I wanted to call and Wrote a
Wrapper project
so that I only had to expose 1 interface.  These DLL's were then registered
in MTS
I then wrote a Web Service to utilize the Interface DLL.  Walla.  Worked
like a charm.

Then moving it to production, I separated the application from the web
server into the
structure below.

Box1                                                  Box2
COM DLL Server                              IIS Web Server
(Several COM DLL's)  -------------->Proxy
                                                            a VB.Net Web
Service

The Web Service now generated the error:
System.InvalidCastException: QueryInterface for interface
ValExcelProxy._EVERatesNFacts
failed. at ValExcelProxy.EVERatesNFactsClass.TreatyFact(String Source,
String TreatyID, String BenefitID, String OracleFieldName, String UserID,
String Pwd, String DSN) at ExcelSvc.EVE.TreatyFactA(String Source, String
TreatyID, String BenefitID, String OracleFieldName, String UserID, String
Password, String DSN) in C:\Inetpub\wwwroot\ExcelSvc\EVE.asmx.vb:line 121

Solution Attempts:
1. As u can see, I tried to make the com data types as generic as possible,
but still no luck.
2. I read that sometimes this means the Threading model needs to be STA, so
I added

System.Threading.Thread.CurrentThread.apartmentState=System.Threading.Apartm
entState.STA
    but again, no luck

I believe the issue is entirely in Data Marshaling.  Does anyone know
anything about this issue?

Thanks in Advance
-Ev



Sat, 21 May 2005 04:12:06 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. com+ System.InvalidCastException: QueryInterface for interface failed

2. Report based on XML date (WebService)

3. Trouble calling xmethods.com WebServices

4. VB6-SOAP-WEBSERVICE Question: Receiving an object of a class defined in the webservice

5. Script-based Distributed programming environments?

6. Distributing Jet 2.0 based VB apps

7. Script-based Distributed programming environments?

8. re-distributing ADO based projects

9. combobox won't be plat

10. Distribute Outlook COM-Addins

11. Distribute OL2000-COM-AddIn

12. Error 462: Remote server machine does not exist, etc when running distributed COM

 

 
Powered by phpBB® Forum Software