[MOBY-l] registering an axis web service
Benjamin Good
bmg at sfu.ca
Wed Jun 9 21:07:38 UTC 2004
Hi Rebecca,
Thanks for your quick reply. At the moment I am working behind a
firewall that prevents Canada Moby from accessing the methods on my
machine, but I've been successfully testing on a local central.
It seems that the problem that I was having was just getting the
name of the container for my service correct...:( I had created a
package called biomoby.services and placed my EchoXML class inside it.
I got it running by setting the URL for the service to point at the
package:
http://localhost:8080/axis/services/biomoby.services
and the name for the service to the name of the method:
echoXMLString
For others who might be as unfamiliar with axis as I am it is quite
handy to simply check what services and methods are actually avaliable
on your machine by pointing a web browser at
http://localhost:8080/axis/services
Sorry for the beginner mistake, may this post help another beginner
somewhere!
cheers
-Ben
Rebecca Ernst wrote:
> Hi Ben!
>
> what exactly so you mean with 'not getting anything back from the
> service'?
>
> I would try it like this:
>
> register it (what you obviously did) with moby central Canada
> then you should be able to retrieve the service with the canadian
> client (I just checked but i couldn't find your service?)
> try to execute it there
> do you then get back 'service not available' ?
>
> This is how we registered one of Viji's axis services:
>
> #!/usr/local/perl-5.6.1/bin/perl
> use MOBY::Client::Central;
> use MOBY::Client::Service;
>
> my $C = MOBY::Client::Central->new();
> $REG = $C->registerService(
> serviceName => "getTestMessage",
> serviceType => "Retrieval",
> authURI => "mips.gsf.de",
> contactEmail=> 'viji at gsf.de',
> description => 'takes a object and returns a string',
> category => 'moby',
> URL => 'http://146.107.217.144/axis/services/TestAxis',
> input => [
> [undef,['Object', ['Global_Keyword']]]
> ],
> output => [
> [undef,['String', ['Global_Keyword']]]
> ]
> );
> print $REG->message;
>
>
> Cheers,
> Rebecca
>
>
>
> Benjamin Good wrote:
>
>>
>> Dear list,
>>
>> I have developed a moby-compliant web service using Java Axis. How
>> can I register this with MobyCentral? I've tried using a perl method
>> like below, but can't seem to get it quite right. Registration
>> succeeds, but I can't get anything back from the service. Also the
>> wsdl generated by MobyCentral doesn't match the WSDL generated locally.
>>
>> sub register_service {
>> #$C is the moby-central instance
>> my $C = shift;
>> my $reg = $C->registerService(
>> serviceName => echoXMLStringRequest,
>> authURI => 127.0.0.1,
>> contactEmail => bmg at sfu.ca,
>> description => "An axis service for testing",
>> URL => http://localhost:8080/axis/services/,
>> input => [ ['', ["Object" => []]], ],
>> output => [ ['', ["Object" => []]], ],
>> category => "moby",
>> serviceType => "Retrieval",
>> );
>> die "Bad return value from registerService" unless $reg;
>> if ($reg->success == 1){
>> print "Registration successful\n\n";
>> }
>> else {
>> print "Registration failed: ", $reg->message, "\n";
>> }
>> }
>>
>> Here is the WSDL generated when I run it (successfully) from a
>> non-moby java client
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <wsdl:definitions targetNamespace="urn:biomoby.services"
>> xmlns:impl="urn:biomoby.services" xmlns:intf="urn:biomoby.services"
>> xmlns:apachesoap="http://xml.apache.org/xml-soap"
>> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> xmlns="http://schemas.xmlsoap.org/wsdl/">
>>
>> <wsdl:message name="echoXMLStringResponse">
>>
>> <wsdl:part name="echoXMLStringReturn" type="xsd:string"/>
>>
>> </wsdl:message>
>>
>> <wsdl:message name="echoXMLStringRequest">
>>
>> <wsdl:part name="in0" type="xsd:string"/>
>>
>> </wsdl:message>
>>
>> <wsdl:portType name="EchoXML">
>>
>> <wsdl:operation name="echoXMLString" parameterOrder="in0">
>>
>> <wsdl:input name="echoXMLStringRequest"
>> message="impl:echoXMLStringRequest"/>
>>
>> <wsdl:output name="echoXMLStringResponse"
>> message="impl:echoXMLStringResponse"/>
>>
>> </wsdl:operation>
>>
>> </wsdl:portType>
>>
>> <wsdl:binding name="biomoby.servicesSoapBinding" type="impl:EchoXML">
>>
>> <wsdlsoap:binding style="rpc"
>> transport="http://schemas.xmlsoap.org/soap/http"/>
>>
>> <wsdl:operation name="echoXMLString">
>>
>> <wsdlsoap:operation soapAction=""/>
>>
>> <wsdl:input name="echoXMLStringRequest">
>>
>> <wsdlsoap:body use="encoded"
>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> namespace="urn:biomoby.services"/>
>>
>> </wsdl:input>
>>
>> <wsdl:output name="echoXMLStringResponse">
>>
>> <wsdlsoap:body use="encoded"
>> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>> namespace="urn:biomoby.services"/>
>>
>> </wsdl:output>
>>
>> </wsdl:operation>
>>
>> </wsdl:binding>
>>
>> <wsdl:service name="EchoXMLService">
>>
>> <wsdl:port name="biomoby.services"
>> binding="impl:biomoby.servicesSoapBinding">
>>
>> <wsdlsoap:address
>> location="http://localhost:8080/axis/services/biomoby.services"/>
>>
>> </wsdl:port>
>>
>> </wsdl:service>
>>
>> </wsdl:definitions>
>>
>> thanks for any ideas
>> -Ben
>>
>>
>>
>> _______________________________________________
>> moby-l mailing list
>> moby-l at biomoby.org
>> http://biomoby.org/mailman/listinfo/moby-l
>>
>>
>
More information about the moby-l
mailing list