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


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



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

Your Answer

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

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