Help

WSClient++ Program

WSClient++ is a program that manages WSClient++ Configuration files and generates code specified in configuration files. Files with extension ".wsclient" can be opened/saved from this program and the configuration is saved in pure json file format. This program can be accessed via "Start menu" in windows and in Applications folder in Mac. Please note, not all formats may be supported as per the license you have bought.

^ Top

WSClient++ Configuration File Editor

WSClient++ Configuration file editor is a tab appears in the program after you open or create new wsclient configuration file. Configuration file has following properties, please note not all the properties apply to every platform, but a substantial knowedge of platform is needed to understand the requirements.

WSDL Property

WSDL is a text property, which can contain multiline list of URLof WSDL. You can type multiple WSDL url in this box, one in each line, the program will query each of WSDL and generate the code. It is not always best practice to generate all WSDL client in one namespace/package. Only if the return types are same and share same inheritance hierarchy throughout entire list of WSDL provided, then only multiple WSDL urls must be used in one namespace/package.

Each web service generated will connect to relative url not including the host name, in order to specify hostname to connect to, please see "Web Service Runtime Address (URL)"

Type Property

This drop down identifies the language of the generated code. Please note basedon the type selected, you may need to add additional references / source code in your project. Following is the list of prerequisits that you need to do in order to use generated code in your project.

  • Cocoa: For iPhone and Mac development, we have shipped required header(.h) and objective-c(.m) source code in respective folder once you open the "Platform Libraries" link. Please copy these files and include them in your XCode project.
  • Java: For Android and Blackberry development, we have shipped required Java Libraries (.jar) files. For Android, you have to include wsclient.android.jar file in your Android eclipse project. For Blackberry, you have to include wsclient.blackberry.jar files in your Blackberry eclipse project. For desktop/server java applications, you can use wsclient.jar library.
  • Flex/Flash: For Flash Development platform, (Flex 3.0, Flex 4.0) we have included Shockwave Component Library named wsclient3.swc for Flex 3.0 and wsclient4.swc for Flex 4.0, you have to include corresponding library in your project.

Filename Property

You have to specify name of filename to be generated, this is only applicable to Cocoa source code type only. Your source will be generated in corresponding .h and .m files appended to filename you have specified.

Folder Property

The generated source code will be saved in this folder you have specified, if files with same name exists they will be deleted.

Namespace/Package Property

For Java, C# and Flash/Flex, all the generated source code will be generated with specified package/namespace. Please note you have to carefully map your "Folder" and namespace so that they meet platform requirements. For best practice, first generate package in your eclipse, keep same name of the package and right click on package name and specify "Folder Property" as the physical folder specified in the properties window.

^ Top

Web Service Base URL

There are two properties available in each of the client, Base Url and Global Base Url. In the application start up code of your project, you must specify Base Url as mentioned below. Base Url can be set two ways.

  1. You can set service.baseUrl to each instance of service.
  2. Or you can set SoapWebService.globalBaseUrl property only once, that will be used to connect to your server.

If you have specified SoapWebService.globalBaseUrl, you can still override this behaviour in each service instance by setting service.baseUrl property.

Base URL must only contain (http) or (https) and domain name as specified below. No additional slash after the domain name, you can include the port number if its not 80.

http://myHost.myServer.com
https://myHost.myServer.com
http://myHost.myServer.com:99
https://myHost.myServer.com:99

^ Top

Cocoa Synchronous Sample Code

MyWebService* ws = [MyWebService service]; 
// // set base url for entire application 
// [SoapWebService setGlobalBaseUrl: @"http://domain.com"]; 
// //set base url only for this service 
// [ws setBaseUrl: @"http://domain.com"]; 
NSError* error = nil; 
Result* rs = [ws callMethod: p1 param2:p2 error:&error]; 
if(error != nil){ 
   // process error message.... 
   return.... 
} 

 

.. use Result

^ Top

Cocoa Asynchronous Sample Code

-(void) onError: (NSError*) error{ 
   ... process error... 
} 

-(void) onCallMethod:(MyWebServiceAsync*)service result:(Result*) rs{ 
   ... process result... 
} 

-(void) callService{ 
   MyWebServiceAsync* ws = [MyWebServiceAsync service]; 
   // // set base url for entire application 
   // [SoapWebService setGlobalBaseUrl: @"http://domain.com"]; 
   // //set base url only for this service 
   // [ws setBaseUrl: @"http://domain.com"]; 
   [ws setDelegate: self]; // dont forget to set delegate 
   [ws callMethod: p1 parame2:p2]; 
}

 

^ Top

Java Synchronous Sample Code

MyWebService service = new MyWebService(); 
// // set base url for entire application 
// SoapWebService.setGlobalBaseUrl("http://domain.com"); 
// // set base url for only this service 
// service.setBaseUrl("http://domain.com"); 
Result rs = service.callMethod(p1,p2);

 

^ Top

Java Asynchronous Sample Code

MyWebServiceAsync service = new MyWebServiceAsync(); 
// // set base url for entire application 
// SoapWebService.setGlobalBaseUrl("http://domain.com"); 
// // set base url for only this service 
// service.setBaseUrl("http://domain.com"); 
service.callMethod( p1, p2, 
   service.new CallMethodResult(){ 
      //Anonymous inline class 

      public void onResult(Result rs){ 
         
      } 

      public void onError(Exception ex){ 
      
      } 

   } 
);

 

^ Top

Comments are closed.