Click here to Skip to main content
15,880,608 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In an asp.net web service (asmx), how do I hide the error messages that are sent to the client when it doesn't send the proper parameter: "Missing parameter: parameterName."?


What I have tried:

.
<pre>In an asp.net web service (asmx), how do I hide the error messages that are sent to the client when it doesn't send the proper parameter: "Missing parameter: parameterName."?
Posted
Updated 3-Dec-19 4:59am

Quote:
How to hide the “missing parameter” message

You have about 2 options:
- Don't make that wrong request at all.
- Make the request with proper parameters.
 
Share this answer
 
Comments
sam9787 1-Dec-19 15:15pm    
the problem is when any one open webservice methods they can add method name only so the error message tell him you missed parameter x then he will add value to x and run, if there are another parameter the error message will tell him you missed parameters y and so on
Patrice T 1-Dec-19 15:29pm    
Giving context matters to get correct answer.

Use Improve question to update your question.
So that everyone can pay attention to this information.
According to this SO thread, you need to change the customErrors mode in your web.config file:
service - Soap FaultString shows the detailed error message rather than the short error - Stack Overflow[^]
XML
<configuration>
    <system.web>
        <customErrors mode="On" />
    </system.web>
</configuration>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900