473,544 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web service method call exception

dpp

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

Nov 23 '05 #1
0 1320

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6983
by: Hardy Wang | last post by:
Hi all: I read an article from http://www.c-sharpcorner.com/Code/2003/Sept/InstallingWinServiceProgrammatically.asp about how to install a windows service programmatically. Based ont the code sample, it provides the feature to install service under LocalSystem account. What I need is to install service under some other certian account. By...
1
3722
by: Ajay Pal Singh | last post by:
Hi, I am making an windows service similar to windows task schedular. The service would invoke the methods of some assemblies at some predefined schedules. (windows service read the method/assembly and schedule info from app.config file) I am using reflection to dynamically load the assemblies and then want to call a method of that assembly...
5
12924
by: Dhilip Kumar | last post by:
Hi All, I'm writing a Windows Service app using C#. I need to read some configuration settings before the service starts up. These settings will be used by the service in its operation. Question is, which is the best way to store & retrieve the settings? I'm thinking of storing it in the registry in HKLM\Software\ServiceName and access...
3
4975
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function...
0
2072
by: whizpop | last post by:
Hi, First of all, thanks for a great starter kit, now If I could just get it to work (fully). I am trying to compile and run the solution/services all on a local dev box. I am able to successfully run most of the SampleApp features (Register,Feedback,Error report, version check) The only method I can not execute is the BuyNow example. I...
1
2622
by: Scott Yen | last post by:
Hi, I'm using the following Axis java client to invoke a .Net web service hosted my localhost. Although the username and password is set on the "call", client gets (401) Access Denied" exception. private static void testTest() { try { String endpoint = "http://localhost/WebService1/Service1.asmx"; String method = "Test";
2
4936
by: Richard Collette | last post by:
Hi, I have a service, that runs perfectly when executed outside of the web service environment. When called as a web service I get the exception listed below sporadically. A call to the web method may succeed one time and not another. I cannot find any reason why it would work one time and not another. The exception occurs every two...
3
6601
dmjpro
by: dmjpro | last post by:
plz send me a good link which can clearify me how the J2EE framework works i want the details information .... plz help thanx
6
3344
by: alho | last post by:
The web service is called by a program running on pocket pc. When to call the web service, the first call is still ok, but for the second or later calls, it will throw "403 Forbidden" WebException. When to test it using the web interface on pocket IE, everything is fine. Before there was no such problem, it only happened within a week or...
4
5627
by: dlc9s | last post by:
Hi All, I have a JSR 168 portlet that I need to call a J2EE 1.4 JAX-RPC Web Service. I'm using Oracle 10g JDeveloper. (I don't have a choice about this). It works when I call the sync method, but it won't recognizine the async method. I'm thinking I have to use the async method of the WS because the WS takes a while to do it's thing and...
0
7413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7358
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7697
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5894
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4902
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1831
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
650
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.