473,406 Members | 2,816 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,406 software developers and data experts.

Remote Procedure Calls


So I'm just having a play with RPCs from C# using WSDL to generate lots of
C# code, compile it, load it in as a DLL and then call the functions. It
occurs to me that .NET should facilitate the run-time code generation that
makes these things so easy in languages like Python but Microsoft chose the
code-generation and compilation route. Why? Can you not use reflection to
build an API on-the-fly?

--
Dr Jon D Harrop, Flying Frog Consultancy
The OCaml Journal
http://www.ffconsultancy.com/product...ournal/?usenet
Jul 6 '07 #1
3 4802
Jon,

No, you can't use Reflection, because you don't have a type to reflect
off of. That's what WSDL is for, it is the equivalent of a Type (more or
less) in web-services parlance. All that generated code is doing the work
of generating .NET type equivalents for the WSDL definition of the methods
exposed.

Now, if you look at the generated code, you'll notice that the class
derives from the SoapHttpClientProtocol class. There is nothing stopping
you from creating an instance of this class and setting the URL of the
service, then calling the Invoke method, passing the parameters you want to
the service, and getting the results. This is exactly what the typed
methods on the proxy do.

If you need to get further down to the metal, and want to process the
XML message that is returned to you, then you might want to use WCF, as it
will give you direct access to the message sent over the wire, and you can
work with it from there.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jon Harrop" <jo*@ffconsultancy.comwrote in message
news:46**********************@ptn-nntp-reader02.plus.net...
>
So I'm just having a play with RPCs from C# using WSDL to generate lots of
C# code, compile it, load it in as a DLL and then call the functions. It
occurs to me that .NET should facilitate the run-time code generation that
makes these things so easy in languages like Python but Microsoft chose
the
code-generation and compilation route. Why? Can you not use reflection to
build an API on-the-fly?

--
Dr Jon D Harrop, Flying Frog Consultancy
The OCaml Journal
http://www.ffconsultancy.com/product...ournal/?usenet

Jul 6 '07 #2
Jon Harrop wrote:
So I'm just having a play with RPCs from C# using WSDL to generate lots of
C# code, compile it, load it in as a DLL and then call the functions. It
occurs to me that .NET should facilitate the run-time code generation that
makes these things so easy in languages like Python but Microsoft chose the
code-generation and compilation route. Why? Can you not use reflection to
build an API on-the-fly?
They could.

But there are not much point.

C# is intended as a static typed language. If you wanted
dynamic typing you would use another language.

Arne
Jul 7 '07 #3
Nicholas Paldino [.NET/C# MVP] wrote:
No, you can't use Reflection, because you don't have a type to reflect
off of.
Can you not use obj and make the RPC "obj list -obj"?
Now, if you look at the generated code, you'll notice that the class
derives from the SoapHttpClientProtocol class. There is nothing stopping
you from creating an instance of this class and setting the URL of the
service, then calling the Invoke method, passing the parameters you want
to the service, and getting the results. This is exactly what the typed
methods on the proxy do.
Great. That may well be a better option for me.

Many thanks,
--
Dr Jon D Harrop, Flying Frog Consultancy
The OCaml Journal
http://www.ffconsultancy.com/product...ournal/?usenet
Jul 7 '07 #4

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

Similar topics

0
by: Charley | last post by:
Hi, My local procedure needs to call a remote stored procedure which dblink name is built at the run time depending on the input parameter to the local procedure. Therefore depending on the...
0
by: Kid A | last post by:
I am writing stored proecdures on Oracle 9 (release 1 I believe). I am having difficulty creating a stored procedure that makes a remote function call to a database on a different host. On the...
4
by: rockie12 | last post by:
I have a situation where I want to take data from a local sql server 2000 db and update a remote database. I have the sql all set, was wondering if this can be done in a timed interval with a...
5
by: Mike L | last post by:
I'm able to connect to my stored procedure in my local database but not able to connect to my stored procedure in the remote database. I use several different UserID and Password that all should...
0
by: matvdl | last post by:
My asp.net application depends on obtaining allot of data from a remote application. This application is a bit of a monster and it is not an option to install it on the asp.net system. Note - the...
0
by: 124256 | last post by:
I'm trying to get an event-handler relationship set up over a remote tcp connection. I have set the security level so that I can serialize any object (full). My server has a "game" object which has...
0
by: aravindalapat | last post by:
Hi All, I am facing an error when I try to invoke a remote nested stored proc. Please find the details below. 1) SP TEST1 is defined in DB2 instance DB2A. It is calling a stored procedure ...
8
by: BD | last post by:
I am developing C# win form app to work with remote database on SQL Server 2005. Problem scenario is as follows: 1. a form is open that has downloaded dataset to local cache 2. computer is...
11
by: JCav | last post by:
I need to call a COM object from a remote machine using C#. I also need to pass on a different userID and password to the call. Has anyone done this? I've used Java to do this using JIntegra, but...
0
by: LitaOsiris | last post by:
Hello everyone. I am having a problem with a customer's website which is running from IIS (version 6, I think). It's a web ordering form written in ASP.Net and when the order is submitted it calls...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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
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
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,...
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.