1

I have web service which I want to call in my sandbox visual web part.

when I'm call web service method in web part at that time I'm getting this error Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.

1 Answer 1

1

We can not call webservice in sand box solution(It's does not support).The reason behind of this sand box solution support only full trust code.One or more assemblies referenced by the XmlSerializer cannot be called from partially trusted code.

You need to extend the sandboxed solution by making use of SPProxyOperation and SPProxyOperationArgs. Some examples of extending a sandboxed solutions are

http://blah.winsmarts.com/2009-12-SharePoint_2010_Sandboxed_Solutions__Full_Trust__Proxies.aspx

http://vimleshtiwari.blogspot.com/2010/06/calling-web-service-in-sandbox-solution.html

Also check : http://sandboxwebservice.codeplex.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.