cancel
Showing results for 
Search instead for 
Did you mean: 

How get Portal Services in EJB (Web Service)

Former Member
0 Kudos
61

Hi,

i want to use a Web Service to create a new folder in my KM-Content. But if i test my Web Service with the Web Service Navigator the WS doesn't create a new folder. If i take a Portal Application Project (PAP) with the same piece of code it works well.

I think i need to access to <b>Portal Services</b>. How can i do that programatically?

myCode:


	IUser user = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
	ResourceContext rContext = new ResourceContext(user);
	RID aRid = RID.getRID("/documents/Testordner");
	IResourceFactory resourceFactory = ResourceFactory.getInstance();
	ICollection aCollection =
		(ICollection) resourceFactory.getResource(aRid, rContext);

	if (aCollection != null) {
		IResource resource =
			aCollection.createResource("NewFolder_4_You", null, null);
	}

regards,

Sharam

Message was edited by:

Sharam Pourmir

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

You can access the KM API from inside your EJB. For this you just need reference to sap KM in application-j2ee-engine of EAR.

Check this for more:

https://forums.sdn.sap.com/thread.jspa?threadID=98041

https://forums.sdn.sap.com/thread.jspa?threadID=338383

Greetings,

Praveen Gudapati

[Points are welcome for helpful answers]

Former Member
0 Kudos

Hi Praveen,

thank you very much. My problem is solved, i will asign you 10 points.

regards,

Sharam

Answers (1)

Answers (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

In ur appl other than portal appl, if u want to use portal services, u can add sharing reference in the references in the project properties. If it works in portal application, then add the project as sharing reference to your EJB project and try.

Regards,

Vijai

Former Member
0 Kudos

Hi Vijai,

in my EBJ or EAR properties are no options to set sharing references. Are there other possibilities for EJBs? Can i do it programmatically?

The other option for me is to use a Portal Application Project as a Web Service with an appropriate wsdl file. Is this possible? When yes, i could call the PAP from my external program.

regards,

Sharam

Message was edited by:

Sharam Pourmir

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Check if Project references work. Right click EJB project. Choose Project references -> Choose the portal appl project and click ok.

Regards,

Vijai