开发者

Hide function input parameters in C# web-service?

I have a question regarding if it is possible to hide inputs to a web-service method.

Lets say that the fourth parameter takes a password as input, and we want this input only to be used on the client side.

The function has 4 input parameters, and is there any way possible to still have all the input parameters to the function but make the fourth parameter invisible when accessing the .asmx file through the web-browser? This is to eliminate users trying to access the service and trying to input random data.

Hide function input parameters in C# web-service?

EDIT: To place this in an example.

We have an iPhone application, when a user makes use of a function, some parameters are sent to the web-service along with the fourth parameter that should contain a key of some 开发者_运维知识库sort to validate that the user is on an actual iPhone using the application and not someone accessing the web-service trying to access data.

public someVariable someFunction(someVar parameter1,someVar parameter2,someVar parameter3,someVar parameter4)
{

    if (key.isMatch(parameter4))
    {

       The user is on an iPhone using the app : Proceeding.

    }
    else
       The user is not on an iPhone, cancelling function.

}


you can prevent calling your method from webbrowser,by extending SoapExtension and getting extra information as soapheader ,that just can be send by enduser app

have a look to this Using SOAP Header and SOAP Extensions in a Web Service


The interface that you are using was not supposed to be used for anything but testing.

If you need to use it on production you should rather implement your own page, so the TextBox for parameter 4 would be masked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