Reputation: 12796
I am trying to write a simple ASMX web service in C#. For the life of me, I can't understand or find out how to accept more complex parameters than primitives.
Is it possible to do something like:
[WebMethod]
public string MyMethod(SomeStruct parameter)
{
}
Upvotes: 2
Views: 4903
Reputation: 321
try this :
[WebMethod]
public string MyMethod( )
{
var parameter = new JavaScriptSerializer().Deserialize<SomeStruct>(HttpContext.Current.Request["parameter"]);
}
Upvotes: 0
Reputation: 12796
For anyone else having the same question. The answer was to use Soap.
As to why use ASMX service instead of WCF, there are a couple reasons:
While the first reason is arguable, there really is nothing that can be done in the short term about the second reason, especially in the context of working with developers outside your own company.
Upvotes: 2