Under SharePoint, can read from Web service but not write

B

Bob D.

I've created an InfoPath form with a button that, when clicked, extracts some
information from the form, passes it to a Web service, and then displays the
result of the service call in another form field. I created the form and the
Web service within a single VS.NET solution. When I run the whole mess under
VS.NET, everything works fine. If I publish the form to a file system and run
it outside of VS.NET, it also works fine.

I run into trouble, though, when I publish the form to a SharePoint forms
library. When attempting to fill out a form published in this way, I can
successfully call methods within my Web service that produce output only
(i.e., no incoming parameters). However, if I attempt to call the method that
calculates a value as a result of the button-click event (a method that has
two input parameters), I get this error:

InfoPath cannot complete this action because of an error in the form's
code.

The details and stack included in the message box are these:

Request for the permission of type System.Net.WebPermission, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
at System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(PermissionToken
permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32
checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission
cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
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 EstimationService.SoftwareEstimator.WeightedAverageSize(String[]
ranks, Int32[] sizes) in D:\SPI\P4\CMM\Software Estimation
Tools\EstimationForm\Web References\EstimationService\Reference.vb:line 42
at
EstimationForm.EstimationForm.CalculateNominalSizeBtn_OnClick(DocActionEvent
e) in D:\SPI\P4\CMM\Software Estimation Tools\EstimationForm\FormCode.vb:line
82
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

The stack frame three from the bottom
("SoftwareEstimator.WeightedAverageSize") is the Web service method I'm
trying to call.

I've tried all seemingly applicable solutions described in other notes
discussing problems with InfoPath, SharePoint, and Web services. That
includes creating a new Web site on my SharePoint server and installing my
Web service to that site. Nothing has had an effect. It doesn't matter if the
Web service and SharePoint are on the same domain or different domains, the
same host or different hosts.

Can someone suggest a solution to this problem?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top