WebService with generic contract interface

0

I'm trying to host a Web Service in a Windows service. And when setting serviceModel to App.config I'm getting the following editor error warning:

TheWebServiceisaprojectoftypeBibliotecadeServiçodoWCFandtheprojectthatwillhosttheWebServiceisoftypeWindowsService.Hereisthecontractinterfacecode:

usingSystem.ServiceModel;namespaceFoxMovieStoreWebService{[ServiceContract]publicinterfaceIDataPersistance<inT>whereT:new(){[OperationContract]boolInsert(Tvalue);[OperationContract]boolChange(Tvalue);[OperationContract]boolDelete(Tvalue);//TODO:Adicionesuasoperaçõesdeserviçoaqui}//Useumcontratodedadoscomoilustradonoexemploabaixoparaadicionartiposcompostosaoperaçõesdeserviço.//VocêpodeadicionararquivosXSDaoprojeto.Depoisdecriaroprojeto,useostiposdedadosdefinidosnelediretamente,comonamespace"FoxMovieStoreWebService.ContractType".

}

Here is the App.config Windows Service where I do the WebService configuration:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>
    <system.serviceModel>
      <services>

        <service name="FoxMovieStoreWebService.CrudAddress" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudBooking" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudCashDesk" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudClient" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.Dependent" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudDevolution" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudFunctionary" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudGame" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudMovCashDesk" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudMovie" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

        <service name="FoxMovieStoreWebService.CrudRent" behaviorConfiguration="ServiceConfig">
          <host>
            <baseAddresses>
              <add baseAddress="net.tcp://localhost:9876"/>
              <add baseAddress="http://localhost:8766"/>
            </baseAddresses>
          </host>
          <endpoint address="srv" binding="netTcpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="srv" binding="basicHttpBinding" contract="FoxMovieStoreWebService.IDataPersistance"/>
          <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
        </service>

    </services>

    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceConfig">
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    </system.serviceModel>
</configuration>

I'm pretty sure that this error is because I created the contract interface as a Generic Interface, because I do not know what it's like in App.config in this case. If my suspicion is confirmed, I will change the title of the question.

    
asked by anonymous 24.02.2017 / 22:13

0 answers