On 22 Feb., 01:42, "Joseph Geretz" <jger...@nospam.com> wrote:
> More info:
>
> I went into the proxy and hand coded it to:
>
> public System.Data.DataTable GetUserProfile()
> {
> object[] results = this.Invoke("GetUserProfile", new object[0]);
> return ((System.Data.DataTable)(results[0]));
>
> }
>
> But the next time I refresh the web service, it reverts back to:
>
> public GetUserProfileResponseGetUserProfileResult GetUserProfile()
> {
> object[] results = this.Invoke("GetUserProfile", new object[0]);
> return ((GetUserProfileResponseGetUserProfileResult)(results[0]));
>
> }
>
> If I have to keep handcoding this every time I need to refresh the proxy
> with the latest Web Service definitions, then this is a non-starter; I'll
> have to go back to using a DataSet, rather than a DataTable.
>
> Any idea what's going wrong here?
>
> Thanks!
>
> - Joseph Geretz -
>
> "Joseph Geretz" <jger...@nospam.com> wrote in message
>
> news:OPVpAghVHHA.4632@TK2MSFTNGP04.phx.gbl...
>
> > Hi Manish,
>
> > I am trying to do as you suggest, however for some reason, the proxy
> > doesn't seem to generate the proper return type.
>
> > Here's the Web Service Method:
>
> > [WebMethod]
> > [SoapHeader("m_Token", Direction = SoapHeaderDirection.InOut)]
> > public DataTable GetUserProfile()
>
> > Here's the line of code I use to call this method:
>
> > DataTable DT = (DataTable) m_ServerApp.GetUserProfile();
>
> > Here's the error which the compiler throws:
>
> > Cannot convert type
> > 'WSAClient.ServerApp.GetUserProfileResponseGetUserProfileResult' to
> > 'System.Data.DataTable'
>
> > I don't get it. What sort of return type is
> > GetUserProfileResponseGetUserProfileResult? (BTW, the cast is irrelevant
> > to this question, without the cast I get 'cannot implicitly convert yada,
> > yada, yada'.)
>
> > BTW, the fellow here is experiencing the same issue, but I didn't see that
> > he got an answer.
>
> >
http://www.thescripts.com/forum/thread430347.html >
> > Anyone have the answer to this problem?
>
> > Thanks!
>
> > - Joseph Geretz -
>
> > "Manish Bafna" <ManishBa...@discussions.microsoft.com> wrote in message
> >news:D0D5DB10-756A-4EF9-B754-0B192091FD4C@microsoft.com...
> >> Hi,
> >> In .NET 2.0 even DataTable is serializable.
>
> >> Thanks and Regards,
> >> Manish Bafna.
> >> MCP and MCTS.
>
> >> "Joseph Geretz" wrote:
>
> >>> I don't get it. A DataTable can't be returned, but a DataSet can. Yet a
> >>> DataSet contains one or more DataTables. So obviously a DataTable must
> >>> be
> >>> serializable. So why not just let me return a DataTable?
>
> >>> Thanks for your advice,
>
> >>> - Joe Geretz -