Announcement Announcement Module
Collapse
No announcement yet.
XFire client in Spring WebApp. How to... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XFire client in Spring WebApp. How to...

    Hello everybody.
    I'm new to web services and Xfire

    There a lot of documentation how to build Xfire WS within a Spring WebApp. And not so many sampes how to consume outside WS using XFire client in Spring WebApp.

    I have built Spring WebApp and XFire WS within it, and now I need to consume this WS in another Spring WebApp project.

    I have found some docs where they say to generate classes using WSDL 2 Java tools. After I have generated source classes and add them to project they really began to work fine while I run tests. But when I tried to configure WS Client in Spring config the problems began. I tried many times but have no success


    The only way (and may be the most stupid way) I have found was like this

    Spring config

    Code:
    <bean id = "client" class="org.codehaus.xfire.client.Client">
           <constructor-arg value="http://161.8.200.5:8080/openV7/services/bkttl?wsdl"/>
        </bean>
        <bean id="v7ClientImpl" class="budget.client.V7ClientImpl">
            <property name="client">
                <ref local="client"/>
            </property>
        </bean>
    class V7ClientImpl implements interface

    Code:
    public interface V7Client {
        public BigDecimal Snd(String acc_no,String date_ttl,String rep_symb) throws Exception;
    }

    This metod invokes outside WebServise lik this

    Code:
    Object[] o = client.invoke("Snd", new Object[]{acc_no, date_ttl, rep_symb});
    Everything is all right exept the cases when URL _http://161.8.200.5:8080/openV7/services/bkttl?wsdl is not reachible.

    I do understand that when WS is not running the Client would not be able to get any information. Only thing I want is to intercept the Exception, but can't understand how to do it because my client configered in spring config

    Code:
    <bean id = "client" class="org.codehaus.xfire.client.Client">
           <constructor-arg value="http://161.8.200.5:8080/openV7/services/bkttl?wsdl"/>
        </bean>
    Are there any spring features to manage exceptions, while it load beans?

    Or may be you have other vision of how to use WS client in WebApps?

    Thanks in advance!
Working...
X