Call portal service from page or iview
Hello All,
I have an portal applction(PAR) which is returning a value suppose 'X'.
Now my requirement is to call this portal service from page.
How may i do this?
Regards.
Punit
Edited by: Punit Singh on Feb 25, 2011 9:30 PM
Hi
You can call the IPortalService API as in this [thread|how to call a portal service;
Regards
johann
Similar Messages
-
Calling portal service from web service
Hello,
I'm trying to call portal service from web service. Is this possible? I'm getting an error.
For example, code:
IJCOClientService clientService = (IJCOClientService) PortalRuntime.getRuntimeResources().getService(IJCOClientService.KEY);
.. is generating exception:
java.lang.LinkageError: Class com/sapportals/portal/prt/runtime/IPortalRuntimeResources violates loader constraints
Do anybody knows what's wrong?
Best regards,
Josef MotlHi Josef,
Is the IJCOClientService located on the producer side or on the consumer side?
Amit -
Can i call portal service from a j2ee application?
Hi Experts,
Can i call portal service from a j2ee application?
If yes then how?
If no then is there any other way to achieve the same?
I m reffering this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/42/9ddd0cbb211d72e10000000a1553f6/content.htm
but not getting any help
Please help me out.Hi,
Can you check this link?
http://help.sap.com/saphelp_nw04s/helpdata/en/82/6a0e7bbe744276bf393654b9b576ed/content.htm
Regards
Srinivasan T -
Unable to call Internet Service from EP IAC iview
Hi.
I'm trying to call a r/3 transaction with ITS from portal iview. I wan't to hide menu and toolbar, so I've created an Internet Service in SICF/SE80 with several parameters (webgui_simple_toolbar, ...). The service is activated and published. When I run it, Internet Explorer send me a 403 error.
I've tried to create an iac iview and links the service to it, but system return same problem.
ITS is ok, because I can run r/3 transaction from EP whithout any problem.
Any idea?
Thanks a lot!Hi Edgar.
Service doesn't run from R/3 system. I've used ITS parameters "TRANSACTION", "WEBGUI", "WEBGUI_SIMPLE_TOOLBAR" and "GENERATEDYNPRO".
R/3 can't run the service and give a 403 error.
Service is actived and published, using SICF and SE80 transactions. Finally, I've run SIAC_PUBLISH_ALL_INTERNAL and all is good.
When service runs on R/3 system, I will build IAC iView on EP.
Any idea?
Thanks a lot.
Regards -
How to call a portal service from a servlet
Hello all.
I have a functioning portal service that I would like to call from a servlet.
When I try to do so, I get a ClassCastException when I do this (on line two):
IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();
IDocumentPersistence docPer = (IDocumentPersistence) runtimeResources.getService(IDocumentPersistence.KEY);
However if I do the following I can get a generic IService and use reflection to invoke the method (in the IDocumentPersistence interface) that I want to invoke:
IPortalRuntimeResources runtimeResources = PortalRuntime.getRuntimeResources();
com.sapportals.portal.prt.service.IService aService = (com.sapportals.portal.prt.service.IService) runtimeResources.getService(IDocumentPersistence.KEY);
There must be a better way to use portal services (hopefully like scenario one above) in servlets. In web dynpro you can use portal services and cast them to the correct type. What am I missing?Hi Kim,
how did you integrate the references to your Portal Service Interface into your web application?
You should do this using the references in your application-j2ee-engine.xml, did you do this? It might be a problem with the classloader otherwise.
The way you are calling portal services does work normally, however it is not the recommended way as it is documented in the SAP documentation.
Please check the SAP documentation on how to access a portal service from a j2ee app:
http://help.sap.com/saphelp_nw70/helpdata/EN/42/9ddd0cbb211d72e10000000a1553f6/frameset.htm
Best regards,
Stefan Brauneis -
Calling a Portal Service from within a Web Dynpro DC
Hello,
I am trying to call a Portal Service from within a Web Dynpro development component without sucess.
Can anyone give me some hints on the necessary steps in order to accomplish this task?
Thanks
DizHi Diz,
I tried doing the same thing by following the steps as mentioned by you. Just to re iterate,
1. Created a DC "Portal Application Standalone" project by the name myservice.
2. Created a portal service inside myservice by the ame AmitsService.
3. Exposed IAmitsService.class in the public part.
4 Build and deployed the DC on server and tested it through an abstract portal component and it worked FINE !!
Now..
5. Created anoter DC of type WebDynPro
6. Added SAP_JTECHS -> epbc.prtapi._api as a "Used DC" with dependency build time and runtime
7. Specified the sharing reference in the properties as PORTAL:sap.com/myservice
8. Tried to reference the service using the following code..
IAmitsService portalservice=(IAmitsService)WDPortalUtils.getServiceReference(IAmitsService.KEY);
9.Build and deployed the DC.
10. When I run the application I am getting the following error
Processing HTTP request to servlet [dispatcher] finished with error.
The error is: com.sap.engine.frame.core.load.SAPNoClassDefFoundError: com/sapportals/portal/prt/service/IService
Exception id: [000D6008418B005C0000002C00000D200004163CE6719E1D]
PLEASE ADVISE -
Call web service from portal/soap config .xml error
Hi all,
I am trying to call a web service from our portal. Setup is as follows:
-Generate proxy classes and deploy it as a portal service
I created this service using the wizard (Portal service from wsdl file client side) in NWDS.
-Portal component which uses the portal service.
When I try to run the application in the portal, I get the following exception:
java.lang.IllegalStateException: Error in soapconfig.xml: The method mail of com.sap.portal.prt.soap.proxy.Alias portal service is not found..
How can I solve this?
Her is my xml file:
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="SharingReference" value="com.sap.portal.runtime.application.soap"/>
</application-config>
<components>
<component name="callwebproxy">
<component-config>
<property name="ClassName" value="com.portal.erbS.callwebproxy"/>
</component-config>
<component-profile/>
</component>
<component name="org_opach">
<component-config>
<property name="ClassName" value="com.test.org_opach"/>
</component-config>
<component-profile/>
</component>
</components>
<services>
<service alias="com.sap.portal.prt.soap.proxy.Alias" name="ProxyClass">
<service-config>
<property name="className" value="com.sap.portal.wsdl.webservices.service.connector.ProxyClass">
</property>
<property name="startup" value="false"/>
<property name="WebEnable" value="false"/>
<property name="Webproxy" value="true"/>
<property name="SecurityZone" value="com.sap.portal.wsdl.webservices.service.connector/DefaultSecurity"/>
</service-config>
<service-profile>
<property name="SystemAlias" value="Default_system_Alias"/>
</service-profile>
</service>
</services>
</application>
rezaHi,
Check your soapconfig.xml
Your method should be defined there. If it's not there, then you're sure to get this error.
For every method (in Webservice) that you call from your Portal Service, you should have it defined here.
Remember, this is autogenerated.
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Portal WebService Configuration File.
-->
- <!-- Note: File generated automaticaly, don't modify this file.
-->
- <portal-webservices version="6,0,3" application-name="TestWS">
- <portal-webservice name="com.company.mod.TestWS">
- <webservice-method soapaction="" authenticated="false" styleenconding="RPC" javasignature="public abstract byte[] com.company.mod.TestWS.getValue(java.lang.String)" name="getValue">
- <webservice-parameter defaultjavatype="java.lang.String" enconding="encoded" targetnamespace="http://www.w3.org/2001/XMLSchema" nillable="false" xmlattribute="false" required="true" ID="0" name="value">
<webservice-type wsdltype="xsd:string" javatype="java.lang.String" />
</webservice-method>
</portal-webservice>
</portal-webservices>
Regards,
JP -
Call Custom Service from Event Receiver as Current User
Hello,
i bang my head on this problem for days now:
My custom web service hosted in Sharepoint 2013 needs to know the logged on user name. I used to have a self-written impersonation in my service client before, but with switching to claims authentication this should be obsolete.
So within my service i decode the user from
IClaimsPrincipal icp = Thread.CurrentPrincipal as IClaimsPrincipal;
IClaimsIdentity ci = (IClaimsIdentity)icp.Identity;
String User = ci.ToString();
This works well when i call the service from a custom aspx page.
It utterly fails when i call the service from a List Item Event Receiver. The User always is the Application Pool Account.
This is the Client code to open the Channel:
private void SetChannelFactory(
MyServiceApplicationProxy proxy,
Uri address)
if (null == proxy)
throw new ArgumentNullException("proxy");
if (null == address)
throw new ArgumentNullException("address");
// Check for a cached channel factory
string endpointConfigurationName = GetEndpointConfigurationName(address);// Get the endpoint configuration name
if ((null == s_ChannelFactory) || (endpointConfigurationName != m_EndpointConfigurationName))
lock (s_ChannelFactoryLock)
if ((null == s_ChannelFactory) || (endpointConfigurationName != m_EndpointConfigurationName))
// Create a channel factory without specifying an endpoint address
// so it can be cached and used for multiple endpoint addresses
s_ChannelFactory = new ConfigurationChannelFactory<IMyServiceContract>(
endpointConfigurationName, proxy.Configuration, null);
// Configure the channel factory for claims-based authentication
s_ChannelFactory.ConfigureCredentials(SPServiceAuthenticationMode.Claims);
foreach (var operation in s_ChannelFactory.Endpoint.Contract.Operations)
DataContractSerializerOperationBehavior behavior = operation.Behaviors.Find<DataContractSerializerOperationBehavior>() as DataContractSerializerOperationBehavior;
if (behavior != null)
behavior.MaxItemsInObjectGraph = 2147483647;
// Store the current endpoint configuration name.
m_EndpointConfigurationName = endpointConfigurationName;
private IMyServiceContract GetChannel(
MyServiceApplicationProxy proxy,
Uri address)
//Create Channelfactory
SetChannelFactory(proxy, address);
// Create a channel from the channel factory.
return s_ChannelFactory.CreateChannelActingAsLoggedOnUser(new EndpointAddress(address));
All research pointed out that "CreateChannelActingAsLoggedOnUser" would pass the current user (which is correctly identified within the event receiver!) to the service, but it doesn't work for my event receiver...
Any advice on this would be great!
With kind regards,
JoachimYou should be able to get the current user id from the SPListItemEventProperties object. From here you should be able to create a Claim. For example get the user by using
user = SPWeb.Users.GetByID(properties.CurrentUserId)
SPClaim claim = SPClaimProviderManager.CreateUserClaim(user.email, SPOriginalIssuerType.TrustedProvider, issuerIdentifier);
https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.claims.spclaimprovidermanager.createuserclaim(v=office.14).aspx
Blog | SharePoint Field Notes Dev Tools |
SPFastDeploy | SPRemoteAPIExplorer -
Calling web service from Obiee
Hi,
I want to get data from webservice and show the results in a dashboard.
I checked http://www.artofbi.com/index.php/2009/08/consuming-a-web-service-in-obiee-presentation-services-using-jquery-cdn/ web site.
But the author is retrieving data from a web page by sending parameter to querystring like
yqlq=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22YHOO%22%2C%22AAPL%22%2C%22GOOG%22%2C%22MSFT%22%2C%20%22PTRY%22)&format=json&env=http%3A%2F%2Fdatatables.org%2Falltables.env&callback=?";
But as I know we can not call web services with parameters like this.
How can I call web service from BI?
Could you please suggest articles or sample codes, documents etc.
Regards,
byeHi,
I controlled this document. The document is explaining Oracle BI web services for extracting information from Oracle BI and showing them in other environments. But I want to get results from a web service ( for example a web service which returns currency rates, weather information or sharepoint lists) and then represent them in Oracle BI Dashboards. -
Calling Portal Service using result as Java Bean Model impossible?
Hello folks,
we try to achieve to call a portal service (working) which gives as a result a list of object of type com.foo.Report. We want to make use of this class as a model class, so we have the class as a model node in the context. The class itself is part of the service DC.
Unfortunately at run time it gives us a NoClassDefFound Exception of com.foo.Report.
As the com.foo.Report is part of the same DC as the service, it is no option to add the PAR public part to the used DCs of the WD DC because then there is this type conflict when we call the service (service look up). Or am I wrong and this is the way to do it? I mean I struggled quite a while to get the service look up right and needed to remove all the PAR/lib used DCs from the used DCs of the WD Project, when I got it working this Model error came up. I also tried to put the Model class in a separate DC but that caused the same error.
how is it possible to call a Portal service from WD and using it's return vale as a Model class
our system iis 7.0.17
best
StefanHi,
Refers the following docs..
EJBs in Web Dynpro Application Using Wrapper Class
Here Java Bean Model used in web dynpro.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00be903b-8551-2b10-c28a-8520400c6451
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
Accessing database table using EJB and web dynpro
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
Oracle Connectivity with EJB using WebDynpro Application
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/oracle%2bconnectivity%2bwith%2bejb%2busing%2bwebdynpro%2bapplication
Hope it will help u.
thanks
Abhilasha -
Calling portal service ?
Hi,
am trying to call a portal service from portal application.
2 scenarios:
SCENARIO 1:
componnent and the service in the same project.
in the KEY filed of ImyService. when I provide the value as Parfilename|servicename, it works
when i change the KEY field to name of the classfile, i.e. com.mycomp.myService [ implemention class of that interface], it doesnt work. throwing exception "could not instatiate the implementation class".
SCENARIO 2:
SERVICE and the usage component is in different projects and I provided the value of service to sharingreference in the portalapp.xml file
it doesnt work when the KEY is "Parfilename|servicename" or when it is set to the class file name, i.e. "com.mycomp.myService".
BTW, the portal service is started.
any ideas are highly appreciated.Hi Yogi,
The Steps below Describes how to call a Portal Service from a Portal Application.
<b>Add Sharing Reference Value in the Deployment Descriptor.</b>
<application-config>
<property name=SharingReference value=<ApplicationName or ApplicationAlias>/>
<property name=SharingReference value=com.sap.portal.navigation.api_service/>
</application-config>
<b>Add Libraries of the Portal Service (xxxapi.jar)</b>
<b>Write code to access the Portal Service</b>
Import Package of the Portal Service
Get Instance of the Portal Service
Call Methos of the Portal Service.
<b>Here is an Example:</b>
<b>PORTAL SERVICE</b>
/********************** Service Interface : IServiceOne.java ************************/
package com.abc.def;
import com.sapportals.portal.prt.service.IService;
public interface IServiceOne extends IService
public static final String KEY = "ServiceProject.ServiceOne";
//PARFilename.Servicename
public String display();
/**************** Service Source File : ServiceOne.java ***************************/
// Implement the display() Method
public String display() {
// TODO Auto-generated method stub
return "Welocme To My Service Project. Thank you for accessing my service.";
/*******************portalapp.xml*********************/
<application>
<application-config/>
<components/>
<services>
<service name="ServiceOne">
<service-config>
<property name="className" value="com.abc.def.ServiceOne"/>
</service-config>
</service>
</services>
</application>
<b>After Creating Your Service , Deploy it on the Server.</b>
<b>PORTAL APPLICATION</b>
package com.sample;
import com.abc.def.*;
import com.sapportals.portal.prt.component.*;
import com.sapportals.portal.prt.runtime.*;
public class AccessOne extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IServiceOne myService =(IServiceOne)PortalRuntime.getRuntimeResources().getService(IServiceOne.KEY);
String s = myService.display();
response.write(s);
/********************** Portalapp.xml ***********************/
<application>
<application-config>
<property name="SharingReference" value="ServiceProject"/>
</application-config>
<components>
<component name="AccessOne">
<component-config>
<property name="ClassName" value="com.sample.AccessOne"/>
</component-config>
<component-profile/>
</component>
</components>
<services/>
</application>
<b>Right Click on the Portal Application --->Properties -> Java Build Path-> click on Libraries Tab on the Top and Click Add External Jars Tab on the Right ---> Add Your Portal Service PAR File</b> .
Now Deploy the Application.<i></i><u></u><i></i>
Reward Points if u find this useful.
Regards,
Eben. -
Accessing portal service from abstract portal component
Hi
I have created a portal service where it contains getdata() and putdata(String) methods.
I have created a abstract portal component and trying to access the portal service from this component.
In portalapp.xml file of the portal component i have created the sharing reference and i have given the service name.
When i run the component it says service not found.
Please let me know if i have missed some things
Thanks and Regards
NagaKishoreHi Prakash
Sorry for the latereply.
find below the code for the interface
package com.sap.global;
import com.sapportals.portal.prt.service.IService;
public interface IGlobalContext extends IService
public static final String KEY = "IGlobalContext.GlobalContext";
public void putData(String strUserID,String strSessionID);
public String getData();
portalapp.xml file of the portal service.
<application>
<application-config/>
<components/>
<services>
<service name="GlobalContext">
<service-config>
<property name="className" value="com.sap.global.GlobalContext"/>
<property name="startup" value="true"/>
</service-config>
<service-profile>
<property name="Test" value="true"/>
</service-profile>
</service>
</services>
</application>
I am doing the following steps to access the portal service in the abstract portal component.
1. Add the portal service to the java build path of the abstract portal component.
2. do content method has the following code.
String userid ="",sessionid="";
response.write("Welcome");
try
IUserContext uc= request.getUser();
userid = uc.getLogonUid();
sessionid = request.getServletRequest().getSession().toString();
response.write("Iview "+userid);
IGlobalContext uid = (IGlobalContext)PortalRuntime.getRuntimeResources().getService(IGlobalContext.KEY);
uid.putData(userid,sessionid);
response.write(" Response from Service " + uid.getData());
}catch (Exception e)
response.write(e.toString());
3. portalapp.xml of abstract portal component
<application>
<application-config>
<property name="SharingReference" value="GlobalContext"/>
</application-config>
<components>
<component name="LandingPageComponent">
<component-config>
<property name="ClassName" value="com.satyam.landing.LandingPage"/>
</component-config>
<component-profile/>
</component>
</components>
<services/>
</application>
I am getting the following error.
Portal Runtime Error
An exception occurred while processing a request for :
iView : N/A
Component Name : N/A
Could not find portal application GlobalContext.
Exception id: 11:53_08/04/05_0095_1641450
See the details for the exception ID in the log file
Thanks in advance
Regards
NagaKishore -
hi developers,
I want to start a portal service from an ejb which runs on my portal server (this ejb is called from a r/3 system).
The portal service than has to do set km file authorizations.
Has anyone an idea how I can do this and which portal service is the best for this?
Thanx a lot
ChristophHi,
Take a look at this similar post: /thread/412823 [original link is broken]
BRgds,
Simon -
Hi,
I am working with apex 3.2 and I want to call web services from a page in application in apex.
and I do not have any idea about this topic,
any body can help me in this ??
Thanks and best regards.
Mohd.Hi,
I have for example this web service
(https://www.eclaimexpress.com/KEHClinics/TestCodingAlerts.asp?CMD=CROSSCODING&TYPE=CPT&TERM=icd9v1&CODE=13100), this link will return me xml as following
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <links>
<link href="/ws/codetype/icd9v1/172.5">172.5</link>
<link href="/ws/codetype/icd9v1/173.5">173.5</link>
<link href="/ws/codetype/icd9v1/198.2">198.2</link>
<link href="/ws/codetype/icd9v1/209.35">209.35</link>
<link href="/ws/codetype/icd9v1/209.75">209.75</link>
<link href="/ws/codetype/icd9v1/214.1">214.1</link>
<link href="/ws/codetype/icd9v1/216.5">216.5</link>
<link href="/ws/codetype/icd9v1/228.01">228.01</link>
<link href="/ws/codetype/icd9v1/232.5">232.5</link>
<link href="/ws/codetype/icd9v1/238.2">238.2</link>
<link href="/ws/codetype/icd9v1/448.1">448.1</link>
<link href="/ws/codetype/icd9v1/686.1">686.1</link>
<link href="/ws/codetype/icd9v1/701.1">701.1</link>
<link href="/ws/codetype/icd9v1/701.4">701.4</link>
<link href="/ws/codetype/icd9v1/701.5">701.5</link>
<link href="/ws/codetype/icd9v1/702.11">702.11</link>
<link href="/ws/codetype/icd9v1/702.19">702.19</link>
<link href="/ws/codetype/icd9v1/706.2">706.2</link>
<link href="/ws/codetype/icd9v1/709.1">709.1</link>
<link href="/ws/codetype/icd9v1/709.2">709.2</link>
<link href="/ws/codetype/icd9v1/709.4">709.4</link>
<link href="/ws/codetype/icd9v1/757.32">757.32</link>
<link href="/ws/codetype/icd9v1/875.0">875.0</link>
<link href="/ws/codetype/icd9v1/875.1">875.1</link>
<link href="/ws/codetype/icd9v1/877.0">877.0</link>
<link href="/ws/codetype/icd9v1/877.1">877.1</link>
<link href="/ws/codetype/icd9v1/879.0">879.0</link>
<link href="/ws/codetype/icd9v1/879.1">879.1</link>
<link href="/ws/codetype/icd9v1/879.2">879.2</link>
<link href="/ws/codetype/icd9v1/879.3">879.3</link>
<link href="/ws/codetype/icd9v1/879.4">879.4</link>
<link href="/ws/codetype/icd9v1/879.5">879.5</link>
<link href="/ws/codetype/icd9v1/879.6">879.6</link>
<link href="/ws/codetype/icd9v1/879.7">879.7</link>
<link href="/ws/codetype/icd9v1/879.8">879.8</link>
<link href="/ws/codetype/icd9v1/879.9">879.9</link>
<link href="/ws/codetype/icd9v1/880.00">880.00</link>
<link href="/ws/codetype/icd9v1/880.01">880.01</link>
<link href="/ws/codetype/icd9v1/880.09">880.09</link>
<link href="/ws/codetype/icd9v1/880.10">880.10</link>
<link href="/ws/codetype/icd9v1/880.11">880.11</link>
<link href="/ws/codetype/icd9v1/880.19">880.19</link>
<link href="/ws/codetype/icd9v1/906.0">906.0</link>
</links>
So now how can I call it in apex , and how can I return the results in report.??
Regards.
Mohd. -
Hi,
Calling WEB services from SAP and Please any one give idea to implement using ABAP. What the technology being used when
SAP connecting with ex: .net environment i.e Tight coupling environment.
Kindly advise me what techniques need to adopt to make this possible and i am new to this process.
Thanks,
Raghu.Hi,
It is better to open this thread in the ABAP development forum.
So, you can find the information about calling web services in the document, below;
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e45561a3c4?QuickLink=index&overridelayout=true
Best regards,
Orkun Gedik
Maybe you are looking for
-
Macbook air can't connect to wifi but at the same time is connnected.
Hey there fellow mac users, I got myself a tiny problem around here. My mid 2013 mba is connecting to my wifi at home, but when it's done connecting (and shows it's connected at the network panel) it doesn't load anything from firefox, safari, steam,
-
Web Service for "Creating Sales Order" by using BAPI
Hello All, I am trying to create a WS for "Creating Sales Order". The corresponding BAPI that I am using for this purpose is BAPI_SALESORDER_CREATEFROMDAT1. I am able to create the Web Service and run the WSDL on WS Navigator. But there is a problem
-
About once every other day one of my users losses the ability to log onto afp shares on the server. In the Server App under Users his "Allow user to log in" tick box has become unticked. If I tick that and save, everything is fine for a day or so th
-
Hi, We are trying to implement Lockbox functionality using EDI(FINSTA01 IDOC Type / Lockbx message type). Where can I find what information will be available in which data segment of the FINSTA01 type? I went to we60 and there is no detailed informat
-
I've updated my ipad with latest os update. After this the ipad screen is showing itunes logo with connection plug and is not responding. Use of reset button gives same result and ipad is not working. Can somebody help to solve this problem?