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.ArgumentException] {"Object type cannot be converted to target
type." }
_remoteStackTraceString "\nServer stack trace: \n at
System.Reflection.RuntimeFieldInfo.InternalSetValu e(Object obj, Object
val, BindingFlags invokeAttr, Binder binder, CultureInfo culture,
Boolean requiresAccessCheck, Boolean isBinderDefault)\r\n at
System.Runtime.Serialization.FormatterServices.Ser ializationSetValue(MemberInfo
fi, Object target, Object value)\r\n at
System.Runtime.Serialization.FormatterServices.Pop ulateObjectMembers(Object
obj, MemberInfo[] members, Object[] data)\r\n at
System.Runtime.Serialization.Formatters.Soap.ReadO bjectInfo.PopulateObjectMembers()\r\n
at
System.Runtime.Serialization.Formatters.Soap.Objec tReader.ParseObjectEnd(ParseRecord
pr)\r\n at
System.Runtime.Serialization.Formatters.Soap.Objec tReader.ParseMemberEnd(ParseRecord
pr)\r\n at
System.Runtime.Serialization.Formatters.Soap.Objec tReader.Parse(ParseRecord
pr)\r\n at
System.Runtime.Serialization.Formatters.Soap.SoapH andler.EndElement(String
prefix, String name, String urn)\r\n at
System.Runtime.Serialization.Formatters.Soap.SoapP arser.ParseXml()\r\n
at System.Runtime.Serialization.Formatters.Soap.SoapP arser.Run()\r\n at
System.Runtime.Serialization.Formatters.Soap.Objec tReader.Deserialize(HeaderHandler
handler, ISerParser serParser)\r\n at
System.Runtime.Serialization.Formatters.Soap.SoapF ormatter.Deserialize(Stream
serializationStream, HeaderHandler handler)\r\n at
System.Runtime.Remoting.Channels.CoreChannel.Deser ializeSoapRequestMessage(Stream
inputStream, Header[] h, Boolean bStrictBinding, TypeFilterLevel
securityLevel)\r\n at
System.Runtime.Remoting.Channels.SoapServerFormatt erSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders&
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