English 中文(简体)
ASP. NET 网络服务参数类型
原标题:ASP.NET web service parameter type

How to I control parameter type tag in ASP.NET web service? I get < xml>string< /xml> in one web application and < data>string< /data> in other... Is there a way to control this?

[WebMethod]
public bool TestFunction(string xml)
{
    //DO SOMETHING
    return true;
}

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <TestFunction xmlns="http://tempuri.org/">
      <xml>string</xml> //<data>string</data>
    </TestFunction>
  </soap:Body>
</soap:Envelope>

编辑:我放弃改称职能

最佳回答

任何方法都使用你具体说明的参数名称。 如果你改变以下方法:<条码>公共浴室测试功能(显示Foo Bar),则插座将载于<条码>和代号;Foo Bar>string</Foo Bar> tag in the result XML。

当你使用世界功能基金时,你可以使用电传合同或应用电灯改变这种行为,指示序列器使用替代名称:

public bool TestFunction([MessageParameter(Name="YourName")]string xml)

然而,我不知道这是否也适用于协会。 网上服务。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签