2
Answers

using mulitple services

123carsten

123carsten

14y
2.9k
1
Hi all,

I am working on a project using wcf. We have a running service which is hosted on IIS, Developement service during developement cycle.

However, in order to seperate business-logic I would like to supply a second service that the client can also connect to, but also this service should
be able to use our other service functionality.

What I had was an interface in a seperate project (contract), implementation in a different, plenty of functionality, and the proper web.config settings. To create the second service, I added a second interface into contract with same attribute as the first. Then I added another project to implement that interface and added an endpoint to my config. Service projects compile, no warnings/errors, starting both services as developent service also works, but I cannot get more than an errorpage using a browser to view the standard page "You have created a service" (or whatever the title). The first service answer with that page though.

Here´s the endpoint configuration, can anyone spot a problem?

<system.serviceModel>
    <services>
      <service name="XYZprotokollService" behaviorConfiguration="XYZprotokollService.XYZprotokollBehavior">
        <!-- Service Endpoints -->
        <!--<endpoint address="" binding="wsHttpBinding" contract="XYZService.IXYZService">-->
        <endpoint address="XYZprotokollService.XYZprotokollService" binding="basicHttpBinding" contract="XYZServiceContract.IXYZprotokollService">
          <!--     remove or replace identy element on deployment
                    -->
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress ="http://localhost:3663/XYZprotokollService.svc"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
    <serviceBehaviors>
        <behavior name="XYZprotokollService.XYZprotokollBehavior">

            <serviceMetadata httpGetEnabled="true"/>
                   
            <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
    </serviceBehaviors>
    </behaviors>
</system.serviceModel>

The config file of the first service is a bit bigger, but the content of the system.serviceModel-Node is almost identically bar the namespaces and interface names.

greets and thanx.


Answers (2)
1
Sameer Shaik

Sameer Shaik

NA 953 1k 7y
I personally suggest to keep it in ViewModel(unless it is very important to use in model), so that you can reuse your Models in another applications. 
 
Here are few links, please go through these 
 
http://stackoverflow.com/questions/6922130/in-mvvm-model-should-the-model-implement-inotifypropertychanged-interface
 
http://stackoverflow.com/questions/772214/in-mvvm-should-the-viewmodel-or-model-implement-inotifypropertychanged
 
https://www.codeproject.com/Questions/829686/In-MVVM-should-the-ViewModel-or-Model-implement-IN 
Accepted