Looking for some collective wisdom. Here is the situation. This is using Visual Studio 2008.
We have a simple WCF contract exposing the following method:
DataSet ExecuteQuery (out string someStuff);
This method is implemented as:
public DataSet ExecuteQuery (out string someStuff) { someStuff = "abc"; return new DataSet(); // simplified }
Client side proxy is generated by svcutil, and appears to be correct.
Problem:
someStuff
is always null on the client side.
Observations:
- Same problem appears on our build machine.
Returning a string instead of DataSet makes client proxy receive proper value of out parameter:
public string ExecuteQuery(out string someStuff) ...
Removing the client proxy completely and regenerating it doesn't help.
- Client definitely receives both DataSet and the "out" string, as seen in its trace log:
<ExecuteQueryResponse xmlns="http://tempuri.org/">
<ExecuteQueryResult>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded"></xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"></diffgr:diffgram>
</ExecuteQueryResult>
<someStuff>abc</someStuff>
</ExecuteQueryResponse>
Here is how the client proxy generates the code:
[System.ServiceModel.OperationContractAttribute (Action="http://tempuri.org/IQueryContract/ExecuteQuery", ReplyAction="http://tempuri.org/IQueryContract/ExecuteQueryResponse")] [System.ServiceModel.XmlSerializerFormatAttribute()] System.Data.DataSet ExecuteQuery(out string someStuff);
- We use netTcpBinding
Do we need to do anything special in order to return DataSet and out parameters? Anyone has come across anything similar?
Thanks!!!!