Skip to Content
1
May 24, 2013 at 03:52 PM

Consuming gateway service with BreezeJS

27 Views

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