web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Setting a proxy server in plugin

(0) ShareShare
ReportReport
Posted on by 1,720

Hi  

I am trying to access a webservice  through plugin and it works fine until I try to set a proxy server. I am using the following code to set the proxy

 

     //Create the SOAP binding for call

            BasicHttpBinding binding = new BasicHttpBinding();

            binding.Security.Mode = BasicHttpSecurityMode.Transport;           

            binding.UseDefaultWebProxy = false;

            binding.ProxyAddress = new Uri(proxyServerUrl);

            soapclient = new SoapClient(binding, new EndpointAddress(new Uri(serviceUrl)));

 

This works fine with my test client and uses the proxy and gets data from service, but when deployed as plugin it throws an exception. This is CRM Online and plugin running under sandbox mode.

 

System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Is there anyway proxy can be set?

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    nghieppham Profile Picture
    4,755 on at

    Hi Hassan,

    Which version are you using? CRM Online or On-premise, CRM Online do not support for accessing third parties, in fact it is limitation of CRM Online, if you want to access from CRM Online, you have use Azure server, first you have to register Azure and host your service in Azure server.

    If you are using CRM Onpremise, register your plugin with None mode, do not use Isoliation mode,

    If it still cannot access, please try to use friendly name of your service do not use IP address.

    Please check this line for Crm Online Limitation https://xrmcenter.wordpress.com/2016/03/31/microsoft-dynamic-crm-limitation/ 

    Regards,

  • Suggested answer
    abhishek_255 Profile Picture
    1,614 on at

    Hi Mir,

    Sandbox plugin has limitations.

    (proxyServerUrl) the server you are calling is an url or an ip address?

    msdn.microsoft.com/.../gg334752.aspx (see Web access)

    If my response helps you, please mark it as "Verified"

    Best Regards,

    Abhishek

  • Mir Hassan Ali Profile Picture
    1,720 on at

    Hi Abhishek

    Its a URL not an IP address.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans