KaranGupta
asked on
query regarding wcf
Hi
I have created one wcf service. Then I added the wcf project as reference in a web based application. Even I can use the functions defined in the service. But If I check the configuration file of the service I can see that there is no address defined.
How I can use the service if there is no address defined in the endpoint in the configuration file.
Regards
Karan Gupta
I have created one wcf service. Then I added the wcf project as reference in a web based application. Even I can use the functions defined in the service. But If I check the configuration file of the service I can see that there is no address defined.
How I can use the service if there is no address defined in the endpoint in the configuration file.
Regards
Karan Gupta
ASKER
But I am using WCF with visual studio 2005 express version
Then you may be set your endpoint programatically. Like
string baseAddress = "http://localhost:8080/wcfselfhost/";
ServiceHost host = new ServiceHost(typeof(MyServi ce), new Uri(baseAddress));
// Create a BasicHttpBinding instance
BasicHttpBinding binding = new BasicHttpBinding();
// Add a service endpoint using the created binding
host.AddServiceEndpoint(ty peof(IEcho ), binding, "echo1");
host.Open();
string baseAddress = "http://localhost:8080/wcfselfhost/";
ServiceHost host = new ServiceHost(typeof(MyServi
// Create a BasicHttpBinding instance
BasicHttpBinding binding = new BasicHttpBinding();
// Add a service endpoint using the created binding
host.AddServiceEndpoint(ty
host.Open();
ASKER
Hi
That is what I am saying. I have not set it but still I can use the function
That is what I am saying. I have not set it but still I can use the function
Please show your code. zip file
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And I guess, you are adding the reference using http://localhost/TestService in your TestWCFApp
ASKER
Hi sonawanekiran
I am adding as a reference in TestWcfApp in the same manner we normally add dll.
I am adding as a reference in TestWcfApp in the same manner we normally add dll.
Correct. The URL you are using to add service reference in your TestWCFAPP is defined in web.config of you WCF service project (which is TestService)
Look at this detail article http://beyondrelational.co