473,804 Members | 2,164 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 1338

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

Similar topics

9
7033
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 further studying the code, and MSDN...
1
3742
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 on separate thread. I am using code similar to following : public void...
5
12950
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 it using the Registry class in the "public ServiceName()" method. I'm instructing the service...
3
5006
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 HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
0
2096
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 have tried leveraging the Sharewarestarterkit.com web service to rule out locality, to no avail.
1
2637
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
4957
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 or three calls to the web method. The service utilizes a COM component provided by PeopleSoft...
3
6630
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
3375
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 so. I suspect it's caused by the server's firewall settings, but how come the first call is ok? This...
4
5645
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 return. If it doesn't take a while, everything works fine. If it does take a while, my portlet becomes...
0
9594
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10096
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9174
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4311
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
2
3834
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.