0
votes

I have this scenario:

1- WCF Data Service #1 with a custom entity (no entity framework)

2- WCF Data Service #2 with entities by entity framework.

My client should call just the WCF Data Service #2 the expose more then functions with own entities also function with entity from the WCF Data Service #1.

In other words, I call a service operation on WCF Data Service #2 that return an entity on WCF Data Service #1, but unfortunally it fail.

Any suggestion?

1
how does it fail? where does it fail?Seph
You have the entity described in both models? $metadata has to be able to describe the service operation, which means that you would need to have the same contract for the entity in both services.Mark Stafford - MSFT
@Seph The error is that it cannot find the entity #1.Andrea
@Mark The entity 1 is define in model #1 and the entity #2 is define in model #2. I think this is the problem.Andrea

1 Answers

1
votes

Any OData service must currently have a fully self-descriptive $metadata. So in your scenario, service 2 can return an entity from service 1, but service 2 would need to describe the same entity.

If you already have a custom provider, it shouldn't be too hard to proxy calls to a service operation on service 2 to include results from service 1 (in that case you would simply have a WCF Data Service that acts as both client and server). The catch is that service 2 must describe the entity in terms of that model, not model 1.

There is a feature somewhere down the road called model references that should both see the light of day and solve this particular issue.