Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# REST WebService
hi frens
 
I am new to the restful webservice ..... the doubt i ve is :
 
How can client know the datacontract which is used in restful web service ( for example if we are using the 3rd party web service created by others .... ???
 

thanks in advance
darshan
Posted 2-May-13 5:24am
Comments
Sergey Alexandrovich Kryukov at 2-May-13 11:00am
   
In brief, the client project should have the Data Contract or Service Contract declarations. Basically, you can have the shared assembly referenced by both client and server parts and than deploy both parts...
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If the Service has HttpGet enabled and it is has a Meta Data behavior you can use the ServiceModel Metadata Utility Tool (Svcutil.exe)to create a client proxy.
 

http://msdn.microsoft.com/en-us/library/ms733133.aspx[^]
 
This is the "How to" step for WCF in creating a client that does so. If the 2 constraints mentioned are not possible then you will need a reference library that exposes the interface contract.
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 6,803
1 Sergey Alexandrovich Kryukov 6,377
2 DamithSL 5,421
3 Manas Bhardwaj 4,841
4 Maciej Los 4,330


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 2 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100