cancel
Showing results for 
Search instead for 
Did you mean: 

Unstable service is failing sometimes with error 'Resource not found for the segment'

Former Member
0 Kudos

Hi all,

I have written an OData service which is not stable. I am using a  set of URLs which I just copy and paste into the address bar. In most cases, the services work fine but sometimes I get the following error:

The following error message is shown on the HTML page: Resource not found for the segment

And the Gateway Error log transaction shows this error: Resource mobile_orders('000000819740') not defined in Metadata

After a while, I can use the same URL which was causing an error and all over sudden it is working again.

Any recommendation how to fix that issue?

Many thanks for your help.

Regards,

Andreas

Accepted Solutions (0)

Answers (2)

Answers (2)

jibin_joy
Contributor
0 Kudos

Hi Andreas ,

 

     I am not familiar with problem just giving some guess suggestion ....

Try to De-activate the metadata Cache and then play with this request

http://help.sap.com/saphelp_gateway20sp03/helpdata/en/3d/45e259b4bd49e197316cbfd3c7fa8e/content.htm 

Regards,

Jibin Joy

Former Member
0 Kudos

Hi Jibin Joy,

I followed your instruction but it did solve the issue.

I assume that my problem is caused by an encoding issue.

The following request is valid:

http://<host>.com:8000/sap/opu/odata/sap/LLG_SAP_PM_INTEGRATION/mobile_orders(%27000000819740%27)

Many thanks for your help.

Andreas

jibin_joy
Contributor
0 Kudos

Hi Andreas,

I think so ......its encoding Issue.

Regards,

Jibin Joy

Former Member
0 Kudos

Hi Andreas,

Did you solve this problem? I have the same thing occuring that suddenly service does not work anymore even though url is the same. After a while it works again...

Br Jan

0 Kudos

mostly because of Cache Clearing..

kammaje_cis
Active Contributor
0 Kudos

Can you share the complete URI (after masking host and port)? Also the metadata document can help.

Former Member
0 Kudos

Hi,

I have just seen that error if I try to call a single order given by its order ID.

This is URL works fine:

http://<host>:8000/sap/opu/odata/sap/LLG_SAP_PM_INTEGRATION/mobile_orders('000000819740')

The following URLs fails:

http://<host>.com:8000/sap/opu/odata/sap/LLG_SAP_PM_INTEGRATION/mobile_orders%28%27000000819740%27%2...

http://<host>:8000/sap/opu/odata/sap/LLG_SAP_PM_INTEGRATION/mobile_orders%28%27819740%27%29


The metadata definition for an order looks like:

     <EntityType Name="mobile_order" sap:content-version="1">
        <Key>
           <PropertyRef Name="orderid"/>
        </Key>
        <Property Name="person" Type="Edm.Int16" Nullable="false" sap:label="Int2"/>
        <Property Name="ref_equipment" Type="Edm.String" Nullable="false" MaxLength="18"/>
        <Property Name="ref_funcloc" Type="Edm.String" Nullable="false" MaxLength="30"/>
        <Property Name="description" Type="Edm.String" Nullable="false" MaxLength="40"/>
        <Property Name="orderid" Type="Edm.String" Nullable="false" MaxLength="12"/>
        <NavigationProperty Name="mobile_equipment" Relationship="LLG_SAP_PM_INTEGRATION.mobile_ordermobile_equipment" FromRole="FromRole_mobile_ordermobile_equipment" ToRole="ToRole_mobile_ordermobile_equipment"/>
        <NavigationProperty Name="mobile_operation" Relationship="LLG_SAP_PM_INTEGRATION.mobile_ordermobile_operation" FromRole="FromRole_mobile_ordermobile_operation" ToRole="ToRole_mobile_ordermobile_operation"/>
        <NavigationProperty Name="mobile_funcloc" Relationship="LLG_SAP_PM_INTEGRATION.order_funclo" FromRole="FromRole_order_funclo" ToRole="ToRole_order_funclo"/>
     </EntityType>

As you can see, the length of the order ID is limited to 12 characters. I have done that because the number range of the SAP order is defined by 12 characters. The client should not be able to provide a longer ID.

Is the metadata file used to validate the incoming message?

I set an external break point in my RFC which should be called. If the request fails as described above the RFC is never called.

Using this mobile_orders%28%27000000819740%27%29, is it possible that the actual length is based on '%28%27000000819740%27%29 so that the number of characters is bigger than the defined max length of the property?

Many thanks for your help.

Andreas

Former Member
0 Kudos

Hi,

I have modified the model so that the order ID is not defined with a max length anymore.

But I get the same behavior, the same errors occur.

Regards,

Andreas

kammaje_cis
Active Contributor
0 Kudos

Andreas,

"Resource not found" error comes mostly because system is not able to identify a Collection with name mobile_orders.

Are you sure that is name of your collection? . Is there a typo?

I do not see name of the collection in the above post.

Thanks

Krishna