Calling PowerServer open interfaces via Web service

Here is the code example that shows you how to call the PowerServer open interfaces via Web service in the PowerBuilder application.

Step 1: Generate the proxy object for the Web service using the .NET Web service engine.

  • URL for the open interface Web service in PowerServer installed to the Java application server (such as JBoss, WebLogic, WebSphere, or JEUS): http://AppeonServerName:Port/servlet/AppeonService?wsdl

  • URL for the open interface Web service in PowerServer installed to the .NET IIS server: http://AppeonServerName/servlet/AppeonService.asmx

Step 2: Create the instance for the SOAP connection object and the Web service proxy object.

soapconnection  ieon_soap
wsappeonservice ieon_ws    //the Web service proxy object generated by the .NET engine
wsauthsoapheader ieon_head
long ll_return
string ls_return, ls_server, ls_app

ieon_soap = create soapconnection
ieon_head = create wsauthsoapheader

Step 3: Connect with the Web service, and pass in the user name and password for security authentication.

ll_return = ieon_soap.createinstance (ieon_ws, 'wsappeonservice')
ieon_head.username = "admin"
ieon_head.password = "admin"
ieon_ws.setauthsoapheadervalue (ieon_head)

Step 4: Call the PowerServer open interface.

ls_server = sle_1.text
ls_app = sle_2.text
ls_return = ieon_ws.getAllSessions (ls_server, ls_app)