XFire
  1. XFire
  2. XFIRE-980

org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.2.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows XP, XFire 1.2.6
    • Number of attachments :
      0

      Description

      I have generated the stubs thro' WSGen utility and I am using static XFire client.I have written client code to access web service. This client workks fine in case of retrieval methods ie when I am reading the data from web service it works fine.

      But as soon as I try to send some data to web service then I am getting this error. I have tried with various client settings/Style inluding wrapped but it doesn't work.

      Any help/inputs will be deeply appreciated.

        Activity

        Hide
        Tomasz Sztelak added a comment -

        you should provide more info, like full serverside stacktrace, method signature ( for client and server )

        Show
        Tomasz Sztelak added a comment - you should provide more info, like full serverside stacktrace, method signature ( for client and server )
        Hide
        ashutosh kumar added a comment -

        The method which I am invoking is this :
        public void setStatus(Requests requests)

        is it happening because this method has void return type.

        The error stack trace is as follows:
        org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0
        org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0
        at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
        at org.codehaus.xfire.client.Client.onReceive(Client.java:410)
        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:79)
        at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
        at org.codehaus.xfire.client.Client.invoke(Client.java:336)
        at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
        at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
        at $Proxy65.setStatus(Unknown Source)
        at com.service.IntegrationServiceTest.testSetStatusWithHardCodedValues(ntegrationServiceTest.java:90)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
        Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.LinkedList.entry(LinkedList.java:368)
        at java.util.LinkedList.get(LinkedList.java:313)
        at java.util.Collections$UnmodifiableList.get(Collections.java:1155)
        at org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding.java:187)
        at org.codehaus.xfire.service.binding.DocumentBinding.readMessage(DocumentBinding.java:35)
        at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
        at org.codehaus.xfire.client.Client.onReceive(Client.java:406)
        ... 28 more

        The generated SOAP message from the error stack If I send it through XML spy then soap message is ent succeefully but in my application I am getting this error.

        Since I am using third party web service I can't change the method signature. Can you suggest what are the changes I need to do in client code.

        Show
        ashutosh kumar added a comment - The method which I am invoking is this : public void setStatus(Requests requests) is it happening because this method has void return type. The error stack trace is as follows: org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0 org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0 at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89) at org.codehaus.xfire.client.Client.onReceive(Client.java:410) 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:79) at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114) at org.codehaus.xfire.client.Client.invoke(Client.java:336) at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77) at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57) at $Proxy65.setStatus(Unknown Source) at com.service.IntegrationServiceTest.testSetStatusWithHardCodedValues(ntegrationServiceTest.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.LinkedList.entry(LinkedList.java:368) at java.util.LinkedList.get(LinkedList.java:313) at java.util.Collections$UnmodifiableList.get(Collections.java:1155) at org.codehaus.xfire.service.binding.AbstractBinding.read(AbstractBinding.java:187) at org.codehaus.xfire.service.binding.DocumentBinding.readMessage(DocumentBinding.java:35) at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke(SoapBodyHandler.java:42) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131) at org.codehaus.xfire.client.Client.onReceive(Client.java:406) ... 28 more The generated SOAP message from the error stack If I send it through XML spy then soap message is ent succeefully but in my application I am getting this error. Since I am using third party web service I can't change the method signature. Can you suggest what are the changes I need to do in client code.
        Hide
        ashutosh kumar added a comment -

        I am adding further info to this :

        I have a WS which runs with AXIS 1.2.1. In WSDL the method which I am invoking is a void method . If I invoke this method thro' xFire client i get an Exception!!!

        Thats because Axis 1.2 send me not an empty SoapBody. The answer from Axis looks like:

        <soap:Envelope>
        <soap:Body>
        <dealComplianceStatusRequestsResponse/> --> methodName with Response which is HardCoded in Axis 1.2
        </soap:Body>
        </soap:Envelope>

        And the Client from xfire expects the following Response:

        <soap:Envelope>
        <soap:Body>
        </soap:Body>
        </soap:Envelope>

        How can i solve this Problem? Excpetion is being thrown org.codehaus.xfire.service.binding.AbstractBinding class, read method.

        Show
        ashutosh kumar added a comment - I am adding further info to this : I have a WS which runs with AXIS 1.2.1. In WSDL the method which I am invoking is a void method . If I invoke this method thro' xFire client i get an Exception!!! Thats because Axis 1.2 send me not an empty SoapBody. The answer from Axis looks like: <soap:Envelope> <soap:Body> <dealComplianceStatusRequestsResponse/> --> methodName with Response which is HardCoded in Axis 1.2 </soap:Body> </soap:Envelope> And the Client from xfire expects the following Response: <soap:Envelope> <soap:Body> </soap:Body> </soap:Envelope> How can i solve this Problem? Excpetion is being thrown org.codehaus.xfire.service.binding.AbstractBinding class, read method.

          People

          • Assignee:
            Dan Diephouse
            Reporter:
            ashutosh kumar
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: