on 08-26-2005 10:20 AM
Hello All,
I am using EP6 SP9.
I have created a portal service and created web service from the portal service.
Now when i try to access the web service either from NWDS Enterprise portal view i get this error.
<b>The user Authentication is not correct to access to the portal service <service name> or the service was not found.</b>
<i>I get similar error if i try to access the service from C# Client saying User Authentication problem.</i>
Please tell me where to mention Authentication details.
regards
Santosh
Hello All,
Please Help,
This is an urgent requirement.
Thanks and regards
Santosh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Iam not sure, but Have u done this?
(If necessary) Associate User object with the portal service.
If Web Services invocation requires the authentication via User mapping or SAP Logon Ticket, you need to assosiate User object with the portal service.
getSecurisedServiceConnection() associates the User object and it returns the cloned instance with User object. The method call which is invoked later may make use of this User object for authentication.
I<Service_Name> clientWithUserObj = client.getSecurisedServiceConnection(request.getuser());
Regards
Have you seen this:
& this:
http://help.sap.com/saphelp_nw04/helpdata/en/c0/f8fb4028b5f86fe10000000a1550b0/content.htm
Let me know,
Hi Peter,
Let me explain my problem with this scenario.
I have created a Portal Service to display "Hello (Portal User Name)" in NWDS. Using this I have created a Web Service on EP6 SP9.
Now, I am calling this Web Service from NWDS EP Perspective (Create Soap Request -> Send Message)
<b>This is my web service code:</b>
package com.sap.portal.service;
import com.sapportals.portal.prt.runtime.PortalRuntime;
import com.sapportals.portal.prt.service.IServiceContext;
import com.sapportals.portal.prt.service.IServiceConfiguration;
import com.sapportals.portal.prt.service.IService;
import com.sap.security.api.IUser;
import com.sap.security.api.UMException;
import com.sap.security.api.UMFactory;
public class TestPrtService implements ITestPrtService {
private IServiceContext mm_serviceContext;
public void init(IServiceContext serviceContext) {
mm_serviceContext = serviceContext;
}
public void afterInit() {
}
public void configure(IServiceConfiguration configuration) {
}
public void destroy() {
}
public void release() {
}
public IServiceContext getContext() {
return mm_serviceContext;
}
public String getKey() {
return KEY;
}
public String sayHello(String name) {
try {
IUser user = UMFactory.getUserFactory().getUserByLogonID(name);
return "Hello " + name;
} catch (UMException e) {
e.printStackTrace();
return null;
}
}
}
<b>I am getting this error:</b>
<faultstring>The User Authentification is not correct to access to the Portal Service com.sap.portal.prt.soap.TestPrtService or the service was not found.</faultstring>
<faultactor>[sapnw2] com.sapportals.portal.prt.service.soap.exception.SoapFaultHandler</faultactor>
<type>java.lang.IllegalAccessError</type>
I have read the link u sent and now I have these queries:
1. Please specify where i have add these lines of code. Also getSecurisedServiceConnection(request.getUser()) is not available. how can i get it ???
I<Service_Name> clientWithUserObj = client.getSecurisedServiceConnection(request.getuser());
2. As per my current requirement I need to call this web service from my external application (eg Any Java Client or C# Client). Please confirm whether a Portal Component is a must for such accessibility???
Regards,
Santosh Choudhary
Step1:Create Portal Service com.sap.PS <-- ApplicationName
Gave MyService as the service name
IMyService --> KEY = "com.sap.PS.MyService"
Also ur getString()
and then in MyService implemented those methods.
Deployed the service and then restarted J2EE engine.
Tested with a small portal Application and was successful to access the getString() method from the service.
Step2:
Then deployed the same service as a webService by selecting the option "PortalWebService from PortalService"
U shud see & select the methods u want to expose.Thus it creates wsdl files.
Restarted J2EE Again and then checked the service:
SystemAdmin>system config>service config>
Applications
-Service
your service.
U can browse the wsdl file from system Admin>support>portal runtime> soap admin>web services.
I know u had no problems till here..u were able to see the url result with no errors.
U can also use NWDS WS Checker to see the result.
Also have implemented the webservice.I had 2 no problems with this.
Hope this helps.
1. Navigate to System Administration->Support->Portal Runtime->SOAP Admin
2. Click on Deep init for j2ee to pick up your web services
3. Click on Web Services to see if your web services shows up.
4. Test your web service via following url
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prakash,
Thanks for the reply.
I followed all your steps u mentioned.
When i click on Web Services my web service is shown with following configuration.
ID : com.sap.portal.prt.soap.TestPrtService
Web Enable : True (Tick mark)
Web Proxy : (Nothing is displayed)
Document Literal : Present
RPC Encoded : Present
RPC Literal : Present
When i click on my web service url
http://sapnw2:50000/irj/servlet/prt/soap/com.sap.portal.prt.soap.TestPrtService
i get this output on my browser.
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- WSDL File generated by the SAP PORTAL ECLIPSE PLUGINS
-->
- <!-- VERSION : 6.3.20040210
-->
- <wsdl:definitions name="TestPrtService" targetNamespace="prt:service:com.sap.portal.service.TestPrtService" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:intf="prt:service:com.sap.portal.service.TestPrtService" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime" xmlns:http="http://schemas.xmlsoap.org/soap/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:message name="sayHelloResponse">
<wsdl:part name="response" type="xsd:string" />
</wsdl:message>
- <wsdl:message name="sayHelloRequest">
<wsdl:part name="sayHello_1_param2" type="xsd:string" />
</wsdl:message>
- <wsdl:portType name="TestPrtService">
- <wsdl:operation name="sayHello" parameterOrder="sayHello_1_param2">
<wsdl:input name="sayHello_input0" message="intf:sayHelloRequest" />
<wsdl:output name="sayHello_output0" message="intf:sayHelloResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="com.sap.portal.prt.soap.TestPrtServiceBinding" type="intf:TestPrtService">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="sayHello">
<soap:operation soapAction="prt:service:com.sap.portal.service.TestPrtService.TestPrtService/sayHello" />
- <wsdl:input name="sayHello_input0">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="prt:service:com.sap.portal.service.TestPrtService" />
</wsdl:input>
- <wsdl:output name="sayHello_output0">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="prt:service:com.sap.portal.service.TestPrtService" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="TestPrtServiceService">
- <wsdl:port name="com.sap.portal.prt.soap.TestPrtService" binding="intf:com.sap.portal.prt.soap.TestPrtServiceBinding">
<soap:address location="http://sapnw2:50000/irj/servlet/prt/soap/com.sap.portal.prt.soap.TestPrtService?style=rpc_enc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Please Help.
Thanks and regards
Santosh
Looks like your web service is deployed properly. To test your service.
1. Start NWDS with <b>EP perspective</b>.
2. Enter the following url in the <b>Enterprise Portal Web Services checker.</b>
http://sapnw2:50000/irj/servlet/prt/soap/com.sap.portal.prt.soap.TestPrtService
3. Click on button "W" to get the WSDL.
4. Construct your SOAP message and test your web service by clicking on "Send Message" button.
PS: Please reward points for helpful answer or problem resolved. thank you.
Hi Prakash,
I was getting Authentication error on doing the same.
When i click on "Send Message" after creating SOAP Message, i get this error.
<b>Detailed description of error.</b>
http://sapnw2:50000/irj/servlet/prt/soap/com.sap.portal.prt.soap.TestPrtService?style=rpc_enc
<b>Fault</b>
<u>faultcode(null)</u>=SOAP-ENV:Server
<u>faultstring(null)</u>=The User Authentication is not correct to access the portal service com.sap.portal.prt.soap.TestPrtService or the service was not found.
<u>faulttactor(null)</u>=[sapnw2]com.sapportals.portal.prt.service.soap.exception.SoapFaultHandler
<b> detail</b> <u>error</u>
<u>type</u>=java.lang.IllegalAccessError
Please reply urgently.
Thanks and regards
Santosh Choudhary
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.