cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to access portal service from web service..........urgent

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello All,

Please Help,

This is an urgent requirement.

Thanks and regards

Santosh

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Peter,

I haven't done this.

Could you please explain what do u mean by <b>client</b> in ur code.

I<Service_Name> clientWithUserObj = client.getSecurisedServiceConnection(request.getuser());

<i>And where i have to add this code in web service.</i>

Awaiting reply.

Thanks and regards

Santosh

Former Member
0 Kudos

Hi Peter,

With reference to your last reply, I would appreciate if you please provide some more details.

Im facing the same problem and have to deliver this asap....Please help.

Awaiting Reply.

Warm Regards,

Ritu R Hunjan

Former Member
Former Member
0 Kudos

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

Former Member
0 Kudos

Im sry i don have much details abt that..I just found that line from a pdf which doesn't talk anything more abt it.

I did execute ur code..and din have any problem while accessing the service..may be we shud wait on an expert!

Regards

Former Member
0 Kudos

Hi Peter,

Referring to ur last reply, what are the steps u took to execute my code ???

Ur reply may help me to solve my query.

regards

Former Member
0 Kudos

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.

paolotegon
Associate
Associate
0 Kudos

I had the same problem:

"The User Authentification is not correct to access to the Portal Service xxx or the service was not found"

I've solved it sending in the HTTP header of my SOAP Request the User ID and the Password (to do this I've used the SAP SOAP Client)

Hope this helps.

Former Member
0 Kudos

Hi Paolo,

Could u please specify how to send User ID and Password in the Header of SOAP Request.

regards

Santosh

paolotegon
Associate
Associate
0 Kudos

If you use the SAP SOAP Client go to:

View -> Settings

you can find the User and Password fields in the "HTTP Header" section.

Regards.

Former Member
0 Kudos

Hi Paolo,

Thanks for the reply,

Actually i need to access this service from Dotnet client, If i remove the authorization check, then it is working fine.

Any ideas ???

paolotegon
Associate
Associate
0 Kudos

May this link can help you:

Regards

Former Member
0 Kudos

Thanks Paolo,

My Problem is solved.

I have rewarded full points to u.

regards

Santosh Choudhary

Former Member
0 Kudos

Pete might be using a verson prior to NW04 SR1. For newer versions, SAP implemented new security features.

Former Member
0 Kudos

Hi Santosh,

I am facing the same Problem as yours .

Could you please tell me the solution to solve it.

The link given by PAOLO is not opening.

So it would be very kind of you if you come up with solution.

Regards,

Paresh.

Answers (1)

Answers (1)

Former Member
0 Kudos

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

https://hostname:port/irj/servlet/prt/soap/servicename

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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