继承属性不会出现在ASMX文件的肥皂样本 [英] Inherited properties do not appear in soap sample on asmx file

查看:110
本文介绍了继承属性不会出现在ASMX文件的肥皂样本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个班,WebServiceRequest和OrderRequest。每个类都有属性。 OrderRequest从WebServiceRequest继承 - 就像这样:

I have two classes, WebServiceRequest and OrderRequest. Each class has properties. OrderRequest inherits from WebServiceRequest - like so:

    public class WebServiceRequest
    {
    	private string mAuthenticationToken;

    	public string AuthenticationToken
    	{
    		get { return mAuthenticationToken; }
    		set { mAuthenticationToken = value; }
    	}
    	...
}


public class OrderRequest : WebServiceRequest
{

	private string mVendorId;
	public string VendorId
	{
		get { return mVendorId; }
		set { mVendorId = value; }
	}
	...
}

OrderRequest经由一个WebMethod露出。当查看暴露OrderRequest的ASMX文件(?即MyWebService.asmx WSDL)的WSDL,这两个属性是可见的 - 因为他们应该。但是,当您查看SOAP样品暴露OrderRequest Web方法,只有VENDORID属性是可见的,而不是继承AuthenticationToken财产。这是怎么回事?

OrderRequest is exposed via a WebMethod. When viewing the WSDL of the ASMX file that exposes OrderRequest (i.e. MyWebService.asmx?WSDL), both properties are visible - as they should be. However, when you view the SOAP Sample for the Web Method that exposes OrderRequest, only the VendorId property is visible, and not the inherited AuthenticationToken property. What's the deal?

注意:我已经张贴了这个问题,因为在MS连接错误:<一href=\"https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=520200\">https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=520200

Note: I've posted this issue as a bug on MS Connect: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=520200

推荐答案

我设法绊倒背asswords成我的问题的解决方案,即使经过微软证实它作为一个bug(https://connect.microsoft.com/的VisualStudio /反馈/ ViewFeedback.aspx?FeedbackID = 520200),我已经放弃了,标志着约翰的答案接受。这里的解决方案:

I managed to stumble back-asswords into the solution for my problem, even after Microsoft confirmed it as a bug (https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=520200) and I had given up and marked John's answer as accepted. Here's the solution:

http://$c$c.msdn.microsoft.com/WsdlHelpGenerator/Release/ProjectReleases.aspx?ReleaseId=412

去那里,下载文件,然后添加在Web.config文件的system.web节以下行:

Go there, download the file, then add the following line under the system.web section of your Web.config file:

<webServices>
 <wsdlHelpGenerator href="CustomWsdlHelpGenerator.aspx"/>
</webServices>

在href属性应指向您的文件在项目中的相对位置。感谢您的帮助约翰。

The href property should point to the relative location of your file within your project. Thanks for your help John.

这篇关于继承属性不会出现在ASMX文件的肥皂样本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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