I am unable to invoke handlers by configuring it in services.xml. The same
handler thought works fine when I configure it to the client using the API.
But with services.xml, the handler is not getting triggered at all. Request
is working fine though.
Here is my services.xml:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0";>
   <service>
       <name>BasicMath</name>
       <serviceClass>com.ameriprise.javatips.webservices.example.IBasicMath
</serviceClass>
       <implementationClass>
com.ameriprise.javatips.webservices.example.BasicMathImpl
</implementationClass>
       <style>wrapped</style>
       <use>literal</use>
       <scope>application</scope>
       <inHandlers>
               <handler handlerClass="
com.ameriprise.javatips.webservers.handlers.LogHandler" />
       </inHandlers>
    </service>
</beans>


Another problem is when I try to mention two handlers, like this below:


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0";>
    <service>
         <name>BasicMath</name>
         <serviceClass>
com.ameriprise.javatips.webservices.example.IBasicMath</serviceClass>
         <implementationClass>
com.ameriprise.javatips.webservices.example.BasicMathImpl
</implementationClass>
         <style>wrapped</style>
         <use>literal</use>
         <scope>application</scope>
        <inHandlers>
               <handler handlerClass="
org.codehaus.xfire.util.dom.DOMInHandler" />
               <handler handlerClass="
com.ameriprise.javatips.webservers.handlers.LogHandler" />
        </inHandlers>
    </service>
</beans>
I get following exception:



org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested
exception is org.codehaus.xfire.fault.XFireFault: Unexpected close tag
</body>; expected </HR>.
at [row,col {unknown-source}]: [12,187]
org.codehaus.xfire.fault.XFireFault: Unexpected close tag </body>; expected
</HR>.
at [row,col {unknown-source}]: [12,187]
at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
at org.codehaus.xfire.client.Client.onReceive(Client.java:386)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(
HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java
:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java
:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy0.add(Unknown Source)
at com.ameriprise.javatips.client.example.ProxyClient.main(ProxyClient.java
:44)
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag
</body>; expected </HR>.
at [row,col {unknown-source}]: [12,187]
at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:451)
at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem(
BasicStreamReader.java:3137)
at com.ctc.wstx.sr.BasicStreamReader.readEndElem(BasicStreamReader.java
:3079)
at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java
:2713)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1004)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(
ReadHeadersHandler.java:44)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java
:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:382)
... 10 more
Exception in thread "main"

Is there anything wrong I am doing?

Any help is appreciated. Thanks.


Thanks and Regards,
Saurabh Nayar

Reply via email to