SOAP Response in WCF
I have created WCF service. It is working fine but our client want response in some specific form. I have shared 2 responses
My Code :
[ServiceContract]
public interface IService
{
[OperationContract]
MyClass GetMyData();
// TODO: Add your service operations here
}
// Use a data contract as illustrated in the sample below to add composite types to service operations. [DataContract] public class MyClass { int _id ; string _name ;
[DataMember]
public int ID
{
get { return _id; }
set { _id = value; }
}
[DataMember]
public string Name
{
get { return _name; }
set { _name = value; }
}
}
Your "Client Expectation" is a XSD file. They are meant to validate SOAP responses, not to be one. There are plenty of services which can validate your XML response based on your XSD.
If you client wants a XSD response, maybe you'll have to look for a tool to do that. I think this might help.
链接地址: http://www.djcxy.com/p/34306.html上一篇: 定制的XSD文件
下一篇: WCF中的SOAP响应