JavaScript SOAP Client收到null

时间:2013-12-10 11:26:41

标签: javascript soap xsd wsdl

我正在使用JavaScript SOAP Client遇到一些问题。

我试图传递以下参数:

var url = "http://mywebservice/ws";
var pl = new SOAPClientParameters();
pl.add("name1", "Hans");
pl.add("name2", "Bernd");
SOAPClient.invoke(url, "hello", pl, true, HelloWorld_callBack);

应该回答我的请求的服务器端代码如下所示:

@WebMethod(operationName = "hello")
public String hello(@WebParam(name = "name1") String txt,@WebParam(name= "name2") String strInput2)
{
    String strMethode = "hello";
    return "Hello " + txt + " and " + strInput2 + " !";
}

连接正常,但Callback方法打印

  

Hello null and null!

如果我从C#或Java尝试相同的方法,它可以正常工作,我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

我认为你在客户线上犯了一个错误, SOAPClient.invoke(url,“hello”,pl,true,HelloWorld_callBack); 查看this