Sunday, October 6, 2013

Type Sharing Issue with Multiple WCF Service References

I've encountered with a strange issue where the WCF test client could not generate the WSDL for the WCF service. No solutions have been available when googling with the error message we've got. So I split the service contract into three separate services depending on their functionality of them with the intention of adding them as 3 separate service references.

Then I've added the 3 service references to the front-end projects with the type-sharing option. But still had to re-factor a considerable number of lines of codes as the previous service client splits into 3 now. I've opened the files (except the xsds) generated by the service reference, then found this interesting behaviour in a file called "Reference.svcmap"


I've listed all my other mex endpoints as below and incremented the souceId, then I've regenerated the service reference.



Bingo..... Now using the ServiceAClient object I could invoke all the service methods available in ServiceB, ServiceC and ServiceD.