473,320 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 3498
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Lorenzo Villari | last post by:
I premise I don't know C++ well but... I wondered what is this data hiding thing... I mean, if I can look at the header (and i need it beacuse of the class), then what's hidden? Can someone give...
9
by: bob | last post by:
Hi, I know there exists a good reason why the designers of c++ decided that function hiding should exist. But I don't know why. Can anybody provide a good reason/example of a case where function...
5
by: Urs Beeli | last post by:
I have a question regarding errno. If I understand it correctly, including <errno.h> allows me to check "errno" for error values that some standard library functions may set. This brings up some...
11
by: sofeng | last post by:
I'm not sure if "data hiding" is the correct term, but I'm trying to emulate this object-oriented technique. I know C++ probably provides much more than my example, but I'd just like some feedback...
2
by: subramanian100in | last post by:
Is my following understanding correct ? Data abstraction means providing the interface - that is, the set of functions that can be called by the user of a class. Information hiding means...
2
by: developer.new | last post by:
Hi I have a question regarding this concept I learned about recently: Name Hiding. Here's what I've come across: There is a base class with two functions with the same name but different...
13
by: mattia | last post by:
Hi everybody, I'm wondering how to realize a simple pattern in C: information hiding, to hide detail implementations of a data structure. How can I do that? I've also read that is preferred to use...
162
by: Sh4wn | last post by:
Hi, first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data hiding. I know member vars are private when you...
12
by: Bryan Parkoff | last post by:
I write my large project in C++ source code. My C++ source code contains approximate four thousand small functions. Most of them are inline. I define variables and functions in the global scope....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.