Silverlight class library calling WCF web service

來源:互聯網
上載者:User
Hi,

We have a 3-tiered application with a Silverlight front-end, that queries WCF web services. This worked fine until we moved part of the application to a few Silverlight class libraries, let's say ModuleA, B and C. Those modules contain both standard classes and user controls.

Querying a web service requires a ServiceReferences.ClientConfig file. Instead of one of those in the main application, we now have one in each module. The problem is now that:

  • They are not embedded in the final XAP file anymore
  • Even if they were, we have 3 different files named ServiceReferences.ClientConfig, I see a conflict coming up!

Do you know how to embed those files in the XAP so that the web service calls work? Then, should we group all the web references into another class library that is in turn referenced by everyone, to avoid having 3 files with the same name?

Thanks for your help,

Romain

=============

Well it's me again, I might have solved the problem by:

  • Adding all the service references in one single class library
  • Making all the modules reference this single library
  • Adding a link to the now unique 'ServiceReferences.ClientConfig' file in the main application, like described here: http://silverlight.net/forums/t/34747.aspx

If you don't mind I'll leave this open for a few days if anyone has any better suggestions! Thanks CraigN for your indirect help

Romain

 

====================

As a matter of interest, a common problem with putting the WCF client code in an assembly is that at runtime the ServiceReference.config file is not available to the application. To solve this, add the file to the Silverlight application project as a link.

 

 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.