locked
Incorrect URLs returning with ?disco RRS feed

  • Question

  • I need some help with this one.  I have created a wcf service that works great locally.  Because this service will be used by 3rd parties as well, I'm just doing basic http binding.  I moved the service out to one of our servers that can be seen externally and tried creating a normal web service reference in a vb.net console app to test it (same app I used to test locally which worked).  Anyway, when adding the reference I can navigate to my svc fine but I get invalid document type errors.  I know what is causing the error but I don't know how to fix it.  The server has several web sites defined, each of which has multiple applications/virtual folders.  We had to create another website to host .net 2.0 applications (I'll call it Dev2...dev2.myserver.com).
    When you navigate to my service disco manually I can see what the problem is...if I go to dev2.myserver.com/myservice/service.svc?disco I get something like this....

    - <discovery xmlns="http://schemas.xmlsoap.org/disco/">
      <contractRef ref="http://dev.myserver.com/myservice/myservice.svc?wsdl" docRef="http://dev.myserver.com/myservice/myservice.svc" xmlns="http://schemas.xmlsoap.org/disco/scl/" />
      </discovery>


    Look at the contractref and docref attributes.  Those addresses are to another website on this server (the default) (dev instead of dev2).  Why is the wcf service returning these invalid addresses?  I have an ASMX service on this same website (the one I'm replacing with the wcf) and it returns the correct url when navigating to the disco file.

    Any ideas?

    Thanks,
    Greg
    Tuesday, October 31, 2006 4:08 PM

Answers

  • Hi Greg,

    This seems to work fine with me. Can you run the following commands to see what you would get?

    1) Run: cscript.exe /nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs enum /p w3svc

    2) Find the path looks like "/w3svc/<NNNN>" where <NNNN> is a number. If it's "1", it means the default website. Find the one that points to dev2.myserver.com. Suppose the path is "/w3svc/760273824", run the following command:

    cscript.exe /nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs get /w3svc/760273824/ServerBindings

    3) The above command should return the IIS binding for the website. It should look like: "<ip address>:<port>:dev2.myserver.com" if you correctly set the binding data. Please copy the result in your reply.

    4) Run "iisreset.exe" to reset IIS to see whether there is any change cached. Please note that WCF does not react to IIS setting changes.

    Now, please check to see if your scenario works.

    Thanks,

    Wenlong

    Tuesday, October 31, 2006 5:37 PM

All replies

  • Hi Greg,

    This seems to work fine with me. Can you run the following commands to see what you would get?

    1) Run: cscript.exe /nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs enum /p w3svc

    2) Find the path looks like "/w3svc/<NNNN>" where <NNNN> is a number. If it's "1", it means the default website. Find the one that points to dev2.myserver.com. Suppose the path is "/w3svc/760273824", run the following command:

    cscript.exe /nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs get /w3svc/760273824/ServerBindings

    3) The above command should return the IIS binding for the website. It should look like: "<ip address>:<port>:dev2.myserver.com" if you correctly set the binding data. Please copy the result in your reply.

    4) Run "iisreset.exe" to reset IIS to see whether there is any change cached. Please note that WCF does not react to IIS setting changes.

    Now, please check to see if your scenario works.

    Thanks,

    Wenlong

    Tuesday, October 31, 2006 5:37 PM
  • Wenlong,
    You were absolutely correct!  When I ran the script to get the bindings the return was missing the host header value as in "xx.xxx.xxx.xx:80:".  I added the host header and now my svc is returning the correct urls!  Thank you so much.  I never would have figured this one out.

    Thanks again,
    Greg

    Wednesday, November 1, 2006 2:03 PM