473,802 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I generate some code in the proxy code?

Hi there,

I am very new to C# and dot net. I am currently working on a web
service and a client. Now I need to change the default class
construction in the proxy code from

this.Url = "some http url"

to some code of my own, such as reading from a database, etc.
What I am doing is get the proxy code by wsdl and then edit it.

But everytime I changed my server code, especially the interface, I
need to get the new proxy code with wsdl, which overwrites my changes
to the proxy code. I need to make the same changes again.

Is there any way that I can put some code in the server code, so that
whenever swdl downloads the proxy code, my code is already there?

Thank you very much.
Shi
Jul 21 '05 #1
1 1362
If all you are doing is overwriting the URL property, then your problem can
be solved in three ways.

a) this is a public property. Overwrite it in the calling class.
MyService myserv = new MyService();
myserv.Url = Mylib.GetConfig ("/webservicelocat ion/myservice");

b) set the URL Behavior of the web service Dynamic (on the client side)
which means that the generated class will automatically look in the config
file for the URL setting.

c) use a parameter of the WSDL.EXE executable (which generates your proxy
class) to specify the URL that the class should use.

This is kindof a fun posting... the blogger posted the first solution, and
got feedback about the other two. :-)
http://dotnetjunkies.com/WebLog/jpal.../01/34485.aspx

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

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.
--
"Shi Jin" <ji********@gma il.com> wrote in message
news:87******** *************** **@posting.goog le.com...
Hi there,

I am very new to C# and dot net. I am currently working on a web
service and a client. Now I need to change the default class
construction in the proxy code from

this.Url = "some http url"

to some code of my own, such as reading from a database, etc.
What I am doing is get the proxy code by wsdl and then edit it.

But everytime I changed my server code, especially the interface, I
need to get the new proxy code with wsdl, which overwrites my changes
to the proxy code. I need to make the same changes again.

Is there any way that I can put some code in the server code, so that
whenever swdl downloads the proxy code, my code is already there?

Thank you very much.
Shi

Jul 21 '05 #2

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

Similar topics

1
9906
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or more operations were skipped. Warnings were encountered. Review generated source comments for more details.
1
1682
by: Alexander Kaplunov | last post by:
I have a web service, which has a reference to a class. I want to be able to accept this class as a parameter to my web service method. When the consumer consumes the web service, proxy class is created. This proxy has my class but for some reason it does not generate methods, only properties. Here is my code.... ****Class***** public class Class1
1
340
by: Shi Jin | last post by:
Hi there, I am very new to C# and dot net. I am currently working on a web service and a client. Now I need to change the default class construction in the proxy code from this.Url = "some http url" to some code of my own, such as reading from a database, etc. What I am doing is get the proxy code by wsdl and then edit it.
4
3433
by: BillyLiu007 | last post by:
Hi all: Its easy for us to use the wdsl.exe to generate a proxy or server side stub from the .wsdl file. but when .wdsl file its not just one file, it import another .wdsl file and schema file, the wsdl.exe cannot generate any outcome. I read from the article said its the limitation of the wsdl.exe , but anyone know any way to solve the issue, or is there any replacement tools ? --
8
6461
by: Phil Lee | last post by:
I'm sure this is possible but I just can't see how to do it. I want to add schemas to my solution and have C# classes automatically generated from them. I can see how to generate typed DataSet's with the MSDataSetGenerator custom tool. Is there something similar for simple schemas? Regards Phil Lee
0
5115
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below the wsdl). This complex type is a collection of another complex type(elementType), and the Reference.cs has an array of these rather than the single returnedElementsType. If If I want to be able to obtain these elements from the SOAP response I...
2
3465
by: John | last post by:
I already have an existing WSDL file and want to generate C# proxy code and C# test client using Visual Studio .NET 2003 with Framework Version 1.1. I firsted created ASP.NET web service, and added web reference that points to the WSDL URL. I am able to see the methods for that web service, and I am able to see C# proxy code generated by WSDL. Then I press F5 to compile and run the web services. However I got the following error...
0
954
by: Ron James | last post by:
I'm using C# to write test cases for our http SOAP server. I've generated a proxy class from our wsdl and the positive test cases are simple to write. However I'd also like to write negative test cases, including sending garbage to our server and ensuring it handles things gracefully. I'm thinking along the lines of deriving a WebRequest class (MyHttpWebRequest) from HttpWebRequest and deriving a proxy class from my WSDL generated proxy...
3
4996
by: Fred | last post by:
Is there an option to get the proxy generator to generate lists for the client instead of arrays? for example public partial class Foo { public int bar; } would be instead:
0
9699
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9562
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
10305
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10285
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10063
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
9115
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
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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.