problem in generating proxy file for the typed dataset using Svcutil.exe with Jun CTP
While trying to generate a proxy file for the typed dataset using Svcutil.exe I am getting the following error:
WS-Metadata Exchange Error URI: net.tcp://localhost/servicemodelsamples/service
Metadata contains a reference that cannot be resolved: 'net.tcp://localhost/servicemodelsamples/service'.
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:04:59.9843748'.
An existing connection was forcibly closed by the remote host
I was getting the same error with the Feb CTP but I did not find any problem with Jan and May CTP.
Any one has any idea?
I assume you're using the June CTP right now correct?
If so, there's been a bit of a change with regards to the way we expose the metadata. You will need to manually add your own metadata endpoint. So in config it would be something like this:
<services>
<service behaviorConfiguration="InfoBehavior" name="Server.MyTest">
<endpoint address="http://localhost:8000/MyTest/" binding="wsHttpBinding"
bindingConfiguration="InfoBinding" name="MyTest" contract="Server.ITest">
<identity>
<certificateReference x509FindType="FindBySubjectName" findValue="Fabrikam" />
</identity>
</endpoint>
<endpoint address="http://localhost:8000/MyTest/mex"
binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name ="InfoBehavior">
<serviceCredentials>
<serviceCertificate findValue="Sauron" x509FindType="FindBySubjectName"/>
</serviceCredentials>
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
Or programatically:
static void ConfigureMexEndpoint(ServiceHost serviceHost)
{
ServiceMetadataBehavior metadata = new ServiceMetadataBehavior();
serviceHost.Description.Behaviors.Add(metadata);
foreach (Uri baseAddress in serviceHost.BaseAddresses)
{
if ("http".Equals(baseAddress.Scheme))
{
serviceHost.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexHttpBinding(), "mex");
}
else if ("https".Equals(baseAddress.Scheme))
{
serviceHost.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexHttpsBinding(), "mex");
}
else if ("net.tcp".Equals(baseAddress.Scheme))
{
serviceHost.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexTcpBinding(), "mex");
}
}
}
I'm just guessing but that may the issue.