Hiding WSDL help page from a Web Service
-
Ok, so I've got a web service that I want to hide the auto-generated wsdl help page. According to the MSDN page here[^] the following code will redirect any browser-based request for the .asmx page:
<webServices>
<wsdlHelpGenerator href="/blank.htm" />
</webServices>However, when I put this in the System.Web element of the web.config and request the .asmx page, instead of getting blank.htm I get a HTTP 404 error saying the .asmx file has been moved or doesn't exist. :confused: That's not supposed to happen. Anybody know what's going on and how to fix it?
-
Ok, so I've got a web service that I want to hide the auto-generated wsdl help page. According to the MSDN page here[^] the following code will redirect any browser-based request for the .asmx page:
<webServices>
<wsdlHelpGenerator href="/blank.htm" />
</webServices>However, when I put this in the System.Web element of the web.config and request the .asmx page, instead of getting blank.htm I get a HTTP 404 error saying the .asmx file has been moved or doesn't exist. :confused: That's not supposed to happen. Anybody know what's going on and how to fix it?
blank.htm does this page exist in your website?
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
blank.htm does this page exist in your website?
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
Ok, so I've got a web service that I want to hide the auto-generated wsdl help page. According to the MSDN page here[^] the following code will redirect any browser-based request for the .asmx page:
<webServices>
<wsdlHelpGenerator href="/blank.htm" />
</webServices>However, when I put this in the System.Web element of the web.config and request the .asmx page, instead of getting blank.htm I get a HTTP 404 error saying the .asmx file has been moved or doesn't exist. :confused: That's not supposed to happen. Anybody know what's going on and how to fix it?
Shouldn't this: <protocols> <remove name="Documentation" /> </protocols> Be in between the webServices tags:
FyreWyrm wrote:
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
Shouldn't this: <protocols> <remove name="Documentation" /> </protocols> Be in between the webServices tags:
FyreWyrm wrote:
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
This is one of the options we could use. This approach though disables auto-discovery of the WSDL by consumers of the web service. If I wanted to use this, then I would have to provide a custom WSDL to any consumers of the web service.
does your blank.htm exist on the same level, as in are they BOTH in the root folder? if so, you should remove the slash before the blank.htm in the web config. change to this: <webServices> <wsdlHelpGenerator href="MyBlank.htm"/> </webServices> not this: <webServices> <wsdlHelpGenerator href="/MyBlank.htm"/> </webServices> IF that slash isn't what's creating the location problem...then I'm all out of ideas :(
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
does your blank.htm exist on the same level, as in are they BOTH in the root folder? if so, you should remove the slash before the blank.htm in the web config. change to this: <webServices> <wsdlHelpGenerator href="MyBlank.htm"/> </webServices> not this: <webServices> <wsdlHelpGenerator href="/MyBlank.htm"/> </webServices> IF that slash isn't what's creating the location problem...then I'm all out of ideas :(
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
They are in the same root folder. I tried it both ways, with the slash and without. It didn't make a difference. Hopefully I can figure this out tomorrow. It's for a demo app that was supposed to be finished Monday afternoon. There's nothing like being given less than 8 hours to create two full-featured demo apps. I got one finished, this is all that's holding up the other one. Thanks for your help though jgasm. If I get this sorted out tomorrow I'll come back and post the resolution.
-
They are in the same root folder. I tried it both ways, with the slash and without. It didn't make a difference. Hopefully I can figure this out tomorrow. It's for a demo app that was supposed to be finished Monday afternoon. There's nothing like being given less than 8 hours to create two full-featured demo apps. I got one finished, this is all that's holding up the other one. Thanks for your help though jgasm. If I get this sorted out tomorrow I'll come back and post the resolution.
Okay I got it. This is my web.config in a brand new asp.net app.
<?xml version="1.0"?>
<!---->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<webServices>
<wsdlHelpGenerator href="blank.aspx"/>
</webServices>
<compilation debug="true"/><authentication mode="Windows"/> </system.web>
</configuration>
I changed it to a .aspx because the .htm and .html have issues out of the box basically. Where as the web server knows how to render the .aspx. The location bar will not change. It will still show the address to the service. The page that loads up in the services location is the blank.aspx. I just changed it from htm or html to aspx and this has worked when you go directly to my web service file service.asmx ----------- when using a .htm the web config needed additional handlers to know what to do with the .htm which is why i changed it to aspx because i dont see why it would matter as long as the user sees the correct content.
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford
-
Okay I got it. This is my web.config in a brand new asp.net app.
<?xml version="1.0"?>
<!---->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<webServices>
<wsdlHelpGenerator href="blank.aspx"/>
</webServices>
<compilation debug="true"/><authentication mode="Windows"/> </system.web>
</configuration>
I changed it to a .aspx because the .htm and .html have issues out of the box basically. Where as the web server knows how to render the .aspx. The location bar will not change. It will still show the address to the service. The page that loads up in the services location is the blank.aspx. I just changed it from htm or html to aspx and this has worked when you go directly to my web service file service.asmx ----------- when using a .htm the web config needed additional handlers to know what to do with the .htm which is why i changed it to aspx because i dont see why it would matter as long as the user sees the correct content.
----------------------------------------------------------- "When I first saw it, I just thought that you really, really enjoyed programming in java." - Leslie Sanford