[Fwd: Re: [greenstone-users] how to build Application which can search , get and manage the Object in GSDL remote]

From ak19@cs.waikato.ac.nz
DateThu May 15 19:12:38 2008
Subject [Fwd: Re: [greenstone-users] how to build Application which can search , get and manage the Object in GSDL remote]
---------------------------- Original Message ----------------------------
Subject: Re: [greenstone-users] how to build Application which can search
, get and manage the Object in GSDL remote
From: "feng wang" <wangfeng77&#64;gmx.de>
Date: Thu, May 8, 2008 4:47 am
To: ak19@cs.waikato.ac.nz
--------------------------------------------------------------------------

Hello Anupama,

Sorry, that i disappeared for a whole. I was going to write a demo for
Fedora Repository und searching the answer to communciate to DSpace just
like for the Fedora and GSDL.

Now turn it to the GSDL! I tried to use the Demo Code what you gived to
me. And used to creat the java file in the
"Example1_WritingClientForGS3WebService". To test! but still got Error!

"ERROR trying to invoke web servicejava.lang.NullpointerException
In main. Exception: java.lang.NullpointerException"

I knew there is something wrong by invoking the message with the method
call.invoke(msg)and also knew that i have to find out what kind of the
return values is. then i should change the code after getting the values
class.
But how can i kill the Exception? Hope that you can help me !

the second question is about the gs3Service and gs3client. what you gived
to me are new developed code from you. But it's not the standard version
for GSDL. I mean that there are no digital Libraries in web having the
gs3service code. But i must write a wrapper for all libraries which are
used by GSDL Software. So i don't know whehter i should use your code.
Maybe i should sak my teacher at first.

regards
feng wang

-------- Original-Nachricht --------
> Datum: Wed, 16 Apr 2008 11:43:20 +1200 (NZST)
> Von: ak19@cs.waikato.ac.nz
> An: "feng wang" <wangfeng77@gmx.de>
> Betreff: Re: [greenstone-users] how to build Application which can
search , get and manage the Object in GSDL remote

