cancel
Showing results for 
Search instead for 
Did you mean: 

Odata Service within SMP3.0 not working: forbidden?

Former Member
0 Kudos

Hi everybody,

currently working on the following: I was able to create an odata service in our ECC environment. Works just fine. The next step is to make this odata service available through our SMP3.0 server. So, I imported it first into eclipse (from ECC) and deployed it to our SMP server. Works fine as well.

Now the problem starts: I can see the new Odata service in SMP. I created the namespace first just like the namespace in eclipse and also created the destination.

- The namespace sap has "no authentication".

- The Destination is refering to the Odata service on the ECC system.

If I open the service document, I see the folllowing:

http://system:8080/gateway/odata/sap/YaeTest;v=1

<service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xml:base="http://system:8080/gateway/odata/sap/YaeTest;v=1/">

<workspace>

     <atom:title>Default</atom:title>

          <collection href="SubscriptionCollection">

     <atom:title>SubscriptionCollection</atom:title>

        </collection>

          <collection href="NotificationCollection">

     <atom:title>NotificationCollection</atom:title>

          </collection>

          <collection href="EpmProductSet">

     <atom:title>EpmProductSet</atom:title>

     </collection>

     </workspace>

</service>

So to really see the data: the following should work:

http://system:8080/gateway/odata/sap/YaeTest;v=1/EpmProductSet

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code/>

<message xml:lang="en">

com.sap.core.odata.api.exception.ODataException: com.sap.core.odata.api.exception.ODataException: com.sap.gateway.core.api.exception.BaseException: Forbidden

</message>

</error>


But it isn't workin. I'm unable to get this to work and not sure if it is linked to the namespace or destination. Any hints? Just to be sure, the log is provided as well. Maybe it will help (maybe the anonymous part is causing the problems but not sure where to change this)


2014 04 15 15:03:38#+0100#ERROR#com.sap.gateway.core.ip.runtime.GatewayIPODataProcessor##anonymous#http-bio-8080-exec-5###readEntitySet() failed: service = sap/YaeTest, entity set = EpmProductSet, content type = application/xml;charset=utf-8, message = com.sap.gateway.core.api.exception.MetadataException: com.sap.core.odata.api.exception.ODataException: com.sap.core.odata.api.exception.ODataException: com.sap.gateway.core.api.exception.BaseException: Forbidden|

2014 04 15 15:03:38#+0100#ERROR#com.sap.gateway.core.ip.odata.ODataErrorCallbackImpl##anonymous#http-bio-8080-exec-5###handleError(): failed to serve request for URI http://system:8080/gateway/odata/sap/YaeTest;v=1/EpmProductSet, message = com.sap.core.odata.api.exception.ODataException: com.sap.core.odata.api.exception.ODataException: com.sap.gateway.core.api.exception.BaseException: Forbidden|

Hope you can help!

Cheers and thanks!

Laurens

Accepted Solutions (0)

Answers (4)

Answers (4)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Have you resolved your issue?

While creating destination you have to pass valid username and password for https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/

Do a sign-up over here https://supsignformssapicl.hana.ondemand.com/SUPSignForms/

For more info, refer

Once you are done with destination creation, you have to REGISTER service. Follow this link:

And then, Destination to Entityset.

Please raise a new thread if you still face the same issue.

Regards,

JK

Former Member
0 Kudos

Thanks Jitendra
but the problem I was facing was becasue i didnt followed step 6.3.1 correctly i-e
Destination URL:      https://sapes1.sapdevcenter.com:443/sap/iwbep?sap-client=520

in tutorial

Best Regards

Former Member
0 Kudos

Hi L.Steffers
Did you find any solution to this?Any help would be appreciated.
Thanks

midhun_vp
Active Contributor
0 Kudos

Can you please let me know what you are trying to and the steps you did.

