473,789 Members | 2,419 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 1360
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
1680
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
3431
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
6460
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
953
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
10404
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10193
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
10136
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
9016
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...
1
7525
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6761
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5415
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.