Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 向现有Web服务自定义类型添加新字段_C#_.net_Web Services_Asmx_Custom Type - Fatal编程技术网

C# 向现有Web服务自定义类型添加新字段

C# 向现有Web服务自定义类型添加新字段,c#,.net,web-services,asmx,custom-type,C#,.net,Web Services,Asmx,Custom Type,我有一个web服务GetPieByName,它返回一个自定义类型的饼图: public Pie GetPieByName(string name) { Pie p = new Pie(); p.name = "Apple Pie"; return p; } class Pie { string name get set methods... } Pie p定义中只有名称。调用方A使用web服务 几个月后,Pie p的定义得到了增强,包括重量、有效期。这将由调用方B使用。部署

我有一个web服务GetPieByName,它返回一个自定义类型的饼图:

public Pie GetPieByName(string name)
{
Pie p = new Pie();
p.name = "Apple Pie";
return p;
}

class Pie {    
string name    
get set methods... 
}
Pie p定义中只有名称。调用方A使用web服务


几个月后,Pie p的定义得到了增强,包括重量、有效期。这将由调用方B使用。部署增强的web服务后,我是否需要对调用方A执行任何操作?如果我不刷新服务引用wsdl,它还会工作吗?

创建另一个饼图方法,该方法将处理调用方B 然后在GetPieByName()上执行if语句
检查其调用方A调用方B

调用方A是否仍能正常工作,尽管类型中有其他属性


但是,在刷新WSDL之前,
饼图的附加属性对调用方A是不可见的。

什么样的服务?ASMX?是的,是a。asmx WebServicesAMX是一种遗留技术,不应用于新的开发。WCF或ASP.NET Web API应用于Web服务客户端和服务器的所有新开发。一个提示:微软已经在MSDN.Correction上退出了。该服务是一个。抱歉,这没有回答问题。此外,这将是代码的重复。