[MOBY-l] sample code of Central.call method

Yasumasa Shigemoto yshigemo at genes.nig.ac.jp
Fri Nov 14 05:43:26 UTC 2003


Dear Martin,

I changed the program but I got the following error.

METHOD CALL: GenbankAccSequenceRetrieve
------------
<?xml version="1.0" encoding="UTF-8"?>
<moby:MOBY xmlns:moby="http://www.biomoby.org/moby">
    <moby:Query>
        <moby:queryInput>
             <Simple articleName=''>
                <Object namespace="urn:lsdi:biomoby.org:namespacetype:ncbi_acc"
id="AB000001"/>
             </Simple>
        </moby:queryInput>
    </moby:Query>
</moby:MOBY>

------------

Exception in thread "main" org.biomoby.shared.MobyException: ===ERROR===
Fault details:
[stackTrace: null]
Fault string: Denied access to method (GenbankAccSequenceRetrieve) in class (mai
n) at /usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm line 2128.

Fault code:   {http://schemas.xmlsoap.org/soap/envelope/}Client
Fault actor:  null
When calling:
        http://mobycentral.cbr.nrc.ca/cgi-bin/Services/Services.cgi
===========

        at org.biomoby.client.CentralImpl.doCall(Unknown Source)
        at org.biomoby.client.CentralImpl.call(Unknown Source)
        at Q.main(Q.java:14)



Could you change the code to work correctly?


import org.biomoby.shared.*;
import org.biomoby.client.*;
import java.util.*;
import java.io.*;

public class Q {
	public static void main(String args[]) throws Exception {
		Central central = new CentralImpl(
			"http://mobycentral.cbr.nrc.ca/cgi-bin/Services/Services.cgi",
			"http://biomoby.org"
		);
		central.setDebug(true);
		String inputXML = getXML();
		System.out.println(central.call("GenbankAccSequenceRetrieve", inputXML));
	}

	public static String getXML() throws Exception {
		return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"+
"<moby:MOBY xmlns:moby=\"http://www.biomoby.org/moby\">\n"+
"    <moby:Query>\n"+
"        <moby:queryInput>\n"+
"             <Simple articleName=''>\n"+
"                <Object namespace=\"urn:lsdi:biomoby.org:namespacetype:ncbi_acc\" id=\"AB000001\"/>\n"+
"             </Simple>\n"+
"        </moby:queryInput>\n"+
"    </moby:Query>\n"+
"</moby:MOBY>";
	}
}

Regards,
Yasumasa Shigemoto

Martin Senger wrote:
> 
> > I read the API document at http://biomoby.org/twiki/bin/view/TWiki/BioMOBYAPI.
> >
>     This is a general API, a language independent API. For using the Java
> one, look rather in the jMoby pages - the API may not be yet visible there
> because the server has been moved recently. In that case, try my mirror:
> http://industry.ebi.ac.uk/~senger/jMoby/API/index.html.
> 
> > And I try to access using 'central.call("GenbankAccSequenceRetrieve",
> > But I get an Error.
> >...
> > Exception in thread "main" org.biomoby.shared.MobyException: ===ERROR===
> > Fault details:
> > [stackTrace: null]
> > Fault string: Failed to locate method (GenbankAccSequenceRetrieve) in class (MOB
> > Y::Central) at /usr/local/lib/perl5/site_perl/5.8.0/SOAP/Lite.pm line 2195.
> >
>    ...which means that you have not specified the correct location (an
> endpoint of the service). You are calling the Moby Central, but you should
> be calling the service itself. Moby Central doe not provide services, it
> provides only pointers to them.
> 
>    Martin
> 
> --
> Martin Senger
> 
> EMBL Outstation - Hinxton                Senger at EBI.ac.uk
> European Bioinformatics Institute        Phone: (+44) 1223 494636
> Wellcome Trust Genome Campus             (Switchboard:     494444)
> Hinxton                                  Fax  : (+44) 1223 494468
> Cambridge CB10 1SD
> United Kingdom                           http://industry.ebi.ac.uk/~senger



More information about the moby-l mailing list