Mortarello
asked on
Consuming WCF from another machine
Guys,
I'm try to consume my wcf hosted in console app from another machine and I'm getting erro
No connection could be made because the target machine actively refused it 127.0.0.1:8092.
Does any one could help me ?
My firewall is already disabled. If i try to create a client on same machine work, but from another machine doen'st work.
Tks guys
I'm try to consume my wcf hosted in console app from another machine and I'm getting erro
No connection could be made because the target machine actively refused it 127.0.0.1:8092.
Does any one could help me ?
My firewall is already disabled. If i try to create a client on same machine work, but from another machine doen'st work.
Tks guys
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
karl-henrik I tried to connect using Http and Works.
Tthe problem with credencial is only with net.tcp
Tthe problem with credencial is only with net.tcp
If you look at IIS you have different credentials for running your WCF service.. the simplest I would assume for you is to set anonymous (Under the Authentication tab) in IIS that might work.
If you share some code and configurations I might be able to help you further :)
This link might shed some light on how to set up the WCF permissions too..
Hope it helps
//Karl.
If you share some code and configurations I might be able to help you further :)
This link might shed some light on how to set up the WCF permissions too..
Hope it helps
//Karl.
ASKER
Hi karl-henrik,
Sure, i will post it now..There is nothing fancing cos I'm learning wcf. I'm hosting on Console App
App.config
-------------------------- ---------- ---------- ---------- -------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Default_http" transferMode="Streamed">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFa ults="true " />
<serviceThrottling />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Def ault" name="WcfServiceLibrary1.S Financial" >
<endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="Defa ult_http"
contract="WcfServiceLibrar y1.IFinanc ial" />
<endpoint address="nettcp" binding="netTcpBinding" contract="WcfServiceLibrar y1.IFinanc ial" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang e" />
<endpoint address="mexTcp" binding="mexTcpBinding" contract="IMetadataExchang e" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8090/SFinancial" />
<add baseAddress="https://localhost:8091/SFinancial" />
<add baseAddress="net.tcp://loc alhost:809 2/SFinanci al" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
-------------------------- ---------- --------
[ServiceContract]
public interface IFinancial
{
[OperationContract]
int Getvalue(int arg);
[OperationContract]
void dooSomeThing();
-------------------------- ---------- ---------
[ServiceBehavior(InstanceC ontextMode = InstanceContextMode.PerSes sion, ConcurrencyMode = ConcurrencyMode.Multiple)]
public class SFinancial : IFinancial
{
public int Getvalue(int arg)
{
return arg++;
}
public void dooSomeThing()
{
Thread.Sleep(10000);
Console.WriteLine("done.." );
}
public void dooSomeThingToo()
{
Thread.Sleep(2000);
Console.WriteLine("You call me..");
Thread.Sleep(10000);
Console.WriteLine("done Too..");
}
}
[OperationContract]
void dooSomeThingToo();
}
Sure, i will post it now..There is nothing fancing cos I'm learning wcf. I'm hosting on Console App
App.config
--------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="Default_http" transferMode="Streamed">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFa
<serviceThrottling />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Def
<endpoint address="basic" binding="basicHttpBinding"
contract="WcfServiceLibrar
<endpoint address="nettcp" binding="netTcpBinding" contract="WcfServiceLibrar
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchang
<endpoint address="mexTcp" binding="mexTcpBinding" contract="IMetadataExchang
<host>
<baseAddresses>
<add baseAddress="http://localhost:8090/SFinancial" />
<add baseAddress="https://localhost:8091/SFinancial" />
<add baseAddress="net.tcp://loc
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
--------------------------
[ServiceContract]
public interface IFinancial
{
[OperationContract]
int Getvalue(int arg);
[OperationContract]
void dooSomeThing();
--------------------------
[ServiceBehavior(InstanceC
public class SFinancial : IFinancial
{
public int Getvalue(int arg)
{
return arg++;
}
public void dooSomeThing()
{
Thread.Sleep(10000);
Console.WriteLine("done.."
}
public void dooSomeThingToo()
{
Thread.Sleep(2000);
Console.WriteLine("You call me..");
Thread.Sleep(10000);
Console.WriteLine("done Too..");
}
}
[OperationContract]
void dooSomeThingToo();
}
Can't find any errors there but I am not the best at configurationg WCF but I do belive that netTCP does not support the streaming transfermode but don't take my word for it because I could not find any references to back that information up..
What client credentials did you set up in your WCF project?
What client credentials did you set up in your WCF project?
ASKER
I haven't setup nothing about credential..:)
Oh :) this is slightly "out of the blue" (but it should work - did not have a chance to test it)
<wsHttpBinding>
<binding name="WSHttpBinding_IServi ce”>
<security mode="Message">
<transport clientCredentialType="None "
proxyCredentialType="None" realm="" />
<message clientCredentialType="None "/>
</security>
</binding>
</wsHttpBinding>
You can read more about it here
<wsHttpBinding>
<binding name="WSHttpBinding_IServi
<security mode="Message">
<transport clientCredentialType="None
proxyCredentialType="None"
<message clientCredentialType="None
</security>
</binding>
</wsHttpBinding>
You can read more about it here
Note that is just an example you have to translate it to work on your system :)
ASKER
Ok..
Thanks for that Karl-henrik.
Thanks for that Karl-henrik.
ASKER
Thank you very much karl-henrik.
Done...
Done...
ASKER
Tks for your answer. Wow this is funny cos when i added the reference I typed http://machinename:8082/SFinancial and on App.conf has been created with localhost.
I changed now and he gave me another erro :
The server has rejected the client credentials.
Could you help me with that karl-henrik ?
Tks Man