简体   繁体   中英

JavaScript SOAP Client receives null

I'm running into some problems, with the JavaScript SOAP Client.

I tried to pass the following parameters:

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);

The server- side code, that should answer my request looks like this:

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

The connection is running fine, but the Callback method prints

Hello null and null !

If I try the same from C# or Java it works fine, am I missing something?

I think you have done a mistake in client line, SOAPClient.invoke(url, "hello", pl, true, HelloWorld_callBack); Check this

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM