Infopath browser enabled form with code behind using IBM iseries .net provider not working when published

Answered Infopath browser enabled form with code behind using IBM iseries .net provider not working when published

  • Friday, March 02, 2012 10:53 PM
     
     
    I have an infopath web browser form that uses the IBM iseries .net Provider to connect to an AS400 system to run a stored procedure. When i am developing with the infopath designer and VSTA it works great in the preview. When i deploy the form as an administrative approved template the form just throws an error and does not give any explanation. No error shows up in the sharepoint operational logs. When i do a trace on the provider, it shows that a connection is being made but no data is returned to the form. Please help.

All Replies

  • Monday, March 05, 2012 12:09 PM
    Moderator
     
     

    Hi Dj,

    We need to use data connection file to access the stored procedure and configured authentication for data connections file in InfoPath Forms Services. And select suitable security level (Domain, Full Trust) for the template in Form Options > Security and Trust category.

    If you haven't used data connection files, please refer to following links to create a form template using data connection files and configure InfoPath Form Services.
    http://blogs.devhorizon.com/reza/2009/04/26/working-with-structured-data-in-microsoft-office-sharepoint-server-2007-part3-browser-enabled-infopath-forms/
    http://technet.microsoft.com/en-us/library/cc303431.aspx

    Best regards,
    Emir


    Emir Liu

    TechNet Community Support

  • Monday, March 05, 2012 2:03 PM
     
     

    Thanks for the response Emir, Being that this is a connection to an AS400 server using the idb2 provider, how do i create the data connection file for that since infopath does not support connections to anything other than SQL?

    Update: After doing a little digging in the log files, this is what i discovered. 

    03/05/2012 10:52:42.32 w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime - Business Logic       82g6 Warning Business logic failed due to an exception. (User: XXX\xxx, Form Name: testdb2, IP: , Request: http://jtssl-sp-test/PMM/_layouts/FormServer.aspx?XsnLocation=http://jtssl-sp-test/FormServerTemplates/testdb2.xsn&SaveLocation=http://jtssl-sp-test/PMM/PMMDataStore&Source=http://jtssl-sp-test/PMM/PMMDataStore/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:testdb2:-myXSD-2012-03-05T00-38-14, Type: SecurityException, Exception Message: Request for the permission of type 'IBM.Data.DB2.iSeries.iDB2Permission, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26' failed.) c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.32 w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime - Business Logic       7tge Medium   Exception thrown from business logic event listener: System.Security.SecurityException: Request for the permission of type 'IBM.Data.DB2.iSeries.iDB2Permission, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26' failed.     at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)     at System.Security.CodeAccessPermission.Demand()     at IBM.Data.DB2.iSeries.iDB2Connection.Open()     at testdb2.FormCode.CTRL2_5_Clicked(Object sender, ClickedEventArgs e)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.<>c__DisplayClass6.<>c__DisplayClass8.<add_Clicked>b__1()     at Microsoft.Office.InfoPath.Server.Util.DocumentReliability.InvokeBusinessLogic(Thunk thunk)     at Microsoft.Of... c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.32* w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime - Business Logic       7tge Medium   ...fice.InfoPath.Server.SolutionLifetime.ButtonEventHost.<>c__DisplayClass6.<add_Clicked>b__0(Object sender, ClickedEventArgs e)     at Microsoft.Office.InfoPath.Server.SolutionLifetime.ButtonEventHost.FireClickedEvent(Document document, ClickedEventArgs args)     at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.CallFormCodeWithExceptionHandling(UserMessages userMessages, OMCall d)  The action that failed was:  Demand  The type of the first permission that failed was:  IBM.Data.DB2.iSeries.iDB2Permission  The first permission that failed was:  <IPermission class="IBM.Data.DB2.iSeries.iDB2Permission, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26"  version="1"  AllowBlankPassword="False">  <add ConnectionString="DataCompression=T... c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.32* w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime - Business Logic       7tge Medium   ...rue; DataSource=FARMTEAM;  UserID=SPDEV;"  KeyRestrictions=""  KeyRestrictionBehavior="AllowOnly"/>  </IPermission>    The demand was for:  <IPermission class="IBM.Data.DB2.iSeries.iDB2Permission, IBM.Data.DB2.iSeries, Version=12.0.0.0, Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26"  version="1"  AllowBlankPassword="False">  <add ConnectionString="DataCompression=True; DataSource=FARMTEAM;  UserID=SPDEV;"  KeyRestrictions=""  KeyRestrictionBehavior="AllowOnly"/>  </IPermission>    The granted set of the failing assembly was:  <PermissionSet class="System.Security.PermissionSet"  version="1">  <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  version="1"  Flags="Execution"/>  <IPermission clas... c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.32* w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime - Business Logic       7tge Medium   ...s="System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  version="1"  PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100AB442BBC16364535051BC5359DC263F216DEAEF0D534082E1B04FC0C4F884C9016E11C0F7E288BE22EC743CBF7F62D71A227FE4BF643437AE775E8AE27B50CA42D8532C264A825D04A7A7ADE02B133DF8B27A7C48151CBB619074FE9B9B5175DC25FB0454DD0A77A30362ABCC2C4E0613EB6FB102D21BA7D70F9E209600132BB"  Name="testdb2"  AssemblyVersion="1.0.4446.34710"/>  <IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  version="1"  Url="file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/"/>  <IPermission class="System.Securi... c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.32* w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime - Business Logic       7tge Medium   ...ty.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  version="1"  Zone="MyComputer"/>  <IPermission class="System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  version="1"  Level="Minimal"/>  <IPermission class="Microsoft.SharePoint.Security.WebPartPermission, Microsoft.SharePoint.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"  version="1"  Connections="True"/>  </PermissionSet>    The assembly or AppDomain that failed was:  testdb2, Version=1.0.4446.34710, Culture=neutral, PublicKeyToken=61c6486462f6102e  The method that caused the failure was:  Void CTRL2_5_Clicked(System.Object, Microsoft.Office.InfoPath.ClickedEventArgs)  The Zone of ... c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.32* w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime - Business Logic       7tge Medium   ...the assembly that failed was:  MyComputer  The Url of the assembly that failed was:  file:///C:/inetpub/wwwroot/wss/VirtualDirectories/80/ c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.33 w3wp.exe (0x1158)                       0x11E8 InfoPath Forms Services       Runtime                       961x Medium   Not persisting state for request due to previous errors. Form Template: urn:schemas-microsoft-com:office:infopath:testdb2:-myXSD-2012-03-05T00-38-14 c4e5fee6-13c6-4a2a-beeb-726eabbb6561
    03/05/2012 10:52:42.33 w3wp.exe (0x1158)                       0x11E8 SharePoint Server             State Service                 8kfs Medium   The StateManager is disposing and calling ReleaseLockedStates() (Count=0) c4e5fee6-13c6-4a2a-beeb-726eabbb6561

    • Edited by Dj Ojo Monday, March 05, 2012 4:58 PM
    •  
  • Tuesday, March 06, 2012 10:58 AM
    Moderator
     
     Answered

    Hi Dj,

    This should be a security issue. Could you please set the  security level for the form template to trust and update the form template to SharePoint? Then change the WSS_Minimal trust setting to full trust for related web app in IIS (see this link for details). Then test it again after restart the web app.

    Best regards,
    Emir


    Emir Liu

    TechNet Community Support

    • Marked As Answer by Dj Ojo Wednesday, March 07, 2012 10:24 PM
    •  
  • Tuesday, March 06, 2012 3:47 PM
     
     

    That solution seems to fix part of the problem. Now the error message i'm getting is below:

    03/06/2012 09:40:25.17 w3wp.exe (0x15E0)                       0x0F14 InfoPath Forms Services       Runtime                       82fu Exception DataObject serialization failure System.ArgumentException: '.', hexadecimal value 0x00, is an invalid character.     at System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(Int32 ch, Byte* pDst, Boolean entitize)     at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)     at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)     at System.Xml.XmlWellFormedWriter.WriteString(String text)     at Microsoft.Office.InfoPath.Server.Xml.XPath.InfoPathXmlText.WriteTo(XmlWriter w)     at System.Xml.XmlElement.WriteContentTo(XmlWriter w)     at System.Xml.XmlElement.WriteTo(XmlWriter w)     at System.Xml.XmlElement.WriteContentTo(XmlWriter w)     at System.Xml.XmlElement.WriteTo(XmlWriter w)     at System.Xml.XmlDocument.Save(XmlWriter w)     at Microsoft.Office.InfoP... 6a08479c-542a-49cd-9a5b-6ecf3d9fc586
    03/06/2012 09:40:25.17* w3wp.exe (0x15E0)                       0x0F14 InfoPath Forms Services       Runtime                       82fu Exception ...ath.Server.DocumentLifetime.DataObject.<>c__DisplayClassb.<Microsoft.Office.InfoPath.Server.Serialization.IBinarySerializable.Serialize>b__5()     at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock) 6a08479c-542a-49cd-9a5b-6ecf3d9fc586


  • Wednesday, March 07, 2012 11:57 AM
    Moderator
     
     Answered

    Hi Dj,

    This log can tell us that your XML document contains some invalid characters, please use the code in following blog to remove it.

    http://seattlesoftware.wordpress.com/2008/09/11/hexadecimal-value-0-is-an-invalid-character/

    Best regards,
    Emir


    Emir Liu

    TechNet Community Support

    • Marked As Answer by Dj Ojo Wednesday, March 07, 2012 10:24 PM
    •  
  • Wednesday, March 07, 2012 10:24 PM
     
     
    I am ecstatic, that resolved the problem, everything is working great. Thank you so much!!