Answer the question
In order to leave comments, you need to log in
How to correctly specify namespacs in WCF services?
When developing SOAP services, such a problem arose. All messages (XML), incoming or outgoing, have the following structure
For example:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns5:cancelBookingResponse xmlns:ns2="http://epgu.rtlabs.ru/equeue/ws/types/" xmlns:ns3="http://smev.gosuslugi.ru/rev120315" xmlns:ns4="http://www.w3.org/2004/08/xop/include" xmlns:ns5="http://epgu.rtlabs.ru/equeue/ws/"><ns3:Message><ns3:Status>RESULT</ns3:Status></ns3:Message><ns3:MessageData><ns3:AppData><ns5:bookId>710019_2</ns5:bookId><ns5:status><ns2:statusCode>201</ns2:statusCode><ns2:statusMessage>Отозвано</ns2:statusMessage></ns5:status></ns3:AppData></ns3:MessageData></ns5:cancelBookingResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
/// <summary>
///
/// </summary>
[DataContract(Namespace = "http://epgu.rtlabs.ru/equeue/ws/")]
public class AppDataBase
{
}
[DataContract]
public class AppDataInCancelBooking : AppDataBase
{
/// <summary>
///
/// </summary>
[DataMember]
public string BookId { get; set; }
/// <summary>
///
/// </summary>
[DataMember]
public string EsiaId { get; set; }
/// <summary>
///
/// </summary>
[DataMember]
public string Password { get; set; }
}
Answer the question
In order to leave comments, you need to log in
Not an option to simply add a link to the WCF service to Visual Studio, will it generate classes for you?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question