[akabana-user:126] Re: S2Flex2Serviceのoperation属性が有効じゃない?

jun funakura [E-MAIL ADDRESS DELETED]
2007年 6月 2日 (土) 02:21:46 JST


ふなくら(nod)です。
こんばんは。

返信が遅くなりました。<m(__)m>

> S2Flex2Serviceのoperation属性を使って、
> 以下のように呼び出すJava側のServiceメソッドを
> 指定したいとします。
> 例えばFlex側ではupdateですが、Service側はdoUpdateというようにです。

これまで上記のような利用方法を想定していませんでした。
でもニーズがあるとのことのなので、修正いたしました。
次のリリースに反映するようにいたします。

flex2も2.0.1Hotfix2になったので、s2flex2-componentsも2.0.1hotfix2で
コンパイルしてリリースする予定です。

#また、s2flex2本体も、データ変換や引数まわりで一部変更した
#1.1を近いうちリリースする予定です。

--
ふなくら

07/05/28 に Shinpei Ohtani<[E-MAIL ADDRESS DELETED]> さんは書きました:
> 大谷です。
>
> Dolteng 0.19.0で吐き出したS2Flex2のサンプルで
> 色々と試しています。
>
> S2Flex2Serviceのoperation属性を使って、
> 以下のように呼び出すJava側のServiceメソッドを
> 指定したいとします。
> 例えばFlex側ではupdateですが、Service側はdoUpdateというようにです。
>
> //config() はcreationCompleteで呼ばれる
> public function config():void
> {
>   service.operations["update"] = new RpcOperation(service, "doUpdate");
>   service.operations["remove"] = new RpcOperation(service, "doRemove");
> }
>
> <seasar:S2Flex2Service id="service" destination="emp_empService"
> showBusyCursor="true" />
>
>
> Serviceクラス側も下記のようになります。
>
> public interface EmpService {
>
>         public Emp[] selectAll();
>
>         public Emp selectById(Integer id);
>
>         public void insert(Emp emp);
> //以下をupdate, removeから、doUpdate, doRemoveに変更
>         public int doUpdate(Emp emp);
>
>         public void doRemove(Integer id);
>
> }
>
> とすると、意図する呼び出しがされる前にエラーで
> 落ちてしまいます。
> Service側にわたったエラーを見ると、operationsに設定した連想配列をみていないで
> Flex側の設定メソッドでService側がcallされているようです。
> 例えばFlex側がremoveだと、Service側のdoRemoveが呼ばれて欲しいのに
> 実際にはremoveが呼ばれており、そのようなメソッドが無いと言われています。
>
> サーバ側のエラーは下記のような感じです。
> Serviceのremoveを呼ぼうとしています。
>
> ERROR 2007-05-28 16:50:50,671 [http-8080-Processor25]
> [ESSR0049]examples.web.emp.impl.EmpServiceImpl$$EnhancedByS2AOP$$9fa2fbに適用可能なメソッド(remove())が見つかりません
> org.seasar.framework.beans.MethodNotFoundRuntimeException:
> [ESSR0049]examples.web.emp.impl.EmpServiceImpl$$EnhancedByS2AOP$$9fa2fbに適用可能なメソッド(remove())が見つかりません
>         at org.seasar.framework.beans.impl.BeanDescImpl.getMethods(BeanDescImpl.java:281)
>         at org.seasar.flex2.rpc.remoting.service.impl.AbstractRemotingServiceInvokerImpl.checkMethodArgumentsValidation(AbstractRemotingServiceInvokerImpl.java:113)
>         at org.seasar.flex2.rpc.remoting.service.impl.AbstractRemotingServiceInvokerImpl.invoke(AbstractRemotingServiceInvokerImpl.java:52)
>         at org.seasar.flex2.rpc.remoting.message.processor.impl.MessageBodyProcessorImpl.processBody(MessageBodyProcessorImpl.java:99)
>         at org.seasar.flex2.rpc.remoting.message.processor.impl.MessageBodyProcessorImpl.process(MessageBodyProcessorImpl.java:65)
>         at org.seasar.flex2.rpc.remoting.message.processor.impl.MessageProcessorImpl.requestProcess(MessageProcessorImpl.java:76)
>         at org.seasar.flex2.rpc.remoting.message.processor.impl.MessageProcessorImpl.process(MessageProcessorImpl.java:65)
>         at org.seasar.flex2.rpc.remoting.processor.impl.RemotingMessageProcessorImpl.process(RemotingMessageProcessorImpl.java:49)
>         at org.seasar.flex2.rpc.remoting.RemotingGateway.doPost(RemotingGateway.java:66)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> (以下略)
>
> 少しだけS2Flex2を追った限りだと、S2Flex2Service.callPropertyで
> operationsの連想配列の結果を一回見たうえで
> remoteCall.applyするべきではないでしょうか?
>
> 下記のようになります。
>
>         flash_proxy override function callProperty(methodName:*, ...args):*{
>                 var o:RpcOperation = getProperty(methodName);
>                 if(o) {
>                 args.unshift(o.name);
>                 }
>                 else
>                 {
>                 args.unshift(methodName);
>                 }
>              return remoteCall.apply(null,args);
>         }
>
>
> 全然あさっての方向見ていたらすいません。
> 宜しくお願いします。
>
> --
> =============================
> Shinpei Ohtani
> [E-MAIL ADDRESS DELETED]
> =============================
> _______________________________________________
> akabana-user mailing list
> [E-MAIL ADDRESS DELETED]
> https://ml.seasar.org/mailman/listinfo/akabana-user
>


akabana-user メーリングリストの案内