wsdl

Y

yurps

Hello,

I am currently developing a rapid deployment mechanism.

I have a webservice which I must deploy then generate a proxy
stub and add to my website project and then compile that and
deploy. Thing is I have 3 environments DEV, UAT, and PRO and
I need to rename the class name and constuctor accordingly.

thus I call

wsdl http://mysite/MyWebService/Service.asmx?wsdl /out:ServiceUAT.cs

in the .cs file I generate I get a classname and constructor which is
based
on the asmx page name.

public class Molar :
System.Web.Services.Protocols.SoapHttpClientProtocol {

public Molar() {
this.Url = "http://mysite/MyWebService/Service.asmx";
}

but I need to change this to:

public class MolarDEV :
System.Web.Services.Protocols.SoapHttpClientProtocol {

public MolarDEV() {
this.Url = "http://mysite/MyWebService/Service.asmx";
}

Is there a wsdl switch I can use to do this automatically, as the fewer
manual steps
I have in my deployment the better.

Many Thanks in advance,
Matt
 
M

Martin Honnen

yurps wrote:

I have a webservice which I must deploy then generate a proxy
stub and add to my website project and then compile that and
deploy. Thing is I have 3 environments DEV, UAT, and PRO and
I need to rename the class name and constuctor accordingly.
public class Molar :
System.Web.Services.Protocols.SoapHttpClientProtocol {

public Molar() {
this.Url = "http://mysite/MyWebService/Service.asmx";
}

but I need to change this to:

public class MolarDEV :
System.Web.Services.Protocols.SoapHttpClientProtocol {

public MolarDEV() {
this.Url = "http://mysite/MyWebService/Service.asmx";
}

Is there a wsdl switch I can use to do this automatically, as the fewer
manual steps
I have in my deployment the better.

Try wsdl.exe /? to find the command line options, as far as I can see
there is none for the class name but you can use/generate different
namespaces using e.g.
wsdl.exe /namespace:DEV
 
J

Jesse Houwing

Martin said:
yurps wrote:




Try wsdl.exe /? to find the command line options, as far as I can see
there is none for the class name but you can use/generate different
namespaces using e.g.
wsdl.exe /namespace:DEV

Why would you want to generate a proxy with the url integrated into it.
It's duplicating a lot of classes, for a configuration issue.

Why not use

Molar m = new Molar();
m.Url = "http://mysite.etc/Service.asmx";

If you want you can event put this url in the app/web.config file for
automatic configuration at runtime.

Jesse
 
Y

yurps

Not sure...I just started this contract...

I think it is because UAT and STE testing environments are on the
same machine.

PRO and DEV are on separate machines...I guess it just is a way
to differenciate while testing, although I agree a more generic
approach
maybe better.

Anyhow I found a solution and that was to use nAnt to generate wsdl
proxies and then run them thru a filterchain and replace the class name
and constructor...

Anyhow thanks for the reply.
 
J

Jesse Houwing

yurps said:
how can I use wdsl to generate a proxy like this?

This is by default. Url is a property of the base

System.Web.Services.Protocols.SoapHttpClientProtocol

class

Jesse
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top