Server Usage Example:

The following example shows how jSoapServer can be used by other java programs.

    // creating a new soap server instance
    SoapServer myServer = new SoapServer();     

    // deploing all needed services (classname, servicename)
    myServer.deployRpcSoapService("org.jSoapServer.SoapService","test");
       
    // configuring the server properties via config file
    String confFile = "conf" + File.separator + "jSoapServer.xml"; 
    if(myServer.initService(confFile)) 
    {
          // starting jSoapServer
          myServer.startServer();
    }

Example Configuration file:

Am example configuration file can be viewed here

Example Webservice:

The server usage example above uses the test soap service org.jSoapServer.SoapService which is quite simple but demonstrates who easy you can make your services accessible via jSoapserver.

SoapService.java shows:

  • webservice methods processing input parameters with simple datatypes
  • how to get username and password that was set by a client via http authorization header
  • how to process application specific soap headers
  • how to receive soap attachments