Re: Problem setting Classpath in Websphere Application Server 5.0

Aashish Kaushik <[email protected]> Tue, 9 Mar 2004 19:33:52 +0530
Newsgroups gmane.comp.java.sun.ejb.general
Message-ID <[email protected]>
Hi Amit,
You can set these variables in Server Classpath in Server Configuration tab of WSAD

	-----Original Message----- 
	From: A mailing list for Enterprise JavaBeans development on behalf of Amit Gupta 
	Sent: Tue 09/03/2004 18:32 
	To: [email protected] 
	Cc: 
	Subject: Problem setting Classpath in Websphere Application Server 5.0
	
	

	Hi,
	I ran the class file in websphere, works fine, but
	only when I have my classpath.
	
	I want to run the .class file in websphere without
	setting the classpath on my machine. So, I am assuming
	the classpath information should be going in some kind
	of a file, from where websphere finds the classpath
	info.
	I am having only WebSphere Application Server 5.0.0
	and  not the complete version Websphere studio
	Application Developer 5.0.0
	
	Below, is my .java file. This is what I do inorder to
	compile the program.
	
	My classpath is C:\Program
	Files\WebSphere\AppServer\lib\Xerces.jar;C:\Program
	Files\WebSphere\AppServer\lib\soap.jar;C:\Program
	Files\WebSphere\AppServer\lib\j2ee.jar;C:\Progr
	am
	Files\WebSphere\AppServer\java\jre\lib\ext\activation.jar;C:\Program
	Files\WebSphere\AppServer\java\jre\lib\ext\mail.jar;.;
	
	Thanks
	Asha
	============================================
	
	
	import java.io.*;
	import java.util.*;
	import java.net.*;
	import org.w3c.dom.*;
	import org.apache.soap.util.xml.*;
	import org.apache.soap.*;
	import org.apache.soap.encoding.*;
	import org.apache.soap.encoding.soapenc.*;
	import org.apache.soap.rpc.*;
	import
	org.apache.soap.transport.http.SOAPHTTPConnection;
	
	class hello{
	        public static void main(String args[]) throws
	Exception{
	                URL url = new URL
	("http://localhost/MonteroHost31/MonteroHost31.WSDL");
	                SOAPMappingRegistry smr = new
	SOAPMappingRegistry ();
	                StringDeserializer sd = new StringDeserializer
	();
	                smr.mapTypes (Constants.NS_URI_SOAP_ENC,    new
	QName ("", "Result"), null, null, sd);
	
	                // create the transport and set parameters
	                SOAPHTTPConnection st = new SOAPHTTPConnection();
	
	                // build the call.
	                Call call = new Call ();
	                call.setSOAPTransport(st);
	                call.setSOAPMappingRegistry (smr);
	
	                call.setTargetObjectURI
	("http://tempuri.org/MonteroHost31/message/");
	
	call.setMethodName("TsHostInterface_GetUserList");
	                call.setEncodingStyleURI
	("http://schemas.xmlsoap.org/soap/encoding/");
	
	                Vector params = new Vector();
	                params.addElement(new Parameter("strSession",
	String.class,
	"{7D117225-EFBA-421A-8071-5EECC18E1680}", null));
	                params.addElement(new Parameter("nHostID",
	Integer.class, new Integer(2), null));
	                call.setParams(params);
	
	                Response resp = null;
	                try
	                {
	                        resp = call.invoke
	(url,"http://tempuri.org/MonteroHost31/action/SPSHost2.TsHostInterface_GetUserList");
	
	                }
	                catch (SOAPException e)
	                {
	                        System.err.println("Caught SOAPException (" +
	e.getFaultCode () + "): " + e.getMessage ());
	                        return;
	                }
	
	                // check response
	                if (resp != null && !resp.generatedFault())
	                {
	                        Parameter ret = resp.getReturnValue();
	                        Object value = ret.getValue();
	                        System.out.println ("Answer--> " + value);
	                }
	                else
	                {
	                        Fault fault = resp.getFault ();
	                        System.err.println ("Generated fault: ");
	                        System.out.println (" Fault Code = " +
	fault.getFaultCode());
	                        System.out.println (" Fault String = " +
	fault.getFaultString());
	                }
	        }
	
	
	}
	
	__________________________________
	Do you Yahoo!?
	Yahoo! Search - Find what you’re looking for faster
	http://search.yahoo.com
	
	===========================================================================
	To unsubscribe, send email to [email protected] and include in the body
	of the message "signoff EJB-INTEREST".  For general help, send email to
	[email protected] and include in the body of the message "help".