> Hello Feng Wang,
> You picked the perfect time to ask me the questions you did, because I
> wrote two text files yesterday for a GS3 developer here that was precisely
> about these things. The files are:
> 1. How to write a client for the process web service
> 2. How to write a general purpose web service class (even though you
> particularly would like information on how to write a client for
> Greenstone 3's existing web service).
> I am attaching these files here.
>
> You asked:
> 1. Anupama, like you told to me that in the GSDL
> http://localhost:8080/greenstone3/services has a WSDL Page for □process□
> method.
> But it□s for the □process□ messages or for the □process□ services?
> You
> know, there is a □process□ service in the □process□ message.
>
> It is the process Message. That means you can send "describe", "query",
> "retrieve" and all other requests that the Greenstone 3 MessageRouter can
> handle to it (see the Greenstone 3 manual).
>
>
> You rightly observed that Fedora has stub classes that make invoking its
> web services easier and that its fedora-client.jar contains these stub
> classes for us to use. Yes, Greenstone's current web service (process)
> does not come with stub classes, which means that developers of client
> applications have to do more work before they can invoke the service.
> > And the Fedora has a DEMO Java Code for the SOAP Implementation.
> > Can you give me some source code or advices for client Implementation,
> if you have? Some demo-code like describe the repository. I just wanna
> study and begin to write my program as fast as soon.
>
> What I'll do is, next to those two Example text files that I intend to
> attach, I will attach the relevant java files of my code with their
> javadocs. The two java files are:
> 1. GS3WebServices.java: The class with the web services methods that I
> have written.
> The "configure" and "system" messages should work, but I need to ask
> Katherine Don about the added web services which invoke build/NewDocument
> and build/ImportCollection and why the MessageRouter's response at present
> isn't as I anticipated.
> 2. GS3WebServicesAPI.java: The class on the client end that handles the
> web service method invocations. This class is like the Fedora API-A class
> that you use to access Fedora's web services.
> Essentially, GS3WebServicesAPI.java is like a manually written stub class,
> though one can generate a static stub class for the web services using the
> Java WebServices Development Pack (JWSDP) I think.
> I needed it to conform to my interface class and so wrote something
> manually that could work with my client. But because I've more recently
> split the class that does this client-side work into two, I think one of
> the two can implement the interface class while the other can be an
> auto-generated stub class. Therefore, thanks to the ideas in your email I
> may now consider having it generated automatically as a static stub file
> each time changes have been made to the web services class in Greenstone's
> code repository. I believe something like this is what Fedora does as
> well.
>
> Just have a look at the files and ask me if there's something you don't
> understand. I will attach the javadoc for the two files as well. Do bear
> in mind that
> - the functioning of the web service operation that maps the process
> Service (not process message) in the web services class, which is meant to
> be used to import and build new collections for instance, needs further
> investigation and I would have to talk to Katherine for that.
> - the help web service methods are not functional yet. I intend loading
> help strings from a properties file that I already have somewhat prepared
> but haven't formatted yet. This file usually contains the contents in the
> javadoc. I have included it in the attachment (helpfile.txt).
>
> What I suggest you could do after downloading the tar.gz attachment:
> 1. Read the two "Example-something" text files about how to write a web
> service class and general web service client. Don't need to do anything
> with it.
> 2. Take the code files and create an eclipse project and put them into
> their proper package structure in there. Add the necessary jar files from
> Greenstone into their build path to get them compiling. Also add all the
> jar files they will complain about to get them running (Run
> configuration).
> 3. There are main methods in both classes for you to test running them
> with. I may have made some changes yesterday when trying to merge my web
> services with Greenstone's existing SOAPServer<sitename>.java class, but I
> think it should still work. Tell me if there is any problem.
> 4. First try running the main method of the web services class
> GS3WebServices.java as a regular class. Then, using the information in the
> Example2_CreatingWebServices.txt file, expose this class as a web service.
> 5. Now, try running the main method in the client-side API class
> GS3WebServicesAPI.java.
> 6. Note how the client class merely returns XML responses as Strings. It's
> obviously not as special as the Fedora API-A classes that return
> ready-made data structures. Therefore, a Greenstone client has to either
> do lots of parsing to create data structures to represent the response
> data OR needs to parse out just the data it needs. To do this, my
> demo-client code has a package containing the data structures it uses.
> However, for now, just try reading the files above and getting the two
> java files running.
>
>
> For your information (where I am now):
> The current state of the Greenstone 3 demo-client executable JAR file
> requires users to do a lot to get it executing (I got the jar file created
> and working only yesterday). Though I believe I have finished up the code
> for the demo-client, at present I am investigating if I can get the client
> jarred up into an executable in such a way that it hopefully won't require
> the user to write or modify the manifest file themselves (by locating the
> many jar file dependencies).
> After this step is done, I will be adding the source code to the SVN
> repository, hopefully with an ant file or other script that can compile it
> for people who choose to download it.
>
> Best of luck trying it all out. Regards,
> Anupama
>
>
> Hi,
>
> I am glad that I could get so many advices from the developer team of
> GSDL. And so
> lucky got the answer about the SOAP.
>
> Anupama, like you told to me that in the GSDL
> http://localhost:8080/greenstone3/services has a WSDL Page for □process□
> method.
> But it□s for the □process□ messages or for the □process□ services?
> You
> know, there is a □process□ service in the □process□ message.
>
> Do you know, whether the GSDL supports any messages without the WSDL
> Information
> except the □process□? Like □describe□, □system□□ type messages in
> the
> Manual.pdf. There are important for my client program too. So I must know
> it, hehe.
>
> To write the remote Client Implementation for GSDL with SOAP is not so
> easy like for
> the Fedora Repository. The Fedora hat a Fedora-Client.jar, which has two
> APIs for
> accessing the managing the Fedora Repository including the SOAP. What I
> should do is
> just to call the method with the two APIs. And the Fedora has a DEMO Java
> Code for
> the SOAP Implementation.
>
> I think for the GSDL, I must create the SOAP Stub and Connection, parse
> the XML File
> □ all by myself. I am a Newbie for it. So I do need the help from you.
> Can you
> give me some source code or advices for client Implementation, if you
> have? Some
> demo-code like describe the repository. I just wanna study and begin to
> write my
> program as fast as soon.
>
> Do you know how I can upload the Document remote to GSDL Service with SOAP
> and
> □Process□? And how does the workflow for the building a Document look
> like? Like
> the GLI with several different □process□ message?
>
> Hope, that you can help me. Thank You!
>
> Regards
> Feng Wang

--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal f□r Modem und ISDN: http://www.gmx.net/de/go/smartsurfer