473,414 Members | 1,848 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,414 software developers and data experts.

How to disable WSDL generation in web.config file

I am trying to eliminate the capability of displaying the details of a web
service by disabling WSDL generation in the web.config file. I have made the
following changes to the web.config:

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

My goal is to have simple text displayed when the user goes to the web page
i.e. enters https:/MyWebPage/WebPage.asmx. I want to disable the ability to
display the web details i.e. the user enters
https:/MyWebPage/WebPage.asmx?wsdl as this displays all the details of my web
service; which I want to hide.

Everything works fine if I do not have the statement
<remove name="Documentation" />
in the web.config file. However, when I add that line in an attempt to hide
the information displayed when the user adds the ?WSDL; I get the runtime
error below. How do I remove the ability to display the WSDL information
while still allowing my web site to display a help page? Why am I getting an
error?

Runtime Error
Description: An application error occurred on the server. The current custom
error settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could, however,
be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable
on remote machines, please create a <customErrorstag within a "web.config"
configuration file located in the root directory of the current web
application. This <customErrorstag should then have its "mode" attribute
set to "Off".

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</
--
Thank you.
Sep 25 '06 #1
3 32076
Hello John,

From your description, I understand you're going to prevent the
autogenerated WSDL document( **.asmx?WSDL ) from being visited by users but
still allow the display of the default webservice main helper page, correct?

As for the exception you encountered, it is an expected one and you haven't
missed any particular things. Actually, the cause of the problem is that
the "Documentation" protocol you configure through the (<protocols>
collection) controls both the webservice helper document page and the WSDL
document's generation, therefore, if you remove it from the <protocols>
collection, the end user will no longer be able to visit the .asmx or
..asmx?WSDL from browser.

So far based on my research, if we want to display customized content for
our asmx webservice, we still have to leave the "documentation" protocol
enable(do not remove it from the <protocolscollection). And use the
<wsdlHelperGenerator to configure a custom helper page.

As for the WSDL document(display through ".asmx?WSDL"), we can not
completely disable it , however, there is a means that we configure our
webservice/webmethod to use a custom WSDL document(by specifying a
webservice binding). e.g.
====================
[WebServiceBinding( Name="MyBinding", Location = "CustomWSDLPage.aspx")]
public class SimpleService : System.Web.Services.WebService
...............
[SoapDocumentMethod(Binding="MyBinding")]
public string HelloWorld()
{
...........
====================

Thus, the original WSDL document(display through .asmx?WSDL) will display
few WSDL elements(only the sevice address ) and will redirect the service
description to our custom location. You can have a look at the following
article for the detailed description on using a custom WSDL document for
ASP.NET webservice.

#Using a Custom WSDL File in ASP.NET Web Services
http://pluralsight.com/blogs/craig/a.../15/17482.aspx

Hope this helps some. Please feel free to let me know if there is anything
else we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 26 '06 #2
To confirm my understanding; if leave the <remove name="Documentation" />
tag; my web service should still work, but it will display the error message
I am seeing. For now, an error message is fine; as long as the web service
still works. It seems to work, just want to confirm I am not missing any
potential problems. The only problem that I know of is that a program cannot
"discover" the web service since I removed the documentation. Since the
programs that access the web service are already compiled, they don't need to
discover the service; they already know how to interact with it.
--
Thank you.
"Steven Cheng[MSFT]" wrote:
Hello John,

From your description, I understand you're going to prevent the
autogenerated WSDL document( **.asmx?WSDL ) from being visited by users but
still allow the display of the default webservice main helper page, correct?

As for the exception you encountered, it is an expected one and you haven't
missed any particular things. Actually, the cause of the problem is that
the "Documentation" protocol you configure through the (<protocols>
collection) controls both the webservice helper document page and the WSDL
document's generation, therefore, if you remove it from the <protocols>
collection, the end user will no longer be able to visit the .asmx or
.asmx?WSDL from browser.

So far based on my research, if we want to display customized content for
our asmx webservice, we still have to leave the "documentation" protocol
enable(do not remove it from the <protocolscollection). And use the
<wsdlHelperGenerator to configure a custom helper page.

As for the WSDL document(display through ".asmx?WSDL"), we can not
completely disable it , however, there is a means that we configure our
webservice/webmethod to use a custom WSDL document(by specifying a
webservice binding). e.g.
====================
[WebServiceBinding( Name="MyBinding", Location = "CustomWSDLPage.aspx")]
public class SimpleService : System.Web.Services.WebService
...............
[SoapDocumentMethod(Binding="MyBinding")]
public string HelloWorld()
{
...........
====================

Thus, the original WSDL document(display through .asmx?WSDL) will display
few WSDL elements(only the sevice address ) and will redirect the service
description to our custom location. You can have a look at the following
article for the detailed description on using a custom WSDL document for
ASP.NET webservice.

#Using a Custom WSDL File in ASP.NET Web Services
http://pluralsight.com/blogs/craig/a.../15/17482.aspx

Hope this helps some. Please feel free to let me know if there is anything
else we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights
Sep 26 '06 #3
Thanks for your reply John,

Yes, you're right, when you have removed the <remove name="Documentation"
/element, it only disable the documentation(main helper page and WSDL
page) from displaying, and the webservice function is still working.
Actually, webservice function call is controlled by those message
protocols(such as HttpSoap, HttpSoap12.....).

Also, the reason why we'll get "can not discover the service" on client
when generate proxy is because webservice client proxy generation will need
to discover the servcie description(WSDL) first. Thus, if the service
description is disabled( like removing the "documentation" protocol in our
scenari), we'll get such error.

If there is anything else you wonder, please feel free to let me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jimbo | last post by:
Hi, I am new to web services and am trying to set up a basic service using C# I am trying to run wsdl.exe on my machine to generate a proxuy class for my service. However, when running wsdl...
1
by: Leepe | last post by:
example: I have a skill object that implements the XmlSerializable interface Implementing the getschema gives me some unwanted generations towards the wsdl.exe Reference.cs generation. skill is...
0
by: Suresh Pasala | last post by:
Hello All, Iam using the ServiceDescription class and writing a wsdl file. Currently the way wsdl is generated is as follows. <definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"...
3
by: Dee | last post by:
I dont have much experience with wsdl's, but I am currently producing asmx web services, for c# dot net projects. All the project files are stored in souresafe, including the wsdl files. Each...
0
by: Stefan Lischke | last post by:
Hi, I'm really desperate using code generation(wsdl.exe) from wsdl files for latest WS-Eventing(including WS-Addressing) Specs. I'm writing my diploma about "publish subscribe systems based on...
13
by: ScottM | last post by:
I have run into a problem generating the class file via the WSDL utility. I have a WSDL file that was generated by XMLSpy and is able to be read by the Java code utility, but I get the following...
2
by: SteveChamp | last post by:
I have been experimenting with .Net web services for a while and have a few questions about the schema in the automatically generated WSDL file, and whether its content can be manipulated...
3
by: Thomas Guettler | last post by:
Hi, I looked for a solution to talk to a web service which offers its signature with a wsdl file. I googled for 'wsdl python' and found ZSI. This project uses code generation. That's...
1
by: jineshpmj123 | last post by:
Hi, I have a problem with processing WSDL file using SOAP. I want to call Rhapsody webservice using Python. But i have SSL certification key and cert , how to pass this information when i...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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...

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.