I am using the SOAP 1.1 request and response to create a corresponding web
method for it.
SOAP 1.1 response looks like as follows :
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetPostsResponse xmlns="http://tempuri.org/">
<PostSet>
<TotalRecords>int</TotalRecords>
<Posts>
<anyType />
<anyType />
</Posts>
</PostSet>
</GetPostsResponse>
</soap:Body>
</soap:Envelope>
However the SOAP 1.1 response generated for the web method I am writing is
as follows:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetPostsResponse xmlns="http://tempuri.org/">
<GetPostsResult>
<PostSet>
<TotalRecords xmlns="http://namespace.org/">int</TotalRecords>
<Posts xmlns="http://namespace.org/">
<anyType />
<anyType />
</Posts>
</PostSet>
<PostSet>
<TotalRecords xmlns="http://namespace.org/">int</TotalRecords>
<Posts xmlns="http://namespace.org/">
<anyType />
<anyType />
</Posts>
</PostSet>
</GetPostsResult>
</GetPostsResponse>
</soap:Body>
</soap:Envelope>
The dummy web method I have written is as follows
[WebMethod]
public PostSet[] GetPosts(int postID, int pageIndex, int pageSize, int
sortBy, int sortOrder, int userID, bool returnRecordCount)
{
PostSet[] _ArrPostSet = new PostSet[0];
int dt = 0;
_ArrPostSet[0].TotalRecords = dt;
object[] test = new object[1];
_ArrPostSet[0].Posts = test;
return _ArrPostSet;
}
where PostSet is a class
What Data Type should I implement to generate a soap response as above.?