Click here to Skip to main content
14,391,917 members
Rate this:
Please Sign up or sign in to vote.
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 5:59am
Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   
Comments
sameralkhalili 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.
Rate this:
Please Sign up or sign in to vote.

Solution 2

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[^]
<configuration>
    <system.web>
        <customErrors mode="On" />
    </system.web>
</configuration>
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100