kissta
kissta

Reputation: 503

web service method parameters

I need to create a web service, in .NET, where a sender can send data, as query string, and the parameter names are encoded. Below is an example of the URL to send the data: http://hostname/Processor/Service.asmx/InsertReport?A%2dE3%2dName=John

The method InsertReport needs to have A-E3-Name as a parameter.

How do I declare the parameter to receive the value John?

Upvotes: 0

Views: 121

Answers (3)

DVK
DVK

Reputation: 2792

If you want to pass these in as actual parameters for your webmethod (eg. your ASMX has a method with parameters that correspond to your querystring parameter names), you need to rethink your parameter names. Even if you url-decoded them, you can't have a C# method with parameters named A-B-3-Something. Try creating a method with a parameter like that and you will notice that it won't compile.

Perhaps if you describe what you are trying to do we can offer a better solution.

Upvotes: 0

vandy11
vandy11

Reputation: 1

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
<body>
<table class="table table-hover">
  <tr>
    <td>No</td>
    <td>Test1></td>
  </tr>
  <tr>
    <td>No</td>
    <td>Test2></td>
  </tr>
</table>
</body>

Upvotes: 0

robobot3000
robobot3000

Reputation: 589

You can retrieve query string parameter values in C# by:

Request.QueryString["A-E3-Name"]

Upvotes: 1

Related Questions