ASMX Web服务,测试表仅在本地计算机上仅适用于一个WebMethod

时间:2011-11-07 14:03:39

标签: c# web-services asmx

我有一个我正在测试的ASMX WebService,在大多数方法中,我可以使用测试表单进行测试。但是我确实有一种测试形式的方法:

The test form is only available for requests from the local machine.

此方法的声明方式与其他方法完全相同,但它的参数列表明显更长(大多数方法只有2或3个参数):

[WebMethod]
    public ActionSuccessResponse makeDestinationRequest(String ownerID, String destinationRegion, String destinationCountry, DateTime desiredTravelDate1, String destinationCity = "", DateTime? desiredTravelDate2 = null, DateTime? desiredTravelDate3 = null) {

有什么想法吗?我很难过。

2 个答案:

答案 0 :(得分:2)

事实证明,问题实际上是由于方法定义中的DateTime类型参数引起的。 Web服务应该为所有参数使用原始数据类型,以便与其他语言兼容。

答案 1 :(得分:1)

如果您必须使用较早的ASMX文件,则应使用SOAPUI之类的方法对其进行测试。

内置测试页只处理非常基本的参数输入(并且可能在放弃之前限制参数数量)。基本上不要使用它。

相关问题