473,566 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>
<wsdlHelpGenera tor href="helpPage. aspx"/>
<protocols>
<remove name="Documenta tion" />
</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?ws dl 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="Documenta tion" />
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 <customErrorsta g within a "web.config "
configuration file located in the root directory of the current web
application. This <customErrorsta g should then have its "mode" attribute
set to "Off".

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

<configuratio n>
<system.web>
<customErrors mode="Off"/>
</system.web>
</
--
Thank you.
Sep 25 '06 #1
3 32113
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 "Documentat ion" 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 "documentat ion" protocol
enable(do not remove it from the <protocolscolle ction). And use the
<wsdlHelperGene rator to configure a custom helper page.

As for the WSDL document(displa y 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.
=============== =====
[WebServiceBindi ng( Name="MyBinding ", Location = "CustomWSDLPage .aspx")]
public class SimpleService : System.Web.Serv ices.WebService
...............
[SoapDocumentMet hod(Binding="My Binding")]
public string HelloWorld()
{
...........
=============== =====

Thus, the original WSDL document(displa y 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="Documenta tion" />
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 "Documentat ion" 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 "documentat ion" protocol
enable(do not remove it from the <protocolscolle ction). And use the
<wsdlHelperGene rator to configure a custom helper page.

As for the WSDL document(displa y 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.
=============== =====
[WebServiceBindi ng( Name="MyBinding ", Location = "CustomWSDLPage .aspx")]
public class SimpleService : System.Web.Serv ices.WebService
...............
[SoapDocumentMet hod(Binding="My Binding")]
public string HelloWorld()
{
...........
=============== =====

Thus, the original WSDL document(displa y 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="Documenta tion"
/element, it only disable the documentation(m ain 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(WSD L) first. Thus, if the service
description is disabled( like removing the "documentat ion" 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
3997
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 from the command line I get an error report along the lines of; 'The document is not a recognised document type...' 'There is an error in XML...
1
3822
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 an object with properties name and code public System.Xml.Schema.XmlSchema GetSchema() { string _namespace;
0
1972
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/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="http://www.xignite.com/services/"
3
2059
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 time I update a project I must build and run the particular web service then manually open and save the wsdl. This must be done before the wsdl...
0
2034
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 Web Services" I took the WS-Eventing WSDL file and added <binding>'s and <service>'s... Then i took the apache axis wsdl2java tool and i got nice
13
3409
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 error from the WSDL utility. Error: Unable to import binding 'REMSOAPHttpsBinding' from namespace...
2
2026
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 programatically. First of all, I created several very simple test methods in my web service: <WebMethod()_ Public Function TestString(ByVal test As...
3
2973
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 something I don't like.
1
4155
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 calling wsdl file. eg: file = 'RhapsodyDirectSearch.wsdl'
0
7584
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...
0
7893
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. ...
0
8109
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...
1
7645
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...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5485
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...
0
5213
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...
1
2085
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
0
926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.