on 05-24-2013 4:52 PM
Hi,
I'm trying to consume a gateway service with BreezeJS.
BreezeJS is a really good javascript library for odata services, that enables you to query your gateway service.
For getting this working the service needs to fullfil some requirements.
Most requirements are not a problem for gateway, except the inverse relationsship.
I'll try to explain my problem.
I have a gateway service with an associationset which creates an association between Business Partner and sales order.
For making the Breeze library to work I need to specify the inverse relation.
To specify this inverse relation I need to change the name of the role of each endpoint.
To make it more clear I've created an example. This is how it generates on gateway:
<AssociationSet Name="BusinessPartnerSalesOrders_AssocSet" Association="ZCODEJAM02_SRV.BusinessPartnerSalesOrders" sap:creatable="false" sap:updatable="false" sap:deletable="false"sap:content-version="1">
<End EntitySet="BusinessPartners" Role="FromRole_BusinessPartnerSalesOrders"/>
<End EntitySet="SalesOrders" Role="ToRole_BusinessPartnerSalesOrders"/>
</AssociationSet>
<AssociationSet Name="SalesOrdersBusinessPartner_AssocSet" Association="ZCODEJAM02_SRV.SalesOrdersBusinessPartner" sap:creatable="false" sap:updatable="false" sap:deletable="false"sap:content-version="1">
<End EntitySet="SalesOrders" Role="FromRole_SalesOrdersBusinessPartner"/>
<End EntitySet="SalesOrderItems" Role="ToRole_SalesOrdersBusinessPartner"/>
</AssociationSet>
And this is how I want it:
<AssociationSet Name="BusinessPartnerSalesOrders_AssocSet" Association="ZCODEJAM02_SRV.BusinessPartnerSalesOrders" sap:creatable="false" sap:updatable="false" sap:deletable="false"sap:content-version="1">
<End EntitySet="BusinessPartners" Role="Relation_BusinessPartnerSalesOrders"/>
<End EntitySet="SalesOrders" Role="Relation_SalesOrderBusinessPartner"/>
</AssociationSet>
<AssociationSet Name="SalesOrdersBusinessPartner_AssocSet" Association="ZCODEJAM02_SRV.SalesOrdersBusinessPartner" sap:creatable="false" sap:updatable="false" sap:deletable="false"sap:content-version="1">
<End EntitySet="SalesOrders" Role="Relation_SalesOrderBusinessPartner"/>
<End EntitySet="SalesOrderItems" Role="Relation_BusinessPartnerSalesOrders"/>
</AssociationSet>
Anyone knows how to maintain the rolename of an endpoint?
Thanks,
Joachim
Hi Joachim,
I talked to our development team and got some answers to your questions.
Building consumers on top of a mandatory naming convention like it seems to be done by the
BreezeJS tool set can thus lead to problems.
Hope that this helps a little bit.
Best Regards,
Andre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, Breeze does not have "mandatory naming conventions". The developer has complete control over the model schema and can manipulate the JSON payloads in either direction to match whatever you need. It's just a matter of knowing how.
Not sure what is meant by "For making the Breeze library to work I need to specify the inverse relation.
To specify this inverse relation I need to change the name of the role of each endpoint." If you want bi-directional navigation between entities (Customer <--> Order), the necessary info needs to be in the JavaScript metadata. But that's not hard to arrange and I don't know what the "name of the role" has to do with it.
When I say I don't know, I mean "I don't know". You may know. Perhaps this is best worked through on StackOverflow (tagged with "Breeze" .. http://stackoverflow.com/questions/tagged/breeze?sort=newest) where we do most of our free support.
Hi Ward,
Thanks for taking the time to respond here in SCN.
Now that Breeze has Full ODATA CRUD support any plans for a SAP Netweaver Gateway Plugin, CSRF tokens etc? I am sure a few people in here would be interested in an alternative JS library.
Cheers
John P
Hi Ward,
You can find more detailed information on stackoverflow via this link:
http://stackoverflow.com/questions/16089360/breezejs-read-odata-link/16142003#16142003
kr,
Joachim
@John - Man would we like to have that! I think we will although when is hard to say as there are so many bases to cover right now. We could use some help if anyone is offering (hint). Contact my by email.
@Joachim - I am looking at your SO question and will follow up there. Thanks for digging into this.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.