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
p j
NA
128
10.9k
How create a WCF service with a class type parameter
Mar 24 2020 11:16 AM
I'm trying to create a new service UpdateApplicationBidStatus and it should have two parameters -
1. ApplicationBidPayload (class)
2. PartnerId (Int)
ExchangeService.cs
public
ExchangeService: IExchangeService
{
public
int
UpdateApplicationBidStatus(ApplicationBidPayload _InputXml,
string
PartnerId)
{
//------
}
}
IExchangeService.cs
[OperationContract]
[WebGet(UriTemplate =
"/UpdateApplicationBidStatus/{InputXml}/{PartnerId}"
, RequestFormat = WebMessageFormat.Xml)]
int
UpdateApplicationBidStatus(ApplicationBidPayload _InputXml,
string
PartnerId);
ApplicationBidPayload .cs class structure -
[Serializable]
[DataContract]
public
class
ApplicationBidPayload
{
[DataMember]
public
PayloadApplication Applicant {
get
;
set
; }
}
public
class
PayloadPropertyAddress
{
[DataMember]
public
string
Flat {
get
;
set
; }
[DataMember]
public
string
BuildingName {
get
;
set
; }
[DataMember]
public
string
StreetNo {
get
;
set
; }
[DataMember]
public
string
StreetName {
get
;
set
; }
[DataMember]
public
string
Area {
get
;
set
; }
[DataMember]
public
string
Town {
get
;
set
; }
[DataMember]
public
string
County {
get
;
set
; }
[DataMember]
public
string
Postcode {
get
;
set
; }
}
public
class
PayloadApplication
{
[DataMember]
public
string
ApplicationId {
get
;
set
; }
[DataMember]
public
string
PropertyId {
get
;
set
; }
[DataMember]
public
PayloadPropertyAddress PropertyAddress {
get
;
set
; }
[DataMember]
public
string
AdvertCloseDate {
get
;
set
; }
[DataMember]
public
string
BidStatus {
get
;
set
; }
[DataMember]
public
string
BidStatusDate {
get
;
set
; }
[DataMember]
public
string
PropertyLandlord {
get
;
set
; }
}
Getting Error while testing Service -
Error: Cannot obtain Metadata from http://localhost:63494/CBLService/ExchangeApplication.svc If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: http://localhost:63494/CBLService/ExchangeApplication.svc Metadata contains a reference that cannot be resolved: 'http://localhost:63494/CBLService/ExchangeApplication.svc'. The requested service, 'http://localhost:63494/CBLService/ExchangeApplication.svc' could not be activated. See the server's diagnostic trace logs for more information.HTTP GET Error URI: http://localhost:63494/CBLService/ExchangeApplication.svc The HTML document does not contain Web service discovery information.
Reply
Answers (
1
)
String was not recognized as a valid DateTime. in IIS
How to redirect to html page after login with facebook