Problem with WCF and multiple namespaces - sharing object types across multiple service references

后端 未结 4 778
闹比i
闹比i 2021-01-13 09:53

i have two web services. One with user functionality, one with admin functionality.

Both services effectively work with the same object types, for instance:

4条回答
  •  时光说笑
    2021-01-13 10:05

    Use the slsvcutil to create the WCF proxy on the clientside (assuming the clientside is a .net application), reference the DLL which contains your objects and it will be used for all endpoints that pass the same object in the DLL

    Open Visual Studio Command prompt from the Start -> Visual Studio 2008 -> Tools -> Visual Command Prompt

    goto directory similar to

    C:\Program Files\Microsoft SDKs\Silverlight\v3.0\Tools

    type slsvcutil and follow the syntax

    slsvcutil http://somewcfservice:8080 /r:CommonLibrary.dll
    

    where CommonLibrary.dll is the dll that contains the business objects

    [edit] fixed the fact that the project is a silverlight project

提交回复
热议问题