2017-12-01 21 views
0

jsonをserviceBeanのGET呼び出しに渡すことができません。パス情報についてDomino RESTサービス - GETコールからパラメータを取得できません

<xe:restService id="restService1" pathInfo="getaccount"> 
    <xe:this.service> 
    <xe:customRestService requestContentType="application/json" serviceBean="web.service.GetAccount" contentType="application/json"/> 
    </xe:this.service> 
    </xe:restService> 

Iは、パス情報が= "getaccount {ID}"

serviceBean = "getaccount"、パス情報= "getaccount/{ID}" パス情報を試みた:

public class GetAccount extends CustomServiceBean { 

     @Override 
     public void renderService(CustomService service, RestServiceEngine engine) throws ServiceException { 

      XspOpenLogUtil.logEvent(null, "getAccount()", Level.INFO, null); 

      Map parameters = engine.getHttpRequest().getParameterMap(); 
      XspOpenLogUtil.logEvent(null, "getAccount() - getHttpRequest().getParameterMap(): " + parameters.toString(), Level.INFO, null); 

      String json_string = IOUtils.toString(engine.getHttpRequest().getInputStream(), "UTF-8"); 
      XspOpenLogUtil.logEvent(null, "getAccount() - jsonReaderString: " + json_string, Level.INFO, null); } 

私はPOSTに変更する場合、私はjson_stringを得ることができますが、私はGETを実行するとIEでいくつかのJSONを送信することができるはずです{「ID」:「1234」}

APIなどのリソースをSOAPUIを使用します。 xsp/getaccount {id}とパラメータN ame = idおよびValue = 1234

ありがとう、 Scott。

答えて

0

私はそれを理解しました。 engine.getHttpRequest().getRequestURI()を使用すると、URIが渡されます。 api.nsf/api.xsp/getaccount/Bob.Smith%40mail.com。 URLDecodeを実行してエンコードをクリーンアップします。

これは、この問題を解決するのに役立ちます。

Scott。

関連する問題