<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Return complex type (rep. table) from WebService</title><link>https://www.infopathdev.com:443/forums/thread/3758.aspx</link><pubDate>Wed, 03 Jan 2007 11:17:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3758</guid><dc:creator>fahlen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3758.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3758</wfw:commentRss><description>Sorry to have wasted your time. It so happens that all the string fields were marked as required (not allowed to be blank), but the fields of other types not. For these optional fields, I have to set the *Speciefied field to true, in order for it to be included in the SOAP message.&lt;br /&gt;&lt;br /&gt;Cheers.</description></item><item><title>Re: Return complex type (rep. table) from WebService</title><link>https://www.infopathdev.com:443/forums/thread/3757.aspx</link><pubDate>Wed, 03 Jan 2007 10:34:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3757</guid><dc:creator>fahlen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3757.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3757</wfw:commentRss><description>Really stupid error on my part. I had forgotten this line of code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;singleExpense.group1 = new ExpenseInfoPathFormService.group2[1];&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;However, one problem still remains, and I've been struggling with this one for some time. Whenever a field is of a type other than string in the class myFields, they are omitted in the WebMethod reply. Here's an example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt; &lt;br /&gt;- &amp;lt;myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/office/infopath/2003/myXSD/2007-01-02T10:15:45"&amp;gt;&lt;br /&gt;  &amp;lt;name&amp;gt;Markus&amp;lt;/name&amp;gt; &lt;br /&gt;  &amp;lt;date&amp;gt;24/01/2007 0:00:00&amp;lt;/date&amp;gt; &lt;br /&gt;- &amp;lt;group1&amp;gt;&lt;br /&gt;- &amp;lt;group2&amp;gt;&lt;br /&gt;  &amp;lt;projectName&amp;gt;Nombre projecto&amp;lt;/projectName&amp;gt; &lt;br /&gt;  &amp;lt;projectNumber&amp;gt;1003&amp;lt;/projectNumber&amp;gt; &lt;br /&gt;  &amp;lt;/group2&amp;gt;&lt;br /&gt;  &amp;lt;/group1&amp;gt;&lt;br /&gt;  &amp;lt;/myFields&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;group2 really has many more fields, but only projectName and projectNumber are of type string.</description></item><item><title>Return complex type (rep. table) from WebService</title><link>https://www.infopathdev.com:443/forums/thread/1770.aspx</link><pubDate>Wed, 03 Jan 2007 09:58:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1770</guid><dc:creator>fahlen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1770.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1770</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I was hoping someone could help me. I've created an InfoPath form and saved it as source files to get the .xsd file. Then I use xsd.exe to generate the C# file representing the form. I've done this before without any trouble, but now I've included a repeating table and now the WebMethod fails.&lt;br /&gt;&lt;br /&gt;I'm thinking either I don't go about populating the InfoPathFormService.group1 array or the InfoPathFormService.group2 objects which form part of that array, the right way. OR... perhaps the WebMethod doesn't like/permit having arrays as part of objects being returned.&lt;br /&gt;&lt;br /&gt;This is the signature of my method:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;[WebMethod]&lt;br /&gt;public InfoPathFormService.myFields GetExpense(string guid)&lt;br /&gt;{&lt;br /&gt;    //...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The structure of the class is the following (I've cut out everything except the myFields, group1, and group2 declarations):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;namespace InfoPathFormService {&lt;br /&gt;&lt;br /&gt;    public partial class myFields {&lt;br /&gt;        private string nameField;&lt;br /&gt;        private string dateField;&lt;br /&gt;        private group2[] group1Field;&lt;br /&gt;        //...&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public partial class group1 {   &lt;br /&gt;        private group2[] group2Field;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public partial class group2 {&lt;br /&gt;        private string projectNameField;&lt;br /&gt;        //...&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I have gone about populating the fields of the object like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        InfoPathFormService.myFields singleExpense =&lt;br /&gt;            new InfoPathFormService.myFields();&lt;br /&gt;&lt;br /&gt;        // Fetch name and date&lt;br /&gt;        string sql = "SELECT name, date FROM expense_sheet" +&lt;br /&gt;            " WHERE guid='" + guid + "'";&lt;br /&gt;&lt;br /&gt;        DataSet ds = QueryDB(QueryType.Query, sql);&lt;br /&gt;        DataRow row = ds.Tables[0].Rows[0];&lt;br /&gt;&lt;br /&gt;        singleExpense.name = row["name"].ToString();&lt;br /&gt;        singleExpense.date = row["date"].ToString();&lt;br /&gt;&lt;br /&gt;        // Fetch expense entries&lt;br /&gt;        sql = "SELECT pname, pnumber, hotel, mileage, toll FROM expense_entry" +&lt;br /&gt;            " WHERE guid='" + guid + "'";&lt;br /&gt;&lt;br /&gt;        ds = QueryDB(QueryType.Query, sql);&lt;br /&gt;&lt;br /&gt;        InfoPathFormService.group2 expGroup =&lt;br /&gt;            new InfoPathFormService.group2();&lt;br /&gt;&lt;br /&gt;        expGroup.projectName = "A project name";&lt;br /&gt;        expGroup.projectNumber = "1003";&lt;br /&gt;&lt;br /&gt;        singleExpense.group1.SetValue(expGroup, 0);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Could someone please point me in the right direction?&lt;br /&gt;&lt;br /&gt;Thank you.&lt;br /&gt;</description></item></channel></rss>