我在 Java 上有简单的 Web 服务:
package tst;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService
public class TstService {
@WebMethod
public int tst(String data, String response)
{
response ="Ok";
return 1;
}
public static void main(String[] args ){
Endpoint.publish("http://0.0.0.0:1234/TstService", new TstService());
}
}
尝试从 C# 调用它:
namespace websrvClient
{
class Program
{
static void Main(string[] args)
{
ServiceReference1.TstServiceClient srv = new ServiceReference1.TstServiceClient();
String arg0 = "aaa";
String arg1 = null;
int i = srv.tst(arg0,arg1);
Console.WriteLine("tst returns {0} {1} {2}",i,arg0,arg1);
Console.ReadLine();
}
}
}
C# 客户端调用正常并获取函数返回 - 1,但它不检索response 字符串变量。如何解决这个问题呢?
BIG阳
忽然笑
相关分类