on 04-02-2004 4:33 PM
I have coded this, got my license key, ammended the code and deployed the par to the portal. I can run it and get the first screen up, but when I enter a search term and click on the button - I get an error. Looking at the logs the following few lines seem to say that it is looking for a service.
Caused by: java.lang.reflect.InvocationTargetException: com.sapportals.portal.prt.service.ServiceException: Service not found: Alias
com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Portal Component
Looking at the code the URL is called ALias (or is it alias1).
If I have to define a service - what type should I used?
Has anyone else got the google example service to work?
Chuck,
The problem is that your java class is calling the alias name for your service which is not the word "Alias".
In the MyGooglePage.java example file they list the line to get the service.
I believe it is:
IMyGoogleService googleService = (IMyGoogleService) PortalRuntime.getRuntimeResources().getService("Alias");
This is defaulted to the word alias. You should change this to the Alias name listed in your portalapp.xml file for the Service wherever the getService("Alias") is called.
Please let me know if the Google WebService example works for you after this change. I have run into a problem further on where i am getting a Class Cast Exception when it actually calls the doSearch method and wondered if anyone else is having this problem.
-Erin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry this didn't work - but I did change the portalapp.xml to Alias instead of Alias1.
I am getting the following error - any suggestions
Caused by: java.lang.reflect.InvocationTargetException: java.lang.IllegalStateException: Not able to initialize Web Service configuration for service Alias
Sure here it is
<?xml version="1.0" encoding="utf-8"?>
<application>
<application-config>
<property name="SharingReference" value="com.sap.portal.runtime.application.soap,htmlb">
</property>
<property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
</application-config>
<components>
<component name="MyGooglePage">
<component-config>
<property name="ClassName" value="com.ocl.tutorial.wsd2service.MyGooglePage"/>
<property name="SecurityZone" value="com.ocl.tutorial.wsd2service/low_safety"/>
</component-config>
<component-profile/>
</component>
<component name="MyGooglePage">
<component-config/>
<component-profile/>
</component>
</components>
<services>
<service alias="Alias" name="MyGoogleService">
<service-config>
<property name="className" value="com.ocl.tutorial.wsd2service.MyGoogleService">
</property>
<property name="startup" value="false">
</property>
<property name="WebEnable" value="false">
</property>
<property name="WebProxy" value="true">
</property>
<property name="SecurityZone" value="com.ocl.tutorial.wsd2service.MyGoogleService/DefaultSecurity">
</property>
</service-config>
<service-profile>
<property name="SystemAlias" value="Default_System_Alias">
</property>
</service-profile>
</service>
</services>
</application>
If you look down at the line that creates the Service object it states that the Alias is "MyGoogleService"
<service alias="Alias" name="<b>MyGoogleService</b>">
<service-config>
<property name="className" value="com.ocl.tutorial.wsd2service.MyGoogleService">
In your java class when it makes the call
...getService("<b>Alias</b>");
change this to ...getService("<b>MyGoogleService</b>");
This should fix the error.
Message was edited by: E. Knight
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.