473,395 Members | 1,701 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,395 software developers and data experts.

dynamic creation of web service proxy...

I know this has probably been asked a lot but I can't find any good exmaples
so....

Can anyone give some url's to C# code that dynaimcally generates a web
service proxy at runtime?

Cheers

Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.


Nov 17 '05 #1
7 1740
Ollie,

You will want to use the SoapHttpClientProtocol class. It will allow
you to make late-bound calls to SOAP services. As a matter of fact, when
you create proxies in VS.NET, the classes derive from this, and all method
calls actually package up calls to the Invoke method on the same class.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I know this has probably been asked a lot but I can't find any good
exmaples so....

Can anyone give some url's to C# code that dynaimcally generates a web
service proxy at runtime?

Cheers

Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.

Nov 17 '05 #2
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
Ollie,

You will want to use the SoapHttpClientProtocol class. It will allow
you to make late-bound calls to SOAP services. As a matter of fact, when
you create proxies in VS.NET, the classes derive from this, and all method
calls actually package up calls to the Invoke method on the same class.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I know this has probably been asked a lot but I can't find any good
exmaples so....

Can anyone give some url's to C# code that dynaimcally generates a web
service proxy at runtime?

Cheers

Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer
helping programmers.


Nov 17 '05 #3
Ollie,

I'm actually in NYC, so from a local perspective, I'm in the east...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Ollie,

You will want to use the SoapHttpClientProtocol class. It will allow
you to make late-bound calls to SOAP services. As a matter of fact, when
you create proxies in VS.NET, the classes derive from this, and all
method calls actually package up calls to the Invoke method on the same
class.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I know this has probably been asked a lot but I can't find any good
exmaples so....

Can anyone give some url's to C# code that dynaimcally generates a web
service proxy at runtime?

Cheers

Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer
helping programmers.



Nov 17 '05 #4
that's west of here :)

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:u1**************@TK2MSFTNGP10.phx.gbl...
Ollie,

I'm actually in NYC, so from a local perspective, I'm in the east...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Ollie,

You will want to use the SoapHttpClientProtocol class. It will allow
you to make late-bound calls to SOAP services. As a matter of fact,
when you create proxies in VS.NET, the classes derive from this, and all
method calls actually package up calls to the Invoke method on the same
class.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
I know this has probably been asked a lot but I can't find any good
exmaples so....

Can anyone give some url's to C# code that dynaimcally generates a web
service proxy at runtime?

Cheers

Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer
helping programmers.




Nov 17 '05 #5
Yes, but since the planet is round, doesn't that mean that if you go far
enough west, you will eventually be east (and vice versa)?
"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:uq*************@TK2MSFTNGP15.phx.gbl...
that's west of here :)

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:u1**************@TK2MSFTNGP10.phx.gbl...
Ollie,

I'm actually in NYC, so from a local perspective, I'm in the east...
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
'Still the fast answer in the west' :)

Thanks

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in message news:%2****************@TK2MSFTNGP12.phx.gbl...
Ollie,

You will want to use the SoapHttpClientProtocol class. It will
allow you to make late-bound calls to SOAP services. As a matter of
fact, when you create proxies in VS.NET, the classes derive from this,
and all method calls actually package up calls to the Invoke method on
the same class.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie Riches" <ol**********@phoneanalyser.net> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
>I know this has probably been asked a lot but I can't find any good
>exmaples so....
>
> Can anyone give some url's to C# code that dynaimcally generates a web
> service proxy at runtime?
>
> Cheers
>
> Ollie Riches
> http://www.phoneanalyser.net
>
>
> Disclaimer: Opinions expressed in this forum are my own, and not
> representative of my employer.
> I do not answer questions on behalf of my employer. I'm just a
> programmer
> helping programmers.
>
>
>
>



Nov 17 '05 #6
www.thinktecture.com has some code that does this though it needs
amending for reference and out parameters. Also I am having problems
with it working when anonymous access is turned off.

if you figure out how to set credentials on this dynamically created
proxy, let me know

Nov 17 '05 #7
Ollie,
Been down that road :( Unfortunately, there's not many googlets out there
with help on this and related topics. Here is some (modified) code I wrote to
do this. I also included a few other useful lines which set credentials,
timeouts, and connection limits. I hope it helps.

John

public ServiceInit()
{
MyService WebService = new MyService();

RegistryKey hklm = Registry.LocalMachine;
RegistryKey hkNterWeb = hklm.OpenSubKey(@"SOFTWARE\MyApp\WebService");
RegistryKey hkConfiguration = hkNterWeb.OpenSubKey(@"Configuration");

WebService.Url = (String) hkConfiguration.GetValue("WebServiceURL");
ServiceTimeout = int.Parse((String)
hkConfiguration.GetValue("WebServiceTimeout"));
ServiceConnections = int.Parse((String)
hkConfiguration.GetValue("WebServiceConnections")) ;
hklm.Close();

WebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
WebService.Timeout = ServiceTimeout;

HttpWebResponse res = null;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create (WebService.Url);
res = (HttpWebResponse)req.GetResponse ();
ServicePoint currentServicePoint = req.ServicePoint;
currentServicePoint.MaxIdleTime = ServiceTimeout;
currentServicePoint.ConnectionLimit = ServiceConnections;

}
"Ollie Riches" wrote:
I know this has probably been asked a lot but I can't find any good exmaples
so....

Can anyone give some url's to C# code that dynaimcally generates a web
service proxy at runtime?

Cheers

Ollie Riches
http://www.phoneanalyser.net
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a programmer
helping programmers.


Nov 17 '05 #8

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

Similar topics

1
by: Generic Usenet Account | last post by:
Most of the open source web-service products that I am reading about seem to require generation of client stub and server implementation ancestor classes from the WSDL file. The client application...
5
by: Ron | last post by:
I have a bunch of Crystal Reports (v9) published as WebServices and use a ReportViewer to display the reports on the ASPNET page. Everytime we move the reports from dev to production we have to...
5
by: Demetri | last post by:
Is it possible to add a web service reference during runtime? If so, how? -- -Demetri
3
by: Tim Zych | last post by:
To create a web service proxy you can use wsdl.exe and vbc.exe using command line, then set a reference to the resulting dll, or alternatively add a web reference and let vs.net do it all for us. ...
2
by: WhiskyRomeo | last post by:
I am trying to use dynamic URL and the app.config to specify the actuall url of a web service. It isn't working. When using static URL there is no problem. The name of my application is...
7
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We...
5
by: Kimba | last post by:
Hi. Using VStudio I have developed a WebService which I placed onto several servers. However my application can only access one on server. During runtime, I tried to change the URL of the...
2
by: James | last post by:
Hello, I have an existing MFC C++ project which I need to add the ability of sending WSDL calls out to a web service. When this project is deployed the web service URL will always change...
1
by: webServiceHelp | last post by:
hi... I have deployed a web service ..generated wsdl. but i can't understand how to do my ultimate job. I want to do the following.. 1) The Requestor would find "the Service" from the "UDDI...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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...

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.