NpsWebServiceClient helps to access your webservice with javascript
Below shows how to invoke Login method located at http://www.jwebstar.com/admin/WebService.jws?wsdl. This method need two arguments,one for email and another for password.
|
var client = new NpsWebServiceClient("http://www.jwebstar.com/admin/WebService.jws?wsdl"); var args = new Array(); args[0]="your email"; args[1]="your password"; var result = client.Invoke("Login",args); out.Error(result[0]); |
|
NpsWebServiceClient(String url) Constructor. url is the URL of your WSDL. |
|
| void |
void HTTPAuth(String username,String password) HTTP authentication is one of the most straightforward ways to secure your service. In this way, client would send an HTTP username/password. |
| void |
void SetProperty(String name,Object value) throws Exception Set property for XFire Client. |
| void |
Object[] Invoke(String method_name,Object[] args) throws Exception To invoke the method. args is the arguments passed to method, and always it is an array. 1.If no arguments needed at all, just simple to set args to null. For example: var result = client.Invoke("Function_No_Arg",null); 2.If only one argument needed, args could be this argument or an array contains this argument only. For example: var result = client.Invoke("Query","query_string"); Or var args = new Array(); args[0] = "query_string"; var result = client.Invoke("Query",args); 3.If more than one argument needed, args must be an array. The method would return an array. |