Trenutno implementiram klijent jedne WCF aplikacije i problem je sto sa svcutilom uvjek dobijam sledecu gresku:
Code:
WS-Metadata Exchange Error
URI: net.tcp://localhost:8888/TestingService
Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:
8888/TestingService'.
<?xml version="1.0" encoding="utf-16"?><Fault xmlns="http://www.w3.org/2003/
05/soap-envelope"><Code><Value>Sender</Value><Subcode><Value xmlns:a="http://www
.w3.org/2005/08/addressing">a:ActionNotSupported</Value></Subcode></Code><Reason
><Text xml:lang="de-AT">The message with Action 'http://schemas.xmlsoap.org/ws/2
004/09/transfer/Get' cannot be processed at the receiver, due to a ContractFilte
r mismatch at the EndpointDispatcher. This may be because of either a contract m
ismatch (mismatched Actions between sender and receiver) or a binding/security m
ismatch between the sender and the receiver. Check that sender and receiver hav
e the same contract and the same binding (including security requirements, e.g.
Message, Transport, None).</Text></Reason></Fault>
WS-Metadata Exchange Error
URI: net.tcp://localhost:8888/TestingService
Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:
8888/TestingService'.
<?xml version="1.0" encoding="utf-16"?><Fault xmlns="http://www.w3.org/2003/
05/soap-envelope"><Code><Value>Sender</Value><Subcode><Value xmlns:a="http://www
.w3.org/2005/08/addressing">a:ActionNotSupported</Value></Subcode></Code><Reason
><Text xml:lang="de-AT">The message with Action 'http://schemas.xmlsoap.org/ws/2
004/09/transfer/Get' cannot be processed at the receiver, due to a ContractFilte
r mismatch at the EndpointDispatcher. This may be because of either a contract m
ismatch (mismatched Actions between sender and receiver) or a binding/security m
ismatch between the sender and the receiver. Check that sender and receiver hav
e the same contract and the same binding (including security requirements, e.g.
Message, Transport, None).</Text></Reason></Fault>
App.config od servisa izgleda ovako:
Code:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="myNetTcpBinding" openTimeout="00:10:00" sendTimeout="00:10:00">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="DefaultBehavior" name="Tvs2.Wcf.Service.TestingService">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8888/TestingService"/>
</baseAddresses>
</host>
<endpoint address="net.tcp://localhost:8888/TestingService" binding="netTcpBinding"
bindingConfiguration="myNetTcpBinding" contract="Tvs2.Wcf.Service.ITestingService" />
</service>
</services>
</system.serviceModel>
</configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="myNetTcpBinding" openTimeout="00:10:00" sendTimeout="00:10:00">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="DefaultBehavior" name="Tvs2.Wcf.Service.TestingService">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8888/TestingService"/>
</baseAddresses>
</host>
<endpoint address="net.tcp://localhost:8888/TestingService" binding="netTcpBinding"
bindingConfiguration="myNetTcpBinding" contract="Tvs2.Wcf.Service.ITestingService" />
</service>
</services>
</system.serviceModel>
</configuration>
a od clienta:
Code:
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NewBinding0" openTimeout="00:10:00" sendTimeout="00:10:00" >
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:8888/TestingService" binding="netTcpBinding"
bindingConfiguration="NewBinding0" contract="Tvs2.Wcf.Service.ITestingService"
name="">
</endpoint>
</client>
</system.serviceModel>
</configuration>
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NewBinding0" openTimeout="00:10:00" sendTimeout="00:10:00" >
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:8888/TestingService" binding="netTcpBinding"
bindingConfiguration="NewBinding0" contract="Tvs2.Wcf.Service.ITestingService"
name="">
</endpoint>
</client>
</system.serviceModel>
</configuration>
Ovaj tag za security sam morao ubaciti jer inace se en moze spojiti na servis.
Free advice is seldom cheap.