Skip to Content
0

Error loading metadata when finishing project in xcode with ios SDK

Apr 20, 2017 at 06:54 AM

91

avatar image

Hi folks,

when finishing an ios sdk project in sap assistant system always says : cannot load metadata. Then i tried using an XmL from a productive service where we have the metadata. the Sap assistant than says: No leading / in namespaces allowed.

As all our Services start with a / - Namespaces are like /TYED/ - this is a problem? is this a bug? any workarounds?

kind regards oliver

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

avatar image
Former Member
Jun 14, 2017 at 07:38 AM
0

Hi Oliver,

I assume that you metadata is invalid and thats the reason why you are facing this error message. Could you please share your metadata with us for further investigation?

Regards,

Csaba

Share
10 |10000 characters needed characters left characters exceeded
Oliver Russinger Jun 19, 2017 at 12:44 PM
0

Hello Csaba,

below you will find the metadata which does not work when importing. error mesage says no leading / in namespace - but our namespace here as you can see ist /tyed/

regards oliver

http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:m=" http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap=" http://www.sap.com/Protocols/SAPData"> m:DataServiceVersion="2.0"> http://schemas.microsoft.com/ado/2008/09/edm"> Name="VariantProperty" sap:content-version="1"> http://cat01040.tyrolit.com :8080/sap/opu/odata/TYED/CA_UHD_MOB_SRV/$metadata" xmlns:atom=" http://www.w3.org/2005/Atom"/> rel="latest-version" href=" http://cat01040.tyrolit.com:8080/sap/opu/odata/TYED/CA_UHD_MOB_SRV/$metadata" xmlns:atom=" http://www.w3.org/2005/Atom"/>>

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Oliver,

Slashes are indeed not valid in OData namespaces; I believe there used to be an issue in older SAP Gateway systems that has been fixed by now (not sure on the exact timing and Gateway versions).

Can you fix your backend to not have slashes in namespaces? Alternatively, you could manually replace the slashes with dots in the metadata before you generate proxy classes, that should work for you as well.

Thanks
Andreas

0
Oliver Russinger Jul 17, 2017 at 04:58 AM
0

hello csaba,

metdadata is correct ,as we use this exactly metadata in normal fiori apps, thats why i asked that maybe namespaces starting with as / don't work, or there is a bug??

regards

oliver

Share
10 |10000 characters needed characters left characters exceeded
Andreas Schlosser
Jul 21, 2017 at 12:49 PM
0

Oliver,

The OData spec doesn't allow slashes in namespaces; recent Gateway versions should also prohibit that. You can either adjust the namespaces of your services, or also manually change the metadata, replace slashes with dots, e.g., and then generate the proxy classes from there using the console client.

I hear you saying that UI5 web apps work, but that doesn't necessarily mean that the OData service is correct - as web apps consume the service more 'ad-hoc' they may not even evaluate/need the namespace information.

Hope that works for you

Thanks
Andreas

Share
10 |10000 characters needed characters left characters exceeded
Oliver Russinger Jul 24, 2017 at 06:03 AM
0

Hello Andreas,

ok in our ui5 apps, we change the namespace in the MPC-Class and replace / with Dots (not always but in some cases). it is just kind of weird that when generating gatewayservices out of SEGW (and using Package Names with /NAMESPACE/ and Classes with /NAMESPACE/) it is possible to generate.

So as i interpret this would work , when replacing the / in the namespace in the MPC_EXT class (overriding namespace name), is this correct?

i mean in MPC_EXT coding like that (setting new namesapace form orignial one /TYED/CA_TMA_0001_SRC:

model->set_schema_namespace( 'TYED.CA_TMA_0001_SRV' ).

regards oliver

Share
10 |10000 characters needed characters left characters exceeded
Oliver Russinger Jul 25, 2017 at 03:04 PM
0

ok finally we found the error.

it is not allowed to have a dot in the namespace - in segw and with UI5 Apps this is allowed but not with ios apps.

a namespace with no dot and no slash works

regards

oliver

Share
10 |10000 characters needed characters left characters exceeded