cancel
Showing results for 
Search instead for 
Did you mean: 

WSDL - Eclipse and SAP Portal

Former Member
0 Kudos

I have a problem that I have been

fighting for a couple of days. I have a j2ee app

deployed on WebSphere App Server and a an EJB from that APP is exposed as a Web Service via

WSDL. I am developing a Portal Client using SAP

Portal. I was able to generate the Portal Service and send a request successfully and I see

the debug messages in my WAS log but the portal

client does not get it.

Accepted Solutions (0)

Answers (1)

Answers (1)

MichaelSambeth
Advisor
Advisor
0 Kudos

Kiran,

If you create a portal web services client from WSDL you only get the service but no user interface. So please create a simple user interface (e.g. HTMLB JSP page) which calls the service and displays the result.

Below you find an example of a SAP Enterprise Portal Web services client accessing a SOAP Web Service on Lotus Domino Server.

(1) PortalApp.xml (generated)

<services>

<service alias="com.sap.consulting.domino.soap.SapSoapNotesService" name="SapSoapNotesService">

<service-config>

<property name="className" value="com.sap.consulting.domino.soap.SapSoapNotesService">

</property>

<property name="startup" value="false">

</property>

<property name="SecurityZone" value="com.sap.consulting.domino.soap.SapSoapNotesService/DefaultSecurity">

</property>

<property name="WebEnable" value="false">

</property>

<property name="WebProxy" value="true">

</property>

</service-config>

<service-profile>

<property name="SystemAlias" value="Default_System_Alias">

</property>

</service-profile>

</service>

</services>

(2) UI that calls that service (authentication with LtpaToken) and renders a Notes Document that was retrieved via DXL

public void onViewDocumentList(Event event) throws PageException {

// get the current request object

IPortalComponentRequest componentRequest = (IPortalComponentRequest) this.getRequest();

IPortalComponentSession componentSession = componentRequest.getComponentSession();

HttpServletRequest req = (HttpServletRequest) componentRequest.getServletRequest();

// get the notes view name entered by the user

InputField idField = (InputField) getComponentByName("view_name");

String viewName = idField.getValueAsDataType().toString();

// place a new tableBean in the Session to reset the old results and store the new

tableBean = new TableBean();

componentSession.putValue("tableBean", tableBean);

// create vectors to fill the table later on

Vector data = new Vector();

Vector colName = new Vector();

colName.addElement("Replica ID");

colName.addElement("Universal Id");

colName.addElement("Status");

colName.addElement("Created by");

colName.addElement("Agent");

colName.addElement("Category");

colName.addElement("Subject");

colName.addElement("Content");

// get the documents from Notes via DXL

try {

IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();

IService aService = runtimeResources.getService("com.sap.consulting.domino.soap.SapSoapNotesService");

SapSoapNotesService myService = (SapSoapNotesService) aService;

// add the existing cookies and esp the LTPA token for authentication to the soap request

Cookie cookies[] = req.getCookies();

if (cookies != null) {

for (int i = 0; i < cookies.length; i++) {

myService.addCookieInSOAPRequest(cookies<i>);

}

}

// get all documents

String documents = myService.NotesView(viewName);

if (documents == null) {

documents = "[No Document]";

}

if ("[No Document]".equals(documents)) {

// siganlize error and put error message in request

req.setAttribute("error", "true");

req.setAttribute("errorMsg", "Could not find any documents!");

} else if ("[Access Denied]".equals(documents)) {

// siganlize error and put error message in request

req.setAttribute("error", "true");

req.setAttribute("errorMsg", "You are not allowed to view documents");

} else {

StringTokenizer alldocTokenizer = new StringTokenizer(documents, ";");

while (alldocTokenizer.hasMoreTokens()) {

String documentId = alldocTokenizer.nextToken().trim();

// add the existing cookies and esp the ltpa token to the soap request

if (cookies != null) {

for (int i = 0; i < cookies.length; i++) {

myService.addCookieInSOAPRequest(cookies<i>);

}

}

// get all fields of the docuemnt with the current docId

String document_dxl = myService.NotesDocumentContent(documentId);

LOCATION.debugT(document_dxl);

// fill the table vector with all fields

Vector docDetailsVec = parseDxl(document_dxl);

data.addElement(docDetailsVec);

}

// create a hmtlb table model, fill it and store in the request

DefaultTableViewModel model = new DefaultTableViewModel(data, colName);

model.setKeyColumn(1);

tableBean.setModel(model);

req.setAttribute("viewDocumentList", "true");

}

} catch (Exception ex) {

LOCATION.debugT(ex.toString());

req.setAttribute("error", "true");

req.setAttribute("errorMsg", "The following exception was thrown: " + ex.getMessage());

}

}

Please also post your WSDL in this forum so that I can have a look at it.

Regards

Michael