on 03-21-2014 2:33 PM
I have created a Gateway service with a number of links, associations and navigations.
There are three entities which are interconnected:
This is hierarchical: Companies can have sub-companies, companies have brands, brands have products.
I have implemented the associations and navigations between these things.
So what is the error/ problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
SCN posted this before I was finished (dam Ctrl+S posting messages!) and now won't let me edit the message.
I have set up one lot of expands which work fine, but Brands to Products will not let me $expand... but the navigation works fine!
Is there something I need to set up which will make the $expand work?
Yes, I have set up the target as N, and implemented all methods.
When I make the call .../Brands('<key>')/Products for all the brand keys it works fine.
But then if I change this to read .../Brands?$expand=Products the call never reached any of my DPC_EXT methods, or even the high level GET_ENTITYSET, GET_EXPANDED_ENTITYSET, GET_ENTITY, GET_EXPENDED_ENTITY..
It is failing before it reaches the method calls which implied to me that it is an issue in the metadata somehow... I have used the service builder, is there a tick-box I'm missing?
Yes the navigation is called Products, hence why the navigation .../Brands('<key>')/Products is working fine. just the expand is not - which should use all the same methods as the navigation.
The error message is "In the context of data services and unknown internal server error has occurred", which I've seen on a number of occasions for various different things.
It turns out there is a property of my Brands entity which is called "PRODUCTS" and it was confused about which "Products" I was refering too. Which is still odd, because you can't do an expand on the property of an entity, but at least it was fixed by changing the navigation name
Much appreciate your help, thank you!
Hi Lindsay,
If you had directly modelled such a hierarchy in SEGW, e.g. entity name is 'Object' and a property in that entity is called 'Object', the design time checks won't allow it.
I’m pretty sure that when you expand something, the same rules apply, as a temporary metamodel for the data has to be assembled. However, this is a runtime exception caused by you invoking an $expand, so the conflict cannot be anticipated at design time. Hence you get the runtime error.
I'll admit I would not have looked for this as a runtime error, but once the message ' Multiple Specifications of the Name 'PRODUCTS' as a Component Name (Component 10)' appeared it does indicate the naming conflict.
Similar rules apply to other development areas, like Web Dynpro contexts.
One to remember, as it probably won't occur often and the only way you can protect against this as a runtime error is to desk-check all the model property names.
Cheers
Ron.
Hi Ron,
Yeah I had modeled my service in SEGW, and my object BRANDS had a property PRODUCTS. But there was also another object PRODUCTS. Which I assume was why it was having difficulties. By changeingthe BRANDS entity attribute from PRODUCTS to BPRODUCTS it fixed it.
I don't think there are checks in SEGW to see if you have named an attribute of an entity the same a another entity name, but it does look like this is only an issue if you then try to expand on that second entity - so I guess it can't be raised as a design-time issue.
Glad it's resolved, and certainly one to remember for next time
Thanks for your input, I didn't know there were similar issue with web dynpro so I will keep this info for later
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.