TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
anil kumar
NA
23
4.8k
WCF service Contract
Sep 1 2016 4:55 PM
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();
Reply
Answers (
5
)
DateTime Conversion in JSON
Ho to remove .svc from url in wcf rest service in .Net 3.5