Hi Anshumn,
Thanks for the example :) but I still can't get the Vector from the client
side.
I tried with a simple client to test the server, without the spring first.
and I have "Could not invoke service". I had a look from the myeclipse web
services explorer, the service returned fine data. It seems like the vector
is empty.
I put the client in the same location as the server just to test.
Here's my client
Service serviceModel = new AnnotationServiceFactory()
.create(OrderServiceImpl.class);
try
{
OrderService service = (OrderService) new
XFireProxyFactory().create(
serviceModel,
"http://localhost:8080/TestD/services/OrderService");
String s = service.getEvents().toString();
System.out.println(s);
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
"getEvents" is returning a Vector.
Is there anything that I missed here?
Thanks,
Anshumn Sagar wrote:
>
> Hi,
>
> Client code is also similar. You need to provide the
> Service Interface and the same aegis file to the
> client. Jar it in the same package structure and place
> the jar in your client classpath.
>
> Then configure the service in your client's spring web
> context file. The entry would be like -
>
> <bean id="myWebService"
> class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
> <property name="lookupServiceOnStartup"
> value="false"></property>
> <property name="serviceClass">
> <value>myservice.service.IMyService</value>
> </property>
> <property name="wsdlDocumentUrl">
>
> <value>http://localhost:7001/appname/MyService?WSDL</value>
>
> </property>
> </bean>
>
> then you can inject "myWebService" bean to your
> controllers or Data Access Object for client side.
>
> In the URL here,
> http://localhost:7001/appname/MyService?WSDL
> "MyService" is the handler mapping key on the service
> side.
>
> Hope this helps!
>
> Regards,
> Anshumn
> --- "geek.shrek" <[EMAIL PROTECTED]> wrote:
>
>>
>> Thanks a lot for your wuick reply :)
>>
>> a very good tip to put the file in the same package
>> :)
>> it worked now :D
>>
>> could you please give me a client example to get the
>> collection.
>>
>>
>> Cheers,
>>
>>
>>
>>
>> Anshumn Sagar wrote:
>> >
>> > Hi,
>> >
>> > You need to create an
>> ServiceinterfaceName.aegis.xml
>> > file which should contain the mappings for the
>> methods
>> > which are going to return a list.
>> >
>> > Suppose your web service Interface file is
>> > IMyService.java, then the name of the aegis file
>> would
>> > be IMyService.aegis.xml
>> >
>> > and suppose you have a method named
>> getListContents(),
>> > which returns a list of Strings, then the aegis
>> file
>> > would contain the following mapping -
>> >
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <mappings>
>> > <mapping>
>> > <method name="getListContents">
>> > <return-type componentType="java.lang.string"/>
>> > </method>
>> > </mapping>
>> > </mappings>
>> >
>> > The aegis file should be placed in the same
>> package
>> > where the service interface is present.
>> >
>> > Hope this helps.
>> >
>> > Regards,
>> > Anshumn
>> >
>> >
>> > --- "geek.shrek" <[EMAIL PROTECTED]> wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> Can anyone give me an example how to return a
>> >> Collection such as List or
>> >> Vector in xfire using Spring?
>> >>
>> >> Thanks.
>> >> --
>> >> View this message in context:
>> >>
>> >
>>
> http://www.nabble.com/Web-Service-return-Collection-%28List-or-Vector%29-tf4054129.html#a11515704
>> >> Sent from the XFire - User mailing list archive
>> at
>> >> Nabble.com.
>> >>
>> >>
>> >>
>> >
>>
> ---------------------------------------------------------------------
>> >> To unsubscribe from this list please visit:
>> >>
>> >> http://xircles.codehaus.org/manage_email
>> >>
>> >>
>> >
>> >
>> >
>> >
>> >
>>
> ____________________________________________________________________________________
>> > Get the Yahoo! toolbar and be alerted to new email
>> wherever you're
>> > surfing.
>> >
>>
> http://new.toolbar.yahoo.com/toolbar/features/mail/index.php
>> >
>> >
>>
> ---------------------------------------------------------------------
>> > To unsubscribe from this list please visit:
>> >
>> > http://xircles.codehaus.org/manage_email
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>>
> http://www.nabble.com/Web-Service-return-Collection-%28List-or-Vector%29-tf4054129.html#a11516307
>> Sent from the XFire - User mailing list archive at
>> Nabble.com.
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>> http://xircles.codehaus.org/manage_email
>>
>>
>
>
>
>
> ____________________________________________________________________________________
> Be a better Globetrotter. Get better travel answers from someone who
> knows. Yahoo! Answers - Check it out.
> http://answers.yahoo.com/dir/?link=list&sid=396545469
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
--
View this message in context:
http://www.nabble.com/Web-Service-return-Collection-%28List-or-Vector%29-tf4054129.html#a11532243
Sent from the XFire - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email