Hi Geek,

Can you check you application context configuration
file for the web service bean? I do not get the
service instance programatically, but through
Dependecy Injection and did not face any problem.

Try configuring it in your client's
dispatcher-servlet.xml file as 

        <bean id="myWebService"
class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
            <property name="lookupServiceOnStartup"
value="false"></property>
            <property name="serviceClass"> 
              <value>beamrocs.service.IMyWebService</value>
            </property>
            <property name="wsdlDocumentUrl">
             
<value>http://localhost:8080/TestD/services/OrderService?WSDL</value>
                    </property>
        </bean>

and then you can inject this bean to your DAO like 
        <bean id="myServiceClientDao"
class="client.dao.OrderServiceDao">
                <property name="myWebService"
ref="myWebService"></property>
        </bean>

This should have worked. Before that just make sure
that the service is accessible with the URL you have
configured. you can check whether you are able to get
the service WSDL xml by just putting on the browser
address bar the service WSDL url e.g mentioned in the
client configuration
http://localhost:8080/TestD/services/OrderService?WSDL

If this url does not give you WSDL xml then there is
problem in your service configuration.

Regards,
Anshumn Sagar

--- "geek.shrek" <[EMAIL PROTECTED]> wrote:

> 
> 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
> >> > 
> >> >
> 
=== message truncated ===



       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car 
Finder tool.
http://autos.yahoo.com/carfinder/

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to