Hi Sam and Mike,
I'm currently reviewing Soafaces but:
- I can't get it 100% to work;
- I couldnt find a soafaces related forum.
It could be my problem is related to the problem just described.
Because the object (string) returned by service doesn't seem to be
received by the client.
I created a normal gwt (1.5.2) client and added:
- jettizon
- soafaces-services-client
- soafaces-services-servlet-nomule
- xstream
- added lines to ...gwt.xml:
<source path="client"/>
<inherits name='org.soafaces.services.Services'/>
When running my app and invoking the service
'onUniversalClientSuccess' is triggered. So far so good, but the
string sended by server "You got it" isn't received.
The result object parameter of onUniversalClientSuccess is null, see
my code and log output below.
Any ideas / tips / additional examples ?
I get number of errors/warnings in my log:
[DEBUG] Rebinding org.soafaces.services.client.rpc.UniversalClientRPC
[DEBUG] Invoking <generate-with
class='com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator'/
>
[DEBUG] Generating client proxy for remote service interface
'org.soafaces.services.client.rpc.UniversalClientRPC'
[DEBUG] Analyzing
'org.soafaces.services.client.rpc.UniversalClientRPC' for serializable
types
[DEBUG] Analyzing methods:
[DEBUG] public abstract void dispatchAny(java.lang.String endpointURI,
org.soafaces.services.client.rpc.GenericDataWrapper payload,
java.util.Map<java.lang.String, java.io.Serializable> properties)
throws org.soafaces.services.client.rpc.UniversalClientRemoteException
[DEBUG] Parameter: org.soafaces.services.client.rpc.GenericDataWrapper
payload
[DEBUG] org.soafaces.services.client.rpc.GenericDataWrapper
[DEBUG] Verifying instantiability
[DEBUG] org.soafaces.services.client.rpc.GenericDataWrapper
[DEBUG] Analyzing the fields of type
'org.soafaces.services.client.rpc.GenericDataWrapper' that qualify for
serialization
[DEBUG] public java.io.Serializable _PojoSerial
[DEBUG] java.io.Serializable
[DEBUG] Verifying instantiability
[DEBUG] nl.telecats.web.gwt.common.model.ServiceEvent
[DEBUG] Analyzing the fields of type
'nl.telecats.web.gwt.common.model.ServiceEvent' that qualify for
serialization
....
[DEBUG] Analyzing the fields of type
'com.google.gwt.i18n.client.impl.ConstantMap' that qualify for
serialization
[WARN] Field 'private final
com.google.gwt.i18n.client.impl.ConstantMap.OrderedConstantSet<java.lang.String>
keys' will not be serialized because it is final
....
[DEBUG] com.extjs.gxt.ui.client.data.BaseListLoadResult<? extends
java.lang.Object>
[DEBUG] Checking parameters of
'com.extjs.gxt.ui.client.data.BaseListLoadResult<? extends
java.lang.Object>'
[DEBUG] Checking type argument 0 of type
'com.extjs.gxt.ui.client.data.BaseListLoadResult<Data>' because it is
exposed as an array with a maximum dimension of 1 in this type or one
of its subtypes
[DEBUG] java.lang.Object[]
[DEBUG] Analyzing component type:
[DEBUG] java.lang.Object
[WARN] In order to produce smaller client-side code, 'Object' is not
allowed; consider using a more specific type
...
[DEBUG] java.util.Vector<? extends java.lang.Object>
[WARN] Checking all subtypes of Object which qualify for serialization
[DEBUG] nl.telecats.web.gwt.client.mvc.helper.MVCViewInstanceHolder
[ERROR] Type
'nl.telecats.web.gwt.client.mvc.helper.MVCViewInstanceHolder' was not
serializable and has no concrete serializable subtypes
[DEBUG] com.extjs.gxt.ui.client.data.BeanModel
[DEBUG] Verifying instantiability
[DEBUG] com.extjs.gxt.ui.client.data.BeanModel
[DEBUG] Analyzing the fields of type
'com.extjs.gxt.ui.client.data.BeanModel' that qualify for
serialization
[DEBUG] protected java.lang.Object bean
[DEBUG] java.lang.Object
[WARN] In order to produce smaller client-side code, 'Object' is not
allowed; consider using a more specific type
Code I added to my app:
private static final String UNIVERSAL_CLIENT_SERVLET = "/
gwtMulePoc.Application4HostedBrowser/SOAFacesRPCServlet";
private UniversalClient _oClient;
private void testMule() {
String stEndpoint1 = "soafaces://
gwtMulePoc.services.HelloWorldService/helloThereEndpoint";
//Create the UniversalClient Async Callback
UniversalClientPOJOCallback oMulePOJOCallback = new
UniversalClientPOJOCallback() {
public void onUniversalClientSuccess(Object result) {
//Serivces returns a String
String returnVal = (String) result;
Info.display("Info","Wow this was a success! Return value: "
+ returnVal);
}
public void onFailure(Throwable ex) {
Info.display("Info","Error during UniversalClient call: " +
ex.getMessage());
}
};
//Simply use the UniversalClient send method to call remote
service
//This service endpoint takes not arguments and returns a String
getUniversalClient().send(stEndpoint1, oMulePOJOCallback);
}
private UniversalClient getUniversalClient() {
if(_oClient == null) {
_oClient = UniversalClientFactory.getInstance
().getUniversalClient(UNIVERSAL_CLIENT_SERVLET);
}
return _oClient;
}
package gwtMulePoc.services;
import org.soafaces.services.annotation.ServiceEndpoint;
public class HelloWorldService {
@ServiceEndpoint (name="helloThereEndpoint")
public String helloThere() {
return "You got it";
}
}
On Nov 6, 1:25 am, Sam Taha <
taha...@gmail.com> wrote:
> Hi Mike,
>
> I think I see the problem. In Hosted mode, java is evaluating the
> Object[] as instanceof Serializable since per java spec every java
> array implements Serializable interface. Production mode must be
> letting this slip by. So actually looks like an inconsistency between
> compiled javascript mode and java spec.
>
> I will verify, but the fix should be easy insoafacesto move the the