wsdl

Discussion in 'ASP .Net Web Services' started by yurps, Jun 27, 2006.

  1. yurps

    yurps Guest

    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
    yurps, Jun 27, 2006
    #1
    1. Advertising

  2. 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

    --

    Martin Honnen --- MVP XML
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 27, 2006
    #2
    1. Advertising

  3. Martin Honnen wrote:
    >
    >
    > 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
    >


    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
    Jesse Houwing, Jun 27, 2006
    #3
  4. yurps

    yurps Guest

    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.


    Jesse Houwing wrote:
    > Martin Honnen wrote:
    > >
    > >
    > > 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
    > >

    >
    > 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
    yurps, Jun 29, 2006
    #4
  5. yurps

    yurps Guest

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

    Thanks


    Jesse Houwing wrote:
    > Martin Honnen wrote:
    > >
    > >
    > > 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
    > >

    >
    > 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
    yurps, Jul 4, 2006
    #5
  6. yurps wrote:
    > 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

    >
    > Thanks
    >
    >
    > Jesse Houwing wrote:
    >> Martin Honnen wrote:
    >>>
    >>> 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
    >>>

    >> 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

    >
    Jesse Houwing, Jul 4, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dark
    Replies:
    1
    Views:
    4,613
    milfar
    Nov 14, 2008
  2. Chris Bedford
    Replies:
    0
    Views:
    568
    Chris Bedford
    Aug 21, 2003
  3. Stephen Edgecombe

    WSDL.EXE: WSDL Import Directive

    Stephen Edgecombe, Aug 13, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    230
    Stephen Edgecombe
    Aug 13, 2003
  4. RH
    Replies:
    1
    Views:
    255
    Dino Chiesa [Microsoft]
    May 27, 2004
  5. mrnu

    wsdl.exe fails with WebMethods generated wsdl file

    mrnu, Jun 7, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    199
Loading...

Share This Page