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

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 1326
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("/webservicelocation/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********@gmail.com> wrote in message
news:87*************************@posting.google.co m...
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
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...
1
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...
1
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...
4
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,...
8
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...
0
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...
2
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...
0
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...
3
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:
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: 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...

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.