Hell Patrick,
I tried this, but no luck. What surprises me is that I followed a similar approach in for another InfoPath which was scraping off a SP 2007 web page that had a SPDatasource in it and there was never a problem at all.I just ensured that the data from that page was a well formed XML.
The code in the SharePoint page looks like this:
<%@ Page Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage" ContentType="text/xml" ResponseEncoding="utf-8" %>
<%@ Register Tagprefix="WebPartPages"
Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"
Namespace="Microsoft.SharePoint.WebPartPages" %><WebPartPages:SPUserCodeWebPart FrameType="None"
SuppressWebPartChrome="True" runat="server" AssemblyFullName="IDSWebParts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=11e3ded9dc4537f1" SolutionId="83abfeb7-4747-4aca-9822-bee1a0e2b32c" ID="g_c96983fc_c9b5_409d_b39a_93c431b85927" TypeFullName="IDSWebParts.ExtractInfo.ExtractInfo" WebPart="true" ><Properties>
<WebPartPages:SPUserCodeProperty Name="CountryRegionMappingListName" Value="CountryRegion"></WebPartPages:SPUserCodeProperty>
</Properties>
</WebPartPages:SPUserCodeWebPart>
The code within the web part is something like this:
{
string login = "";
string username = "";
string citycode = "";
string regioncode = "";
string message = "";
try
{
GetInfo(out login, out username, out citycode, out regioncode);
writer.Write("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
message = string.Format("<data>userdata,{0},{1},{2},{3},{4}</data>", login, username, citycode, regioncode,DateTime.Now.ToLongTimeString());
writer.Write(message);
}
catch (Exception ex)
{
message = ex.ToString();
writer.Write(message);
}
}