473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Calling a web service from within a DLL

Hi,

I am trying to call a web service from within a dll, with that dll
being loaded and called dynamically.

eg.

Assembly assembly = Assembly.LoadFile(@"C:\path\myfile.dll");
Type type = assembly.GetType("myfile.Class1");
object instance = Activator.CreateInstance(type);

object returnvalue = type.InvokeMember("MyMethod",
BindingFlags.InvokeMethod | BindingFlags.Default,
null, instance, null);

The assembly, type and instance are all populated correctly and I can
call other methods just fine, but as soon as I invoke "MyMethod" as
above, which calls a web service internally, it fails with a casting
error. Monitoring the web server shows that the web service was called
successfully but the response was incorrectly cast. Any ideas?

I know that the code within my dll is correct because if I reference
and call the method directly (eg. myfile.Class1 test= new
myfile.Class1(); test.MyMethod(); ) then the web service gets called
and completes successfully.

Hope someone can help,

Regards, Paul.

Oct 12 '06 #1
2 1204
Forgot to say... VS2005!

Oct 12 '06 #2
I've done some subsequent testing and found out that if I call it from
a Web Application Project
(http://msdn.microsoft.com/vstudio/de...sp#wapp_topic4)
then it works. Its only when I call from a Web Site Project (the
default with VS2005) it fails.

Oct 12 '06 #3

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

Similar topics

4
by: Robert E. Flaherty | last post by:
I know that you can call SQL Server from a web service but from within a stored procedure can you call a web service?
0
by: TMN | last post by:
I have an appplication that uses Enterprise Services components built with C#. The core app works fine, the components work as expected in COM+, etc. However, I now need to have one of the...
0
by: jimmyfishbean | last post by:
Hi, I am using ASP.NET (framework 1.1), Windows 2003, IIS 6.0. I have a VB.NET web service client that connects/calls a web service written in ASP.NET (both applications are installed on the...
2
by: Jon | last post by:
Hi all, I'm trying to call a web service from an asp.net (v1.1) page written in C# (the web service was written in C# too) and I keep getting a "The request failed with HTTP status 401:...
1
by: fallenidol | last post by:
hi i'm looking for some heads up info regarding calling and using a web service from within another web service. is this acceptable practice? if not why? what should i be thinking about here? ...
1
by: ananth | last post by:
Hi All, I have a web service created in Notes Database and i am calling the web service in Visual studio.Net application by adding a web reference. I need to have authentication...
3
by: xs | last post by:
Dear all, I would like to know who is calling the web service so that my web service can process accordingly. Is there anyway I can do that? Thanks
2
by: =?Utf-8?B?SnVsaWFu?= | last post by:
My first problem is: I am having an issue when using a web service. The web service is written by another department and say its running fine but when I call it, I sometimes I get a...
1
by: samdediacre | last post by:
Hi all, I have developped a very simple Windows service that references a managed .NET dll. the code within the dll contains a static class to read/write data from registry. So the OnStart()...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...

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.