Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Problem with parameters

Avatar

Level 2

This, is the code i used to connect with my webservice, it works when i try to access a method without parameters, but when it has parameters, it sends null/void.


TextField1.rawValue =connect("http://localhost:2399/Service1.asmx?wsdl");

function connect(oListURL){
SOAP.wireDump = false;
var e;
try {
        var service = SOAP.connect(oListURL);
        xfa.host.messageBox("1");
        if (typeof service != "object"){
                xfa.host.messageBox("Couldn't get List object.");
        }
        if (service.getAllServiceNames == "undefined"){
                xfa.host.messageBox("Couldn't get getAllServiceNames Call.");
        }

        //Start the query      
        var response = service.SearchMatch(TextField1.rawValue);    
        xfa.host.messageBox(response);
       
        if(response == null){
                xfa.host.messageBox("List empty");
        }
        return response;
}

catch(e){
        xfa.host.messageBox("'Problem with list Call: " +e);

}
}

the parameter is a string, and the return value is also a string.

1 Reply

Avatar

Former Community Member

Pass the parameters this way:

{parameterName:parameterValue}

For example, in your code:

     var response = service.SearchMatch({nameOfTheParameter:TextField1.rawValue});   

You should replace "nameOfTheParameter" for the actual name of the parameter of SearchMatch