Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
WCF service Contract
anil kumar
Sep 1 2016 4:55 PM
373
Reply
hi,
please could anyone provide the correct answer for the question.
If "IService1" is a contract,
public interface IService1
{
[operationContract]
string GetData(int value);
} then at the client side followoing is the piece of code to obtin the proxyObject, to call the service .
string url = "htt://localhost:26800/service1.svc?wsdl";
EndPointAddress endPoint = new EndPointAddress (url);
BasicHttpBinding binding = new BasicHttpBinding();
----------------------------------------------------------------------------------
Console.WriteLine (ref, GetData(100)) ;
Options :
1. IService1 lref = new ChannelFactory <IService1> (endPoint), CreateChannel();
2. IService1 lref = new ChannelFactory <IService1> (binding, endPoint), CreateChannel();
3. IService1 lref = new ChannelFactory <IService1> (binding), CreateChannel();
4. IService1 lref = new ChannelFactory <IService1> (), CreateChannel();
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
DateTime Conversion in JSON
Ho to remove .svc from url in wcf rest service in .Net 3.5