XFire

CLONE -Multiple parameters are not recognized with dynamic client

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0, 1.1-beta-1
  • Fix Version/s: 1.1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

I created a simple POJO as my service

monspaced
public class TestService {
public String concat(String string1, String string2) { return string1 + string2; }
}
monspaced

and a corresponding services.xml
monspaced
<?xml version="1.0" encoding="ISO-8859-1"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>TestService</name>
<namespace>http://xfire.codehaus.org/TestService</namespace>
<serviceClass>TestService</serviceClass>
</service>
</beans>
monspaced

http://localhost:81/xfire/services/TestService?wsdl generates a valid wsdl

Then I tried to test my service with a dynamic client

monspaced
import java.net.MalformedURLException;
import java.net.URL;
import org.codehaus.xfire.client.Client;

public class TestServiceClient {
public static void main(String[] args) throws MalformedURLException, Exception {
Client client = new Client(new URL("http://localhost:81/xfire/services/TestService?wsdl"));
Object[] results = client.invoke("concat", new Object[] { "ABC", "123" });
System.out.println((String) results[0]);
}
}
monspaced

The response is 'ABCABC' not as I expected 'ABC123'

Activity

Hide
Guillaume ALLEON added a comment -

I did reopen this issue. The same problem still appear when the return type is void.

public class StringsServiceImpl implements StringsService {

public StringsServiceImpl() {
}

public String concat(String s1, String s2){ String result = new String(s1+s2); return result; }

public void foo(String line, String filename) {

try { FileWriter fw = new FileWriter(filename); fw.write(line); fw.flush(); fw.close(); } catch (Exception ex) {
}

}
}

concat is working - foo is throwing the following exception:

org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0
at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage (SoapFaultSerializer.java:28)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:108)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java :67)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
at org.codehaus.xfire.client.Client.onReceive(Client.java:436)

Show
Guillaume ALLEON added a comment - I did reopen this issue. The same problem still appear when the return type is void. public class StringsServiceImpl implements StringsService { public StringsServiceImpl() { } public String concat(String s1, String s2){ String result = new String(s1+s2); return result; } public void foo(String line, String filename) { try { FileWriter fw = new FileWriter(filename); fw.write(line); fw.flush(); fw.close(); } catch (Exception ex) { } } } concat is working - foo is throwing the following exception: org.codehaus.xfire.fault.XFireFault: Index: 0, Size: 0 at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31) at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage (SoapFaultSerializer.java:28) at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:108) at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java :67) at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98) at org.codehaus.xfire.client.Client.onReceive(Client.java:436)
Hide
Dan Diephouse added a comment -

Yeah, after rereading your email that makes sense. I'll get this fixed ASAP

Show
Dan Diephouse added a comment - Yeah, after rereading your email that makes sense. I'll get this fixed ASAP
Hide
Dan Diephouse added a comment -

I've deployed new snapshots in which this issue could be fixed. I added a unit test for the void case as well. Could you please test it and let me know if that fixes things? Thanks.

Show
Dan Diephouse added a comment - I've deployed new snapshots in which this issue could be fixed. I added a unit test for the void case as well. Could you please test it and let me know if that fixes things? Thanks.
Hide
Guillaume ALLEON added a comment -

Thanks dan, the problem is solved.
Guillaume

Show
Guillaume ALLEON added a comment - Thanks dan, the problem is solved. Guillaume

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: