【发布时间】:2016-06-22 17:57:22
【问题描述】:
我正在使用 Java 网络服务。我正在使用我使用 c# 和 excel-dna 制作的 Excel 函数来使用它。问题是每次我调用函数 add 我都会得到(#valeur)。
这是我的 c# 代码源:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExcelDna.Integration;
using System.Diagnostics;
using System.ServiceModel;
using System.ServiceModel.Channels;
namespace MyLibrary
{
public class Class1
{
[ExcelFunction(Description = "adds two terms")]
public static int add(int a, int b)
{
ServiceReference1.ServerImplClient client =
new ServiceReference1.ServerImplClient();
return client.addition(a, b);
}
}
}
已包含服务参考以及 dna 和 xll 文件。
【问题讨论】:
-
将返回类型更改为'object',然后包装在try-catch块中,并返回异常详细信息。
标签: c# excel web-services excel-dna