From: <cl...@br...> - 2006-11-22 14:37:01
|
Dear Micheal,=20 had a similar issue on a Java SOAP class from APACHE & Jython .. hope=20 this hint helps.=20 Jython dynamically create an instance of the Java class, you don't get=20 access to the abstract class.=20 Replace the abstract class name by the instance name and it should work.=20 in place of :=20 mSfSoap =3D (ISourceForgeSoap) ClientSoapStubFactory.getSoapStub(ISourceForgeSoap.class, serverUrl); write:=20 mSfSoap =3D ISourceForgeSoap() ClientSoapStubFactory.getSoapStub(mSfSoap.class, serverUrl) A similar example of a Java Jython SOAP code i=B4ve pulished under the=20 monthly newsletter:=20 http://wiki.python.org/jython/JythonMonthly/Articles/November2006/2 myString =3D javaString(symbol) params.addElement(Parameter("symbol", myString.class, symbol, None)) Regards, Claude Claude Falbriard=20 Developer=20 AMS Hortol=E2ndia / SP - Brazil=20 phone: +55 13 8117 3316 e-mail: cl...@br... "Michael March" <mm...@gm...>=20 Sent by: jyt...@li... 11/22/2006 12:03 PM To jyt...@li... cc Subject [Jython-users] Need help porting Java to Jython.. I usually horse around in CPython but my job is making me use some use some Java libraries thus my first attempt at Jython. I am trying to use the an API to access the Enterprise version of SourceForge. VA Software ships a JAR file that wraps their SOAP API. Here is an example code fragment (in Java) that does performs a login and then receives a session key: import com.vasoftware.sf.soap43.webservices.ClientSoapStubFactory; import com.vasoftware.sf.soap43.webservices.sfmain.ISourceForgeSoap; import com.vasoftware.sf.soap43.webservices.sfmain.ProjectSoapList; import com.vasoftware.sf.soap43.webservices.sfmain.ProjectSoapRow; import java.rmi.RemoteException; import java.io.IOException; /** * The SoapRunner class demonstrates how the SOAP APIs can be used * to list, create or edit projects, trackers, artifacts, task groups, * tasks etc. */ public class SoapRunner { /** SourceForge Soap interface handle */ private ISourceForgeSoap mSfSoap; /** Login user name */ private String mLoginUserName; /** Session id */ private String mSessionId; /** Soap server url */ private String mServerUrl; /** * Class consturctor. */ public SoapRunner(String serverUrl) { mServerUrl =3D serverUrl; mSfSoap =3D (ISourceForgeSoap) ClientSoapStubFactory.getSoapStub(ISourceForgeSoap.class, serverUrl); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } That last line is giving me grief.. My Java skills are weak.. and I can't figure out how that would map to Jython syntax. thanks (BTW... the full source his here: http://tinyurl.com/yaouat ) --=20 <admiral> Michael F. March ----- mm...@gm... Ph: (415)462-1910 ---- Fax: (602)296-0400 P.O. Box 2254 ---- Phoenix, AZ 85002-2254 "Seriously" - HSR ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share=20 your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE= VDEV =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F Jython-users mailing list Jyt...@li... https://lists.sourceforge.net/lists/listinfo/jython-users Claude Falbriard=20 Developer=20 AMS Hortol=E2ndia / SP - Brazil=20 phone: +55 13 8117 3316 e-mail: cl...@br... |