1 5 6 package org.exoplatform.portlets.wsrp; 7 8 9 import javax.xml.rpc.ServiceException ; 10 import org.exoplatform.container.PortalContainer; 11 import org.exoplatform.services.wsrp.consumer.templates.InitCookieTemplate; 12 import org.exoplatform.services.wsrp.intf.WSRP_v1_Markup_PortType; 13 import org.exoplatform.services.wsrp.wsdl.WSRPService; 14 import org.exoplatform.services.wsrp.wsdl.WSRPServiceLocator; 15 import java.net.URL ; 16 import java.net.MalformedURLException ; 17 18 23 public class InitCookieImpl extends InitCookieTemplate{ 24 private WSRPService service; 25 private String markupInterfaceURL; 26 private WSRP_v1_Markup_PortType markupInterface; 27 28 public InitCookieImpl(String markupInterfaceURL) { 29 service = (WSRPService)(PortalContainer.getInstance(). 30 getComponentInstanceOfType(WSRPService.class)); 31 ((WSRPServiceLocator)service).setMaintainSession(true); 32 this.markupInterfaceURL = markupInterfaceURL; 33 try { 34 this.markupInterface = service.getWSRPBaseService(new URL (markupInterfaceURL)); 35 } catch (ServiceException e) { 36 e.printStackTrace(); 37 } catch (MalformedURLException e) { 38 e.printStackTrace(); 39 } 40 } 41 42 public String getMarkupInterfaceURL() { 43 return markupInterfaceURL; 44 } 45 46 public WSRP_v1_Markup_PortType getWSRPBaseService() { 47 return markupInterface; 48 } 49 50 public void setWSRPBaseService(WSRP_v1_Markup_PortType markupPortType) { 51 this.markupInterface = markupPortType; 52 } 53 } 54 | Popular Tags |