如何调用哪个都有一个唯一的“长”式的使用BlazeDS的论证方法?

我不能把它都有一个唯一的“长”类型,使用Adobe BlazeDS的论点的方法?

就这个。

[柔性]

var ro:RemoteObject = new RemoteObject(); ro.destination = "objectService"; ro["getById"].send(3107);

[考试]

public class ObjectServiceImpl implements ObjectService { public ObjectDomain getById(long id) { ・・・ } }

因此,在发生这个错误。

flex.messaging.MessageException: Cannot invoke method 'getById'. 3,107 arguments were sent but 1 were expected. at flex.messaging.util.MethodMatcher.methodNotFound(MethodMatcher.java:387) at flex.messaging.util.MethodMatcher.getMethod(MethodMatcher.java:172) at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:417) at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183) at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400) at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005) at flex.messaging.endpoints.AbstractEndpoint$$FastClassByCGLIB$$1a3ef066.invoke(<generated>) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:688) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.flex.core.MessageInterceptionAdvice.invoke(MessageInterceptionAdvice.java:66) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:124) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:572) at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$49c0058b.serviceMessage(<generated>) at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103) at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158) at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44) at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67) at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166) at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291) at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$49c0058b.service(<generated>) at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:101) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:595)

[环境]·BlazeDS的4.0·春BlazeDS集成1.0.3·春·3.0.5的Tomcat 5.0·Java 5.0中的Flex·4.6

请告诉我任何解决方案..

--------------解决方案-------------

尝试以下方法:

//The way you defined the RemoteObject
var ro:RemoteObject = new RemoteObject();
ro.destination = "objectService";

//The id variable
var id:Number = 3107;
//The Operation to send over the RemoteBoject
var getByIdOperation:Operation = new Operation();
//Name of the method on the server side
getByIdOperation.name = "getById";
//The argument in this case the long 3107 ( var id:Number= 3107)
getByIdOperation.arguments = [id];
//The method to handle the result if needed
getByIdOperation.addEventListener(ResultEvent.RESULT, getByIdHandler)
//Send the operation through the RemoteObject(ro)
ro.operations = [getByIdOperation];
getByIdOperation.send();

java.lang中的是在ActionScript 3表示为编号 。 当远程调用临危结果为例方法调用

private function getByIdHandler(event:ResultEvent):void
{
myObject = event.result as ObjectDomain;
}

分类:柔性 时间:2015-03-15 人气:2
分享到:

相关文章

Copyright (C) 55228885.com, All Rights Reserved.

55228885 版权所有 京ICP备15002868号

processed in 0.445 (s). 10 q(s)