468,765 Members | 1,066 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

Follow up question on hiding web service functions

It seems to work, at least my application still works. After adding this tag
to hide the documentation; is it normal to see an error message when browsing
to the page? I get error message shown below when going to that page in
Internet
Explorer on the same machine as the service. If I understand correctly; to
correct this error I simply need to have the following in web.config:

<webServices>
<protocols>
<remove name="Documentation" />
</protocols>
<wsdlHelpGeneratorhref="helpPage.aspx"/>
</webServices>

Thus it seems like, in this example, all I need to do is have a web page
named helpPage.aspx. Is this true? Could the wsdlHelpGeneratorhref be a
simple .htm page?

Here is the error I referred to above:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:
[InvalidOperationException: Request format is unrecognized.]

System.Web.Services.Protocols.WebServiceHandlerFac tory.CoreGetHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response) +491033

System.Web.Services.Protocols.WebServiceHandlerFac tory.GetHandler(HttpContext
context, String verb, String url, String filePath) +104
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
+175

System.Web.MapHandlerExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +120
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +155


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET
Version:2.0.50727.42

Thank you.

--
Thank you.
Jul 8 '06 #1
8 3141
Hello KTJ,

Thank you for posting in the MSDN newsgroup.

As for the "[InvalidOperationException: Request format is unrecognized.]"
error you mentioned, it is due to the "Documentation" protocol is disabled
so that when we request the asmx url in webbrowser, the ASP.NET runtime
will report such error.

Actually, after we remove the "Documentation" protocol as below:

===================
<webServices>
<protocols>
<remove name="Documentation" />
</protocols>
===============

Neither the built-in helper page nor our custom helper page(configure
through the <wsdlHelpGenerator href="CustomWSDLPage.aspx"/element) can be
visisted through webbrowser.
Therefore, if you want to use custom WSDL or documentation page, you need
to remove the following configuration element from your application's
web.config file.

<remove name="Documentation" />

In addition, the custom WSDLhelper page doesn't support pure html file, you
need to create an ASPX page as the custom WSDL helper page.

If there is anything else unclear, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 10 '06 #2
Hello Steven,

Thank you. So if I understand correctly; all I need to do to hide the
functions and display another page is to use the wsdlHelpGeneratorhref tag in
the WebServices section; as shown below? Is this correct?

<webServices>
<wsdlHelpGeneratorhref="helpPage.aspx"/>
</webServices>
--
Thank you.
"Steven Cheng[MSFT]" wrote:
Hello KTJ,

Thank you for posting in the MSDN newsgroup.

As for the "[InvalidOperationException: Request format is unrecognized.]"
error you mentioned, it is due to the "Documentation" protocol is disabled
so that when we request the asmx url in webbrowser, the ASP.NET runtime
will report such error.

Actually, after we remove the "Documentation" protocol as below:

===================
<webServices>
<protocols>
<remove name="Documentation" />
</protocols>
===============

Neither the built-in helper page nor our custom helper page(configure
through the <wsdlHelpGenerator href="CustomWSDLPage.aspx"/element) can be
visisted through webbrowser.
Therefore, if you want to use custom WSDL or documentation page, you need
to remove the following configuration element from your application's
web.config file.

<remove name="Documentation" />

In addition, the custom WSDLhelper page doesn't support pure html file, you
need to create an ASPX page as the custom WSDL helper page.

If there is anything else unclear, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 10 '06 #3
Hello KTJ,

Thanks for your response.

Yes, you're right. You should remove those protocol disabling
cofiguration(as below) if you want to allow the client user visit
webservice description page(built-in or our custom one) in web browser

====================
<webServices>
<protocols>
<remove name="Documentation" />
</protocols>
=====================

Actually, this is true for any other protocols(such as HttpGet, HttpPost,
HttpSoap). Whenever you disable (by using the <remove name=xxxelement) in
web.config, the webservice clients no longer be able to communicate with
the service through that disabled protocol:

http://msdn2.microsoft.com/en-us/library/ccbk8w5h.aspx

If you still have any questions or any other things we can help, please
feel free to let me know.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 11 '06 #4
Thank you. However, I am still confused. Would the configuration below both
hide the function names/declarations and automatically route the user to the
helpPage.aspx file?

<webServices>
<protocols>
<remove name="Documentation" />
</protocols>
<wsdlHelpGeneratorhref="helpPage.aspx"/>
</webServices>

--
Thank you.
"Steven Cheng[MSFT]" wrote:
Hello KTJ,

Thanks for your response.

Yes, you're right. You should remove those protocol disabling
cofiguration(as below) if you want to allow the client user visit
webservice description page(built-in or our custom one) in web browser

====================
<webServices>
<protocols>
<remove name="Documentation" />
</protocols>
=====================

Actually, this is true for any other protocols(such as HttpGet, HttpPost,
HttpSoap). Whenever you disable (by using the <remove name=xxxelement) in
web.config, the webservice clients no longer be able to communicate with
the service through that disabled protocol:

http://msdn2.microsoft.com/en-us/library/ccbk8w5h.aspx

If you still have any questions or any other things we can help, please
feel free to let me know.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 11 '06 #5
Thanks for your reply KTJ,

The <remove name="Documentation" /element means you will disable the
"documentation" functionality of the ASP.NET webservice(asmx). In other
word, this will prevent the user from being able to see the function
names/declarations or your custom Documentation page(your helpPage.aspx).

Therefore, if you want to redirect the client user to your custom
helpPage.aspx page, you can not include

<remove name="Documentation" />

And your complete webservices configuration section should look like:

==================
<webServices>
<wsdlHelpGeneratorhref="helpPage.aspx"/>
</webServices>
===================

Hope this help clarify it. Please feel free to let me know if you still
have anything unclear.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 11 '06 #6
Hello KTJ,

How are you dong on this thread, have you got any further ideas on this or
does my last reply helps clarify this further? If there is still anything
unclear, please feel free to let me know.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 13 '06 #7
Hello Steven,

There is a minor bug in the line:

<wsdlHelpGeneratorhref="helpPage.aspx"/>

there should be a space between wsdlHelpGenerator and href

thus, I found out it should be:

<wsdlHelpGenerator href="helpPage.aspx"/>

It works. I am all set. Thank you.

--
Thank you.
"Steven Cheng[MSFT]" wrote:
Hello KTJ,

How are you dong on this thread, have you got any further ideas on this or
does my last reply helps clarify this further? If there is still anything
unclear, please feel free to let me know.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 18 '06 #8
Thanks for your followup KTJ,

Yes, it's my type mistake in the original posted <wsdlHelpGenerator ... >
element, also thank you for pointing it out. I'm glad that you've got it
working.
If you have meet any new problems later, please feel free to post here.

Have a good day!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 19 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Lorenzo Villari | last post: by
9 posts views Thread by bob | last post: by
11 posts views Thread by sofeng | last post: by
2 posts views Thread by developer.new | last post: by
13 posts views Thread by mattia | last post: by
12 posts views Thread by Bryan Parkoff | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.