Listing 1

/**
* getPFShareList Method
*/
public String[] getPFShareList() throws javax.ejb.EJBException
{
String[] ShareList = new String[13];
int row = 0;
Statement stmt=null;
ResultSet rs=null; 
Connection con=null;

try {
javax.naming.Context ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)
ctx.lookup("java:comp/env/jdbc/Portfolio");
con = ds.getConnection();
stmt = con.createStatement();
rs = stmt.executeQuery
("SELECT * FROM DBA.SYMBOL SYMBOL ORDER BY symbol_cd"); 
while (rs.next()) {
ShareList[row] = rs.getString("symbol_cd") + ",";
ShareList[row] += rs.getString("symbol_ln") + ",";
ShareList[row] += rs.getString("symbol_current_price");
row += 1;

} catch (Exception e) {
System.out.println("getPFShareList Exception" + e.toString());
} finally {
try {
if ( rs != null ) rs.close();
if ( stmt != null ) stmt.close();
if ( con != null ) con.close();
} catch (SQLException e) {
System.out.println("getPFShareList SQLException" + e.toString());
}
}
return ShareList;
}

Listing 2

string sMethod = "getPFShareList"
string sEndPoint = "http://localhost:10000/WEB SERVICES/SOAP"
string sNameSpace = "PFShareListAll/PFShareList"
String sSoapAction = ="PFShareListAll/PFShareList.getPFShareList return,java.lang.String[],return"
int cRetBufLen = 128
string sArgs
string sResult
long lHandle
int iRet

// create & set attributes on for the soap call
iRet = PocketSoap_Create( true, REF lHandle )
wf_message( iRet, "PocketSoap_Create")

iRet = PocketSoap_SetEndPoint( lHandle, sEndPoint )
wf_message( iRet, "PocketSoap_SetEndPoint")

iRet = PocketSoap_SetSoapAction( lHandle, sSoapAction )
wf_message( iRet, "PocketSoap_SetSoapAction")

// preallocate the result string
sResult = Space( cRetBufLen )

// make a "simple call"
iRet = PocketSoap_SimpleCall
( lHandle, sNameSpace, sMethod, "", "" )
wf_message( iRet, "PocketSoap_SimpleCall")

// get the Result
iRet = PocketSoap_GetResult( lHandle, cRetBufLen, REF sResult )
wf_message( iRet, "PocketSoap_GetResult") 

// clean up 
iRet = PocketSoap_Destroy( lHandle )
wf_message( iRet, "PocketSoap_Destroy") 


//Separate window function
wf_message (integer ai_ret, string as_method)
If ai_ret <> 0 Then
MessageBox("Return code", String(ai_ret) + " " + as_method)
End if

Listing 3

string sMethod = "getQuote"
string sEndPoint = "http://services.xmethods.net/soap"
string sNameSpace = "urn:xmethods-delayed-quotes"
int cRetBufLen = 128
string sArgs
string sResult
long lHandle
int iRet
string ls_symbol

ls_symbol = sle_1.text

iRet = PocketSoap_Create( true, REF lHandle )
iRet = PocketSoap_SetEndPoint( lHandle, sEndPoint )
iRet = PocketSoap_SimpleCall
( lHandle, sNameSpace, sMethod, "symbol", ls_symbol )

sResult = Space( cRetBufLen )
iRet = PocketSoap_GetResult( lHandle, cRetBufLen, REF sResult )

// add the quote to the listbox
If sResult <> "-1" Then
lb_1.addItem( "Stock: " + ls_symbol + " Value: [" + sResult + "]" )
Else
MessageBox("PocketSOAP" , "Cannot find Stock:" + ls_symbol)
End if

iRet = PocketSoap_Destroy( lHandle )

Listing 4

string sMethod = "BabelFish"
string sEndPoint = "http://services.xmethods.net:80/perl/soaplite.cgi"
string sNameSpace = "urn:xmethodsBabelFish"
string sResult
int cRetBufLen = 2048
long lHandle
int iRet
string sArgs

//en_fr, en_es, en_de, en_it
sArgs = "translationmode~t"+ ddlb_language.text
sArgs += "~r~nsourcedata~t" + sle_xlat_src.text

iRet = PocketSoap_Create( true, REF lHandle )
iRet = PocketSoap_SetEndPoint( lHandle, sEndPoint )
iRet = PocketSoap_Call( lHandle, sNameSpace, sMethod, sArgs )

sResult = Space( cRetBufLen )
iRet = PocketSoap_GetResult( lHandle, cRetBufLen, REF sResult )

mle_xlat.text = mle_xlat.text + "~r~n---------" + "Result: " + sResult

iRet = PocketSoap_Destroy( lHandle )