How to override address location in WSDL ports

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • GavinM

    How to override address location in WSDL ports

    I have the same question as andreas.w.h.k asked on 1/5.

    Our configuration is as follows:

    The client must use the URL https://clustername.xyz.com/webservice.asmx to
    access this web service.

    clustername.xyz .com resolves to a virtual IP address on a hardware load
    balancer which is listening for requests on port 443.

    When the load balancer receives the request, it forwards it to any one of
    the nodes in the cluster on port 8086.

    The generated WSDL therefore looks like this:

    <wsdl:service name="webservic e">
    <wsdl:port name="webservic eSoap" binding="tns:we bserviceSoap">
    <soap:address location="http://clustername.xyz .com:8086/webservice.asmx "
    />
    </wsdl:port>
    <wsdl:port name="webservic eSoap12" binding="tns:we bserviceSoap12" >
    <soap12:addre ss
    location="http://clustername.xyz .com:8086/webservice.asmx " />
    </wsdl:port>
    <wsdl:port name="webservic eHttpGet" binding="tns:we bserviceHttpGet ">
    <http:address location="http://clustername.xyz .com:8086/webservice.asmx "
    />
    </wsdl:port>
    <wsdl:port name="webservic eHttpPost" binding="tns:we bserviceHttpPos t">
    <http:address location="http://clustername.xyz .com:8086/webservice.asmx "
    />
    </wsdl:port>
    </wsdl:service>

    While we can make it work, it is far from idiot proof. For example, leaving
    the "?wsdl" off the URL when adding a web reference in Visual Studio 2005
    results in the message "Unable to download the following files from
    http://clustername.xyz .com:8086/webservice.asmx ?wsdl" because
    http://clustername.xyz.com:8086 resolves to the load balancer's IP address
    and the load balancer is not listening on port 8086, nor will it accept
    unencrypted requests.

    The most significant problem is that generated test harness is also useless
    because although it lists the services and even allows you to click and enter
    parameters, clicking the Invoke button posts back to a URL that can not be
    reached.

    It is unfortunate that System.Web.Serv ices.WebService does not expose an
    instance of System.Web.Serv ices.Descriptio n since it looks like
    Description.Soa pAddressBinding .Location is exactly what we need to override.

    Does anyone have any ideas?

    Thank you.

    Gavin M







  • Dale

    #2
    RE: How to override address location in WSDL ports

    Can't you just assign the WebService.Url property?


    --
    Dale Preston
    MCAD C#
    MCSE, MCDBA


    "GavinM" wrote:
    [color=blue]
    > I have the same question as andreas.w.h.k asked on 1/5.
    >
    > Our configuration is as follows:
    >
    > The client must use the URL https://clustername.xyz.com/webservice.asmx to
    > access this web service.
    >
    > clustername.xyz .com resolves to a virtual IP address on a hardware load
    > balancer which is listening for requests on port 443.
    >
    > When the load balancer receives the request, it forwards it to any one of
    > the nodes in the cluster on port 8086.
    >
    > The generated WSDL therefore looks like this:
    >
    > <wsdl:service name="webservic e">
    > <wsdl:port name="webservic eSoap" binding="tns:we bserviceSoap">
    > <soap:address location="http://clustername.xyz .com:8086/webservice.asmx "
    > />
    > </wsdl:port>
    > <wsdl:port name="webservic eSoap12" binding="tns:we bserviceSoap12" >
    > <soap12:addre ss
    > location="http://clustername.xyz .com:8086/webservice.asmx " />
    > </wsdl:port>
    > <wsdl:port name="webservic eHttpGet" binding="tns:we bserviceHttpGet ">
    > <http:address location="http://clustername.xyz .com:8086/webservice.asmx "
    > />
    > </wsdl:port>
    > <wsdl:port name="webservic eHttpPost" binding="tns:we bserviceHttpPos t">
    > <http:address location="http://clustername.xyz .com:8086/webservice.asmx "
    > />
    > </wsdl:port>
    > </wsdl:service>
    >
    > While we can make it work, it is far from idiot proof. For example, leaving
    > the "?wsdl" off the URL when adding a web reference in Visual Studio 2005
    > results in the message "Unable to download the following files from
    > http://clustername.xyz .com:8086/webservice.asmx ?wsdl" because
    > http://clustername.xyz.com:8086 resolves to the load balancer's IP address
    > and the load balancer is not listening on port 8086, nor will it accept
    > unencrypted requests.
    >
    > The most significant problem is that generated test harness is also useless
    > because although it lists the services and even allows you to click and enter
    > parameters, clicking the Invoke button posts back to a URL that can not be
    > reached.
    >
    > It is unfortunate that System.Web.Serv ices.WebService does not expose an
    > instance of System.Web.Serv ices.Descriptio n since it looks like
    > Description.Soa pAddressBinding .Location is exactly what we need to override.
    >
    > Does anyone have any ideas?
    >
    > Thank you.
    >
    > Gavin M
    >
    >
    >
    >
    >
    >
    >[/color]

    Comment

    • GavinM

      #3
      RE: How to override address location in WSDL ports

      We are currently doing that (on the client), as a work around. Being able to
      override the address provided in the WSDL is helpful, but my question is how
      do I correct the WSDL?

      If it were possible to specify this.Url = ... in the constructor of the
      service (on the server) that would be great. However, unless I am missing
      something, there is no such property.

      Gavin M

      "Dale" wrote:
      [color=blue]
      > Can't you just assign the WebService.Url property?
      >
      >
      > --
      > Dale Preston
      > MCAD C#
      > MCSE, MCDBA[/color]

      Comment

      • Rik Hemsley

        #4
        Re: How to override address location in WSDL ports

        GavinM wrote:[color=blue]
        > We are currently doing that (on the client), as a work around. Being able to
        > override the address provided in the WSDL is helpful, but my question is how
        > do I correct the WSDL?
        >
        > If it were possible to specify this.Url = ... in the constructor of the
        > service (on the server) that would be great. However, unless I am missing
        > something, there is no such property.[/color]

        I am having the same problem. When our web service is installed, the
        generated WSDL is incorrect, so users can't get the correct URLs.

        I know that the generated address can't be exact, but surely it would
        have been more sensible to work out the service URLs from the request URL?

        Rik

        Comment

        Working...