Ticket #10256

[Known Issue] service function can't return faultcode
Date d'ouverture: 2007-04-06 17:02 Dernière mise à jour: 2007-04-30 13:06

Rapporteur:
Propriétaire:
État:
Atteints
Composant:
(Aucun)
Jalon:
(Aucun)
Priorité:
4
Sévérité:
5 - moyen
Résolution:
Later
Fichier:
2

Détails

/modules/legacy/lib/ShadeSoap/NusoapServer.class.php
L120 - 127

ShadeSoap_NusoapServer::invoke_method()
で対応する service 関数を読んだ後に

if (is_array($retValue)) {
 $retValue = $this->_encodeUTF8($retValue, $root-
>mLanguageManager);
}
else {
 $retValue = $root->mLanguageManager->encodeUTF8
($retValue);
}

と encode 処理をかけちゃうために soap_fault くらすを返
しても文字列に変換されちゃうため期待する反応が返ってこ
ないです

if(is_object($retValue) && get_class($retValue)
== 'soap_fault')
{
$retValue->faultcode = $root->mLanguageManager-
>encodeUTF8($retValue->faultcode);
$retValue->faultactor = $root->mLanguageManager-
>encodeUTF8($retValue->faultactor);
$retValue->faultstring = $root->mLanguageManager-
>encodeUTF8($retValue->faultstring);
$retValue->faultdetail = $root->mLanguageManager-
>encodeUTF8($retValue->faultdetail);
}

こんなかんじの処理を追加すればだいじょーぶかなぁ?

あとこれはばぐなのか仕様なのかびみょーだけど,service
関数の引数が内部 encoding に変換されず UTF のまま飛んで
きてるみたいです

Ticket History (3/12 Histories)

2007-04-09 13:56 Updated by: minahito
Commentaire
Logged In: YES
user_id=8353

[EN]
Sub-class of virtual service doesn't need to return
soap_fault object. (A virtual service doesn't depend on the
specific way)

The virtual service will not be completed in 0.9.

[JA]
仮想サービスのサブクラスは soap_fault オブジェクトを返す前提
に立っていない(というか、仮想サービスの実装側は特定の経路に
依存してはいけない)ので...後で(相当後日に)ちょっと検証し
てみますね。0.9は、仮想サービスは未完のままいくと思います。
2007-04-09 15:00 Updated by: mumincacao
Commentaire
Logged In: YES
user_id=24376

こーど読んでてなんとなくそんな感じはしてたけどやっぱり
XCube_Object か XCube_ObjectArray を継承したのしか返せないで
すか(´・ω・`;【壁
唯一見つけた XCube_Service のさんぷるとして
Legacy_SearchService 見てたら array で返してたから特に縛りは
ないってことにしてました
それなら XCube_Object を継承した例外処理用のをつく・・・って
それだと定義してある戻り値と型が変わっちゃうし・・・

とりあえずえらーの時は null や -9999 を返すみたいなおやくそ
くで回避かなぁ?
2007-04-10 12:27 Updated by: minahito
Commentaire
Logged In: YES
user_id=8353

XCube_Service may have to define the specific Exeption
class. And, SOAP may convert it to soap_fault when it is
outer service. But, it needs some time to consider it.

[JA]
XCube_Service が専用の例外クラスを持ち、 SOAP アダプタが外部
サービス時のみ soap_fault なりにコンバートすればいいかもしれ
ません。いずれにせよ、ちょっと時間が欲しいところです。
2007-04-10 12:54 Updated by: minahito
  • Résolution Update from Aucun to Accepted
2007-04-10 12:54 Updated by: minahito
  • Propriétaire Update from (Aucun) to minahito
  • Priorité Update from 5 - moyen to 4
Commentaire
Logged In: YES
user_id=8353

This is our 'homework' for Cube 1.0. In Legacy 2.1, this is
'Known Issue'.
2007-04-10 12:56 Updated by: minahito
Commentaire
Logged In: YES
user_id=8353

If you have to use XCube_Service, do define {Your}_Service
as sub-class of XCube_Service to get your goal.

[JA]
もし近いうちに XCube_Service を使わなければまずいのであれ
ば、 {なんちゃら}_Service を XCube_Service のサブクラスとし
て定義してしのいでください。m(__)m
2007-04-12 20:33 Updated by: mumincacao
Commentaire
Logged In: YES
user_id=24376

勢いで創っちゃったので置いときますです 【なんちゃらさー
ば】ヾ(´・ω・`;【壁


変更点としては

引数を XCube_Root::mContext::mRequest にまっぴんぐ
→内部 service とおんなじ方法で取得できるように
→ついでに UTF を内部こーどに変換

戻り値をかなり変更
→基本は XCube_Object のさぶくらす
XCube_ObjectArray は値を保持できる構造じゃないみたいなので
通常の配列で
正常に処理できなかったときは Temporary_Exception を投げる

global function や static method 用の処理は見なかったことに
→XCube_Service が出力する WSDL では出ない気がするので

こんなかんじにしてありますです
っていうか途中からかなりうにになってたのであとは赤ぺんせんせ
おねがいしますです
2007-04-12 20:33 Updated by: mumincacao
  • File 1821: soap.tgz is attached
2007-04-13 11:23 Updated by: mumincacao
Commentaire
Logged In: YES
user_id=24376

php5 で動かなかったからほんとにちょっとだけ修正しましたです
 【なんちゃらさーば】ヾ(´・ω・`;【壁

って思いっきり投げっぱなしてたけど,使い方は解凍してできた
preload の中身をそのまま
{XOOPS_ROOT_PATH}/preload
に投げ込んでもらえれば動くと思いますです
基本的に ShadeSoap_NusoapServer を置き換えるだけなので
Service 側は戻り値以外変更なしでいける・・・かなぁ?
2007-04-13 11:23 Updated by: mumincacao
  • File 1822: soap.tgz is attached
2007-04-25 19:10 Updated by: minahito
  • Summary Updated
Commentaire
Logged In: YES
user_id=8353

This task is Cube 1.0.
2007-04-30 13:06 Updated by: (del#8225)
  • Ticket Close date is changed to 2007-04-30 13:06
  • Résolution Update from Accepted to Later
  • État Update from Ouvert to Atteints
Commentaire
Logged In: YES
user_id=8225

This issue is moved to sf.net
[ 1709862 ] <sf.jp> service function can't return faultcode
http://sourceforge.net/tracker/index.php?func=detail&aid=1709862&group_id=159211&atid=943471

Attachment File List

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion