473,796 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Documenta tion" />
</protocols>
<wsdlHelpGenera torhref="helpPa ge.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 wsdlHelpGenerat orhref 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:
[InvalidOperatio nException: Request format is unrecognized.]

System.Web.Serv ices.Protocols. WebServiceHandl erFactory.CoreG etHandler(Type
type, HttpContext context, HttpRequest request, HttpResponse response) +491033

System.Web.Serv ices.Protocols. WebServiceHandl erFactory.GetHa ndler(HttpConte xt
context, String verb, String url, String filePath) +104
System.Web.Http Application.Map HttpHandler(Htt pContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
+175

System.Web.MapH andlerExecution Step.System.Web .HttpApplicatio n.IExecutionSte p.Execute() +120
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +155


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET
Version:2.0.507 27.42

Thank you.

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

Thank you for posting in the MSDN newsgroup.

As for the "[InvalidOperatio nException: Request format is unrecognized.]"
error you mentioned, it is due to the "Documentat ion" 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 "Documentat ion" protocol as below:

=============== ====
<webServices>
<protocols>
<remove name="Documenta tion" />
</protocols>
===============

Neither the built-in helper page nor our custom helper page(configure
through the <wsdlHelpGenera tor href="CustomWSD LPage.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="Documenta tion" />

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 wsdlHelpGenerat orhref tag in
the WebServices section; as shown below? Is this correct?

<webServices>
<wsdlHelpGenera torhref="helpPa ge.aspx"/>
</webServices>
--
Thank you.
"Steven Cheng[MSFT]" wrote:
Hello KTJ,

Thank you for posting in the MSDN newsgroup.

As for the "[InvalidOperatio nException: Request format is unrecognized.]"
error you mentioned, it is due to the "Documentat ion" 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 "Documentat ion" protocol as below:

=============== ====
<webServices>
<protocols>
<remove name="Documenta tion" />
</protocols>
===============

Neither the built-in helper page nor our custom helper page(configure
through the <wsdlHelpGenera tor href="CustomWSD LPage.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="Documenta tion" />

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="Documenta tion" />
</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="Documenta tion" />
</protocols>
<wsdlHelpGenera torhref="helpPa ge.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="Documenta tion" />
</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="Documenta tion" /element means you will disable the
"documentat ion" 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="Documenta tion" />

And your complete webservices configuration section should look like:

=============== ===
<webServices>
<wsdlHelpGenera torhref="helpPa ge.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:

<wsdlHelpGenera torhref="helpPa ge.aspx"/>

there should be a space between wsdlHelpGenerat or and href

thus, I found out it should be:

<wsdlHelpGenera tor 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 <wsdlHelpGenera tor ... >
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
4197
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 me an example of something hidden from the user?
9
4986
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 hiding saves the day. I know there exists one, I'd just like to hear about it. thanks and have a nice day.
5
2367
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 questions: - As I understand it, most functions only set errno in an error case. I take this to mean, that on success, errno is not necessarily set to EOK and I would either need to set errno to EOK before calling the function in question to...
11
5659
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 to find out if I've done anything wrong. Also, I am working on this for an embedded environment, so if there are great inefficiencies with this code, I'd like to know that also. I realize there is overhead with using an "accessor" function. ...
2
7644
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 mentioning the class members(functions, typedefs, data) under the access control labels : public, protected, private. Encapsulation means providing the implementation of class member
2
4857
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 signature. A class inherits publicly from this base class and redefines one of the two functions in the derived class. In that case, a derived class object cannot access the other base class function that it hasn't redefined. I'm posting a code snippet...
13
4457
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 only struct and avoid typedef struct. Can anyone help? Use as example: struct list { int my_data; struct list *next; } Thanks, Mattia
162
10309
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 prefix them with 2 underscores, but I hate prefixing my vars, I'd rather add a keyword before it. Python advertises himself as a full OOP language, but why does it miss one of the basic principles of OOP? Will it ever be added to python?
12
3020
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. The global variables and global functions are hidden to prevent from accessing by the programmers. All global functions share global variables. Only very few global functions are allowed to be reusability for the programmers to use. Few...
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.