2017-05-11 8 views
0

私はIBM NotesにJava Webプロバイダを持っています。 私はAgentBaseから派生経て、現在は、NotesSessionにアクセスしよう:SOAP UIのテスト中IBM Notes Web-Providerでの現在のセッションへのアクセス

import lotus.domino.AgentBase; 
import lotus.domino.Session; 
import lotus.domino.AgentContext; 
import lotus.domino.Database; 
import lotus.domino.NotesException; 
import lotus.domino.Document; 

public class HwProvider extends AgentBase{ 
    public String createOrder (String subject, String fio){ 
     try { 
      Session session = getSession(); 
      AgentContext agentContext = session.getAgentContext(); 
      Database database = agentContext.getCurrentDatabase(); 

      return subject + " " + fio; 
     }catch (Exception e) { 
      return e.toString(); 
     } 
    } 
} 

私はこのエラーが表示されます。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <soapenv:Body> 
     <createOrderReturn xmlns="urn:DefaultNamespace">java.lang.NullPointerException</createOrderReturn> 
    </soapenv:Body> 
</soapenv:Envelope> 

私は現在のセッションにアクセスすることができますどのように?

答えて

1

WSプロバイダの内部では、AgentBaseを参照する必要はありません。現在のセッションを取得するにはSession s = WebServiceBase.getCurrentSession();に頼ることができます。

関連する問題