Is that url (http://system:8080/gateway/odata/sap/YaeTest;v=1/EpmProductSet) working in a browser?

Midhun VP

Former Member
0 Kudos

Hello Midhun,

no, that is the problem, the url is not working (besides the different system name of-course). I also posted the error when I use the url:

<errorxmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code/>

<message xml:lang="en">

com.sap.core.odata.api.exception.ODataException: com.sap.core.odata.api.exception.ODataException: com.sap.gateway.core.api.exception.BaseException: Forbidden

</message>

</error>


Using the Chrome inspect element option I can see it raises a 500 internal server error with the server log as stated in my initial question.


I'll just start over and see if the result stays the same. Will make soms screengrabs.


cheers!

Laurens



midhun_vp
Active Contributor
0 Kudos

If the Odata url itself is not working from a browser the issue is not with SMP, get help from a NWGateway consultant to fix the issue.

Example Odata service and response

https://sapes1.sapdevcenter.com/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/

The above url is from the trial system provided by SAP,

Midhun VP

Former Member
0 Kudos

Hello Midhun,

which gateway server do you mean? The GW server integrated into our ECC 740 environment or the GW server on the SMP3 side? Point is that the services provided by the ECC 740 systems are working and providing us with results. Even the service on the ECC system which we use as a destination within the SMP3 server.

I think I'll try to recreate everything only this time using the odata service from the Hana test center. So the process would be:

Create model in eclipse using the hana test service as input. Deploy the model to the SMP server. Create a destination to the hana test service and see what it does.

Cheers and thanks!

LS

Former Member
0 Kudos

So I tried it all over again:

First: Create the service in eclipse and deploy it using the different "create" operations and right-mouse clicks operations.

Second: Go to the SMP admin panel and create a security profile within namespace SAP.

Third; go to the gateway cockpit and create the destination and link it to our service,

Well, the endresult should be that the service itself should work. I do get one successful thing:

http://system:8080/gateway/odata/sap/YaeTestHana;v=1 Gives me:

<service xmlns="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom"xml:base="http://system:8080/gateway/odata/sap/YaeTestHana;v=1/">

<workspace>
<atom:title>Default</atom:title>
<collection href="BookingCollection">
<atom:title>BookingCollection</atom:title>

</collection>

<collection href="CarrierCollection">
<atom:title>CarrierCollection</atom:title>

</collection>

<collection href="TravelagencyCollection">
<atom:title>TravelagencyCollection</atom:title>

</collection>

<collection href="TravelAgencies">
<atom:title>TravelAgencies</atom:title>

</collection>

<collection href="SubscriptionCollection">
<atom:title>SubscriptionCollection</atom:title>

</collection>

<collection href="NotificationCollection">
<atom:title>NotificationCollection</atom:title>

</collection>

<collection href="FlightCollection">
<atom:title>FlightCollection</atom:title>

</collection>

</workspace>

</service>


But really using a collection like this:


http://system:8080/gateway/odata/sap/YaeTestHana;v=1/CarrierCollection


Just gives:


<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code/>

<message xml:lang="en">Error in Getting the Service</message>

</error>

So, using my own odata services gives problems with regard to autorisations (Forbidden). And using a general available hana odata service (like mentioned before), gives errors as well 😞

I followed the steps from the following tutorial, so I don't think I've missed anything:

Hope you can help!  Anyone else tried to create a smp odata service using an external url? Screengrabs of the steps would be nice. Just making sure I haven't missed anything.

Cheers!

Laurens

ps: yes. service is active.

Former Member
0 Kudos

Will try the following next: lets hope I can get some results from the smp server:

midhun_vp
Active Contributor
0 Kudos

Since you are able to get the collection I doubt the issue may be with the entity sets you created. Double check the entity set mappings.

Midhun VP

Former Member
0 Kudos

Which mappings? From eclipse it is just next next finish, and even getting a global available hana service does not work. So which mapping are we talking about?

Kind regards,

Laurens

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

I didnt find anything wrong in your above mentioned procedure till you get GET OData URL response. Although you have got the result (for HANA OData URL), just want to confirm, you have security profile with same the name as namespace "sap"? right?

Just a small suggestion, can you try with Deactivating and activating service under Registered services in cockpit?

Former Member
0 Kudos

Yes, namespace is the same (sap + no Authentication etc). Which user do I have to fill in as a 'bypass'? the smp admin user or my S user (for hana) or a specific user for the sap backend?

Deactivating and activating it again didn't work.

Still working on the wsdl example. Had to install Juno. Could Kepler be a problem when deploying to smp3?

Kind regards

Laurens

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos
Which user do I have to fill in as a 'bypass'? the smp admin user or my S user (for hana) or a specific user for the sap backend?

You have to select Authentication type as Basic Authentication

username and password are the same by which you are accessing (flight list Odata URL), i guess your S-user id (in your case).

Had to install Juno. Could Kepler be a problem when deploying to smp3?

Recommended is Eclipse Juno (JAVA EE edition)

Former Member
0 Kudos

Well, using Juno I'm able to create an odata service in SMP with the Soap/wsdl connection. I'll try to do the same thing for the odata service using Juno instead of kepler. Back in a few minutes.

Former Member
0 Kudos

Nope, tried it with Juno and now I'm getting errors like this:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<code/>

<message xml:lang="en">

java.lang.NullPointerException: while trying to invoke the method java.lang.Object.hashCode() of a null object loaded from local variable 'k'

</message>

</error>

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Well, using Juno I'm able to create an odata service in SMP with the Soap/wsdl connection.

tried it with Juno and now I'm getting errors

what do you see in SMP server logs? I am sure you will get some hints.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos


. I created the namespace first just like the namespace in eclipse and also created the destination.

- The namespace sap has "no authentication".

Can you please share some snapshots how exactly you did It?