Secuity problem InfoPath calling Web Service - InfoPath Dev
in

InfoPath Dev

Secuity problem InfoPath calling Web Service

Last post 02-11-2007 07:44 AM by nukkumatti. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-09-2007 05:39 AM

    • snufse
    • Not Ranked
    • Joined on 02-01-2007
    • USA
    • Posts 12

    Secuity problem InfoPath calling Web Service

    When calling a web service I get security error:


    SecurityException was unhandled by user code.

    Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


    Here is the code:

    Public Sub identificationNumber_Changed(ByVal sender As Object, ByVal e As XmlEventArgs)
    ' Write your code here to change the main data source.

    Dim myNav As XPathNavigator = Me.MainDataSource.CreateNavigator
    Dim MyString As String

    MyString = myNav.SelectSingleNode("//my:identificationNumber", Me.NamespaceManager).Value.ToString

    If MyString > "0" Then
    Dim MyInteger As Integer
    MyInteger = MyString
    Dim MyWebService As New WebServiceTest1.Service
    MyString = MyWebService.GetEmployeeName(MyInteger)
    myNav.SelectSingleNode("//my:name", Me.NamespaceManager). _
    SetValue(MyString)
    End If

    End Sub
  • 02-09-2007 06:44 AM In reply to

    Re: Secuity problem InfoPath calling Web Service

    Not to sure but try the following:

    Got to Start -> Administartive Tool -> Microsoft .Net Framework (in your case i guess 2.0) Configuration wizard.

    In the configuration wizard expand Runtime Security Service -> Machine -> Code Gourps and then select All_Code. Then click the link on the right side Configure Code Access Security. Switch to the permission tab and select from the dorp down list Full Trust instead of Nothing.

    It could also be that you have to set your InfoPath form to full trust und Tools -> Form options -> security.
    Listen to Motörhead cos they play Rock'n Roll :)
  • 02-09-2007 07:08 AM In reply to

    • snufse
    • Not Ranked
    • Joined on 02-01-2007
    • USA
    • Posts 12

    Re: Secuity problem InfoPath calling Web Service

    Fantastic, it worked, you saved my day ...... Vielen Dank .......
  • 02-09-2007 07:39 AM In reply to

    Re: Secuity problem InfoPath calling Web Service

    Your welcome. Just keep in mind you propably have to change this setting later on every users machine BUT...

    Here is a little help:

    open again the .NET Framework 2.0 Configuration
    Click once on My Computer. In the right panel click on Create Deploymnet Package. Select a location to where you want to save the Windows Installer Package and name it FullTrustConfigurator for example. There you go, deploy this msi together with your infopath solution. Each user has to run (takes a second) this package once on his machine and you are out of any maintanance (which is always good :) )

    Have a nice weekend.
    Listen to Motörhead cos they play Rock'n Roll :)
  • 02-09-2007 03:18 PM In reply to

    Re: Secuity problem InfoPath calling Web Service

    Hey Jerome,
    Sending out an MSI to force full trust is not a best practice. There are numerous reasons why, but the main is that if everyone did that it would be akin to the DLL HELL we had back in the old days. Not to mention the huge security hole.

    Rolf, are you calling the Web service from code? Why not use the default InfoPath data objects to do this? They don't require full trust.

    Cheers!
    Patrick Halstead
    Project Manager at Qdabra
  • 02-11-2007 07:44 AM In reply to

    Re: Secuity problem InfoPath calling Web Service

    Good Point Patrick.
    Listen to Motörhead cos they play Rock'n Roll :)
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.