M
Mike Morisoli
I am trying to figure out the proper way to return a .net dataset to
InfoPath so that it likes it and the schema looks normal.
InfoPath seems to want pure standard XML, nothing else. IP SP1 can read a
standard .NET dataset, but the structure is very strange
and convoluted.
Here are some examples that don't work. I am hoping that someone has done
this before and knows a simple way. The only other examples I have found
take the dataset and walk thru it one row at a time creating a series of
arrays and returning an arrary structure for the dataset.
Example 1:
[WebMethod( Description = "Returns a list of all the Axapta vendors we are
authorized to purchase from. Typically used to fill dropdown list
boxes." )]
public DataSet GetAuthorizedVendors()
{
DataSet ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings["ConnectionString
"], "GetAuthorizedVendors");
return ds;
}
I have tried to convert the ds into an XML document using this method, which
is better, but still produces a strange schema.
[WebMethod( Description = "Returns an xml list of all the Axapta vendors we
are authorized to purchase from. Typically used to fill dropdown list
boxes." )]
public XmlDataDocument GetAuthorizedVendorsXML()
{
XmlDataDocument xmlDoc = new XmlDataDocument(this.GetAuthorizedVendors());
return xmlDoc;
}
The only other examples I have seen create a series of array elements which
require a ton of code and will be hard to maintain.
Can anyone provide me with some better ways to go?
Thanks for your time, Mike
InfoPath so that it likes it and the schema looks normal.
InfoPath seems to want pure standard XML, nothing else. IP SP1 can read a
standard .NET dataset, but the structure is very strange
and convoluted.
Here are some examples that don't work. I am hoping that someone has done
this before and knows a simple way. The only other examples I have found
take the dataset and walk thru it one row at a time creating a series of
arrays and returning an arrary structure for the dataset.
Example 1:
[WebMethod( Description = "Returns a list of all the Axapta vendors we are
authorized to purchase from. Typically used to fill dropdown list
boxes." )]
public DataSet GetAuthorizedVendors()
{
DataSet ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings["ConnectionString
"], "GetAuthorizedVendors");
return ds;
}
I have tried to convert the ds into an XML document using this method, which
is better, but still produces a strange schema.
[WebMethod( Description = "Returns an xml list of all the Axapta vendors we
are authorized to purchase from. Typically used to fill dropdown list
boxes." )]
public XmlDataDocument GetAuthorizedVendorsXML()
{
XmlDataDocument xmlDoc = new XmlDataDocument(this.GetAuthorizedVendors());
return xmlDoc;
}
The only other examples I have seen create a series of array elements which
require a ton of code and will be hard to maintain.
Can anyone provide me with some better ways to go?
Thanks for your time, Mike