In Orch: System.InvalidCastException when .NET assembly calls com
From: aman (aman_at_discussions.microsoft.com)
Date: 02/08/05
- Next message: Tristan W: "Re: SAP Adapter Error"
- Previous message: Campbell McNeill: "Database Value Extractor not working in Production Environment"
- Next in thread: Matt Milner: "Re: In Orch: System.InvalidCastException when .NET assembly calls com"
- Reply: Matt Milner: "Re: In Orch: System.InvalidCastException when .NET assembly calls com"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 8 Feb 2022 08:49:06 -0800
Ok here is the scenario.
(1) I am using a COM component (call it A) that is an application proxy from
a different server.
(2) Created an signed Interop assembly using the tlbimp utility and put it
in the GAC
(3) Got a .NET component (call it B) that uses the interop for some
functionality
(4) Call to .NET component from a windows form is fine.
(6) Wrote a biztalk orchestration that uses the .NET component (B)
(7) Published the orchestration as webservice
(8) call to the webservice works fine when a method does not call interop
assembly (A).
(9) call to the webservice fails with the following errro when the method
calls the interop assembly.
The adapter "SOAP" raised an error message. Details "An exception is thrown
by the Orchestration schedule, Date Dump: <string>Message : QueryInterface
for interface tax.IAvailabilityInterface failed.
Source : interop.tax
Type : System.InvalidCastException
</string>".
(10) Did some debugging line by line (printing to the log file) and found
the exact line where it fails.
oAvail.LineIndex = iLineIndex
where oAvail is an object of interop assembly (A) called by the .NET
assembly (B),
where iLineIndex is an integer,
where the property oAvail.LineIndex is also an integer
(11) Remember this works fine when called from and windows.net form
application
(12) Did some further investigation using the ildasm on the interop assembly
and found :
.property int32 LineIndex() {
.custom instance void
[mscorlib]System.Runtime.InteropServices.DispIdAttribute::.ctor(int32) = ( 01
00 0A 00 00 00 00 00 )
.set instance void tax.IAvailabilityInterface::set_LineIndex(int32)
} // end of property IAvailabilityInterface::LineIndex
(13) Hmm.. int32 eh? did a
oAvail.LineIndex = Convert.ToInt32(iLineIndex)
but still the same problem when calling from an orchestration. This Code
compiles fine and works fine again from a windows .net forms application
(14) HELP!!!!.. any suggestions, thoughs would be much appreciated.
Best Regards,
aman
- Next message: Tristan W: "Re: SAP Adapter Error"
- Previous message: Campbell McNeill: "Database Value Extractor not working in Production Environment"
- Next in thread: Matt Milner: "Re: In Orch: System.InvalidCastException when .NET assembly calls com"
- Reply: Matt Milner: "Re: In Orch: System.InvalidCastException when .NET assembly calls com"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|