Looking for software experts?
Need an expert advice on software development? Need consulting work done in time and at high standards? Tremend has the right solution for you.

We can provide expertise in:
  •    » high traffic and complex content website infrastructures using Java, PHP or .NET. More here ...
  •    » mobile applications for iPhone, Android or J2ME. More here ...

For an enquiry, send an email to contact [at] tremend [dot] ro.

Cryptic fault when trying to call an XFire SOAP service using a SOAP client generated with Axis

January 22nd, 2007 by spostelnicu in Java, General

I encountered a problem when trying to call an XFire SOAP service using a SOAP client generated with Axis, and after finding the “solution” I decided to share it with you so you won’t have to repeat my steps.

I’ll be short:

When trying to call an XFire SOAP service using a SOAP client generated with Axis, I get the following (very cryptic) fault:

Index: 1, Size: 1
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: Index: 1, Size: 1
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Index: 1, Size: 1

This is generated by an internal IndexArrayOutOfBoundsException (which I couldn’t determine only after step-by-step debugging through the XFire sources), at line 191 in org.codehaus.xfire.service.binding.AbstractBinding (xfire-distribution-1.2.4-sources.jar):

p = (MessagePartInfo) opInfo.getInputMessage().getMessageParts().get(param);

Basically, the parser is trying to get the next xml element in the request, which doesn’t exist.

When examining the SOAP message, I found this:

<soapenv:Body>
<ns1:myMethod soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="urn:MyNamespace">
<in0 href="#id0" />
</ns1:myMethod>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
........

So it seems that the request is using RPC encoding, which unfortunately XFire doesn't support.

In conclusion: do not access a service published with XFire with a client generated by Axis, unless you change the default request encoding style from RPC/Encoded to WRAPPED/Literal.

technorati tags:, , , ,

DZoneGoogle ReaderYahoo MessengerRedditEmailDelicious

Related posts

  • My experience with web services with Spring, Axis, XFire
    First thing to note is that, this being my first contact with web services (SOAP and WSDL), it took me quite a lot of time (almost five working days) to learn about the technologies involved and try to...
  • DynDNS blocks updates – from updatedd older than 2.4
    If your home router has a Dynamic DNS feature and it suddenly does not work anymore with DynDNS... don't despair. The guys at DynDNS have decided to discontinue service to older clients. You can read the...
  • FLEX – live scroll datagrid
    A nice feature on search engines would be a live scroll, so right before you get to the end of the current page the next page is automatically loaded. I've played a bit with Adobe Flex SDK and implemented...
  • Migrate Lucene annotations 3.2.1GA to Hibernate Search 3.0.0.Beta1: object removal
    Changes in Hibernate Search are quite frequent, as it is in continued development. Today I found myself looking into a problem generated by migration from Hibernate-Lucene integration in 3.2.1.GA to the...
  • Perforce Windows shell integration
    I'm happy again. Perforce shell integration used to make my machine hang on every file browse operation. As we are working with a remote Perforce server we've set up a Perforce proxy so we do not hit the...
.

One Response

  1. Tremend Tech Blog » My experience with web services with Spring, Axis, XFire Says:

    [...] One big problem that I had was that at first I tried to access the XFire service with the Axis client that I already have. Big mistake! After half a day of stepping through the XFire code, I discovered that the problem was that my client was sending a request as RPC/encoded, which XFire does not support. And instead of telling me that, XFire was simply returning a fault with the internal exception message, which was: “ Index: 1, Size: 1 “. [...]

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.