路过一个复杂类型作为参数ASMX服务 [英] Passing a Complex Type as a Parameter to an ASMX Service

查看:250
本文介绍了路过一个复杂类型作为参数ASMX服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想C#编写一个简单的ASMX Web服务。对于我的生活,我无法理解或了解如何接受更复杂的参数比原语。

是否有可能做这样的事情:

  [的WebMethod]
公共字符串的MyMethod(SomeStruct参数)
{
}


解决方案

有关其他任何人有同样的问题。答案是使用肥皂

至于为什么使用ASMX服务,而不是WCF,有几个方面的原因:


  1. 更容易配置和部署一个的的Web服务

  2. 其他开发者使用,并期望ASMX服务

虽然第一个原因是值得商榷的,真的是没有什么可约的第二个原因,短期内完成,尤其是在与开发商的工作你自己的公司之外的情况下。

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)
{
}

解决方案

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:

  1. Easier to configure and deploy for a small web service
  2. Other developers are using and expect ASMX services

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.

这篇关于路过一个复杂类型作为参数ASMX服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