How to Call Webservice method from Infopath form???? - InfoPath Dev
in

InfoPath Dev

How to Call Webservice method from Infopath form????

Last post 03-08-2012 07:57 AM by mydhilig. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 07-23-2009 12:42 AM

    How to Call Webservice method from Infopath form????

    Hi all

    I am new to Infopath

    I have Created a Blank Infopath form and Added a Button. Button Properties-> Edit form Code  -> Written My custom code calling the web-serice from here in Vs2005 When I try to publish this in sharepoint  It is not allowing me to select Document Libabry and by deafult it select "Administrator -approved form Template ( Prepare this form template for an administrator approval)"

    What are steps for submitting a browser enabled Infopath Form to Sql server  using Web-Services? Can I publish this form to Sharepoint. will it work???

    What Template Based on I have to create ???( Blank or Web-service )  

    Any Example  on this ????Any Ideas???  Help me

    Thanks in advance

    Harish

     

  • 07-23-2009 01:55 AM In reply to

    Re: How to Call Webservice method from Infopath form????

    Hi Harish,

    Can you explain in more detail what you are trying to acheive?  Are you trying to submit to SQL server or a web service?

    If you add any custom code to the infopath form, you have to publish it as an administrator approved template.  Publish the template, then upload it into forms services within SharePoint Central Administration.  Activate it to your site collection, then it will be available as a content type for you to use in your forms library.

    Craig

  • 07-23-2009 02:12 AM In reply to

    Re: How to Call Webservice method from Infopath form????

    Hi Criag

    Thanks for the reply

     I need to submit browser enabled Infopath form to SqlServer Database as it is mentioned in below article that we cant submit data directly to Sql server

    We need to use Web-service to submit the data.

    http://blogs.msdn.com/dipper/archive/2007/07/11/about-submit-infopath-form-data-to-microsoft-sql-server-database.aspx

    Thanks

    Harish

     

  • 07-23-2009 02:23 AM In reply to

    Re: How to Call Webservice method from Infopath form????

    Hi Harish,

    I see.  So what problem are you having exactly? 

    Craig

  • 07-23-2009 03:07 AM In reply to

    Re: How to Call Webservice method from Infopath form????

    If I add any custom code to the infopath form. I dont Know how to publish to sharepoint site .  I understood from your previous post how to do it. I have done

    My requirement is I have to design a TimeSheet Template which is Browser Enabled template and publish it to sharepoint site When The data is entered I have to stored the data in Sql so that I can retrieve later to my sharepoint web-part for reports

    Now I am getting the following  error while calling the web-service from the Sharepoint site

    Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
       at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
       at System.Security.CodeAccessPermission.Demand()
       at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
       at System.Net.HttpRequestCreator.Create(Uri Uri)
       at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
       at System.Net.WebRequest.Create(Uri requestUri)
       at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri)
       at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Wb.localhost.Service.InsertToDb()
       at Wb.FormCode.CTRL1_5_Clicked(Object sender, ClickedEventArgs e)
       at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
       at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
    Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
       at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
       at System.Security.CodeAccessPermission.Demand()
       at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
       at System.Net.HttpRequestCreator.Create(Uri Uri)
       at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)
       at System.Net.WebRequest.Create(Uri requestUri)
       at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest(Uri uri)
       at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest(Uri uri)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest(Uri uri)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Wb.localhost.Service.InsertToDb()
       at Wb.FormCode.CTRL1_5_Clicked(Object sender, ClickedEventArgs e)
       at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
       at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

    Any idea??? I need to give any permission ?

    Thnaks a lot

    Harish

     

  • 07-23-2009 03:12 AM In reply to

    Re: How to Call Webservice method from Infopath form????

    Ok, now you just need to give your form permission to make the webservice request.

    In InfoPath, go to Tools > Form Options > Security and Trust and change the security level from automatic to Full Trust.  Then re-publish and re-upload your form.

    Craig

  • 07-23-2009 05:10 AM In reply to

    Re: How to Call Webservice method from Infopath form????

    Thanks A lot Craig

    Its Working  now

     

  • 03-08-2012 07:57 AM In reply to

    Re: How to Call Webservice method from Infopath form????

    Hi,

    I have a similar situation, I am trying to submit my repeating table data to a vb.net web service which submits to a sql server. How do i pass parameters to the web service thru code behind.

    Can you please share your code with me.

    Thanks,

    Mydhili 

     

Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.