<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: How do I return information from webform back to infopath?</title><link>https://www.infopathdev.com:443/forums/thread/23784.aspx</link><pubDate>Wed, 17 Oct 2007 16:03:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23784</guid><dc:creator>samuelpt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23784.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=23784</wfw:commentRss><description>&lt;p&gt;Hi Shiraz,&lt;/p&gt;
&lt;p&gt;Thank you very much for your help.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;don&amp;#39;t know how to do what you propose; the only information I receive from the ASPX page is the http response code (200 or 201 for success, 500 for failure), through objXmlHttp.status. What do I have to do at the ASPX level to send the information, and how to I receive that in the Infopath script?&lt;/p&gt;
&lt;p&gt;By the way, I am required to submit to a web page (ASPX), not to a web service; I don&amp;#39;t know if that somehow changes things.&lt;/p&gt;
&lt;p&gt;Once again, thank you for your help!&lt;/p&gt;
&lt;p&gt;Samuel&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: How do I return information from webform back to infopath?</title><link>https://www.infopathdev.com:443/forums/thread/23767.aspx</link><pubDate>Wed, 17 Oct 2007 14:38:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23767</guid><dc:creator>Shiraz Cupala</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23767.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=23767</wfw:commentRss><description>&lt;p&gt;Hello and welcome to our forum! You&amp;#39;ve run into a classic issue. Essentially you have multiple failure cases from the web service and want to alert the user in different ways. What you have to do is parse the return error value manually in code and then use nested else if statements (quick and dirty) to show the right error message or some other type of error message lookup to an array (better).&lt;/p&gt;</description></item><item><title>How do I return information from webform back to infopath?</title><link>https://www.infopathdev.com:443/forums/thread/23764.aspx</link><pubDate>Wed, 17 Oct 2007 14:19:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:23764</guid><dc:creator>samuelpt</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/23764.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=23764</wfw:commentRss><description>&lt;p&gt;I have an infopath form that submits data to a web form (ASPX).&lt;/p&gt;
&lt;p&gt;In this web form three things might happen:&lt;/p&gt;
&lt;p&gt;1. Success! The form correctly saves data to the database.&lt;/p&gt;
&lt;p&gt;2. Logic error - The user requested an operation that makes no sense (e.g., user asks to save an infopath form that was &amp;quot;closed/locked&amp;quot;)&lt;/p&gt;
&lt;p&gt;3. Exception&amp;nbsp;- Error connecting to the database or doing the insert/update.&lt;/p&gt;
&lt;p&gt;Back in Infopath, I now need to inform the user about the outcome of his request.&lt;/p&gt;
&lt;p&gt;I am already using http status codes to determine wether the operation was successful or not, but how can I return an error code and an error text from ASPX back to infopath?&lt;/p&gt;
&lt;p&gt;Here is the submit code I&amp;nbsp;have:&lt;/p&gt;&lt;font&gt;
&lt;p&gt;function XDocument::OnSubmitRequest(eventObj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; var strUrl=&amp;quot;&lt;a href="http://localhost/projectosWorkflow/wfprojsave.aspx"&gt;http://localhost/projectosWorkflow/wfprojsave.aspx&lt;/a&gt;&amp;quot;;&lt;br /&gt;&amp;nbsp; var objXmlHttp = new ActiveXObject(&amp;quot;MSXML2.XMLHTTP.5.0&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;objXmlHttp.open(&amp;quot;POST&amp;quot;, strUrl, false);&lt;br /&gt;&amp;nbsp;objXmlHttp.send(XDocument.DOM.xml);&lt;br /&gt;&amp;nbsp;var oRespNum&amp;nbsp; = objXmlHttp.status;&lt;br /&gt;&amp;nbsp;if (oRespNum == 200 || oRespNum == 201)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(&amp;quot;Success!&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;eventObj.ReturnStatus = true;&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;else&lt;br /&gt;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(&amp;quot;WEB FORM RETURNED AN ERROR&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;eventObj.ReturnStatus = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp; catch(ex)&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(&amp;quot;ERROR SENDING DATA TO THE WEB FORM.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;eventObj.ReturnStatus = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>