Hi
I am calling a method of a .NET component from both win forms and web
service applications.
Strangly, it is working fine from win forms application, but when i
call the same method (same code with same input values) of that . NET
component from the web service method it is giving the following
exception,
[System.Argument Exception] {"Object type cannot be converted to target
type." }
_remoteStackTra ceString "\nServer stack trace: \n at
System.Reflecti on.RuntimeField Info.InternalSe tValue(Object obj, Object
val, BindingFlags invokeAttr, Binder binder, CultureInfo culture,
Boolean requiresAccessC heck, Boolean isBinderDefault )\r\n at
System.Runtime. Serialization.F ormatterService s.Serialization SetValue(Member Info
fi, Object target, Object value)\r\n at
System.Runtime. Serialization.F ormatterService s.PopulateObjec tMembers(Object
obj, MemberInfo[] members, Object[] data)\r\n at
System.Runtime. Serialization.F ormatters.Soap. ReadObjectInfo. PopulateObjectM embers()\r\n
at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.Pa rseObjectEnd(Pa rseRecord
pr)\r\n at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.Pa rseMemberEnd(Pa rseRecord
pr)\r\n at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.Pa rse(ParseRecord
pr)\r\n at
System.Runtime. Serialization.F ormatters.Soap. SoapHandler.End Element(String
prefix, String name, String urn)\r\n at
System.Runtime. Serialization.F ormatters.Soap. SoapParser.Pars eXml()\r\n
at System.Runtime. Serialization.F ormatters.Soap. SoapParser.Run( )\r\n at
System.Runtime. Serialization.F ormatters.Soap. ObjectReader.De serialize(Heade rHandler
handler, ISerParser serParser)\r\n at
System.Runtime. Serialization.F ormatters.Soap. SoapFormatter.D eserialize(Stre am
serializationSt ream, HeaderHandler handler)\r\n at
System.Runtime. Remoting.Channe ls.CoreChannel. DeserializeSoap RequestMessage( Stream
inputStream, Header[] h, Boolean bStrictBinding, TypeFilterLevel
securityLevel)\ r\n at
System.Runtime. Remoting.Channe ls.SoapServerFo rmatterSink.Pro cessMessage(ISe rverChannelSink Stack
sinkStack, IMessage requestMsg, ITransportHeade rs requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeade rs&
responseHeaders , Stream& responseStream) \n\nException rethrown at [0]:
\n" string
I don't know how come the same code is working from the win forms
button action.
Can anyone please suggest me on might be the problem. I both cases i am
referencing the .NET dll to the application.
Thanks,
DPP
--
dpp
------------------------------------------------------------------------
dpp's Profile:
http://www.hightechtalks.com/m268
View this thread:
http://www.hightechtalks.com/t2286146