Answered by:
How to use Http Proxy with CRM 2011 sdk?

Question
-
I want to use Http Proxy with each web service call using CRM 2011 SDK?
Ronak PatelMonday, October 17, 2011 3:44 PM
Answers
-
I would suggest downloading the SDK: http://www.microsoft.com/download/en/details.aspx?id=24004
Look at the Soap Logger solution and also the plugin registration tool to see how they are connecting to CRM. Once you understand that you can create a proxy that lives in IIS that acts the same way. Then you can define whatever interface you want on the other side of the proxy and let the proxy handle the CRM communications using a known set of user credentials or a set that is passed through the proxy.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
- Marked as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
Monday, October 17, 2011 8:14 PMModerator -
Yup, it's wired up differently to get the service depending on whether it's in a plugin or another type of app though. I would look at how the SDK and SOAP logger are hooking up. There is a helpers common code file they are using that you could also use in your code also.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
- Marked as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
Tuesday, October 18, 2011 3:46 PMModerator
All replies
-
I would suggest downloading the SDK: http://www.microsoft.com/download/en/details.aspx?id=24004
Look at the Soap Logger solution and also the plugin registration tool to see how they are connecting to CRM. Once you understand that you can create a proxy that lives in IIS that acts the same way. Then you can define whatever interface you want on the other side of the proxy and let the proxy handle the CRM communications using a known set of user credentials or a set that is passed through the proxy.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
- Marked as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
Monday, October 17, 2011 8:14 PMModerator -
Hi Jamie,
All I want to do is something like this..
using (OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(serverConfig.OrganizationUri,
serverConfig.HomeRealmUri,
serverConfig.Credentials,
serverConfig.DeviceCredentials))
{// Http Proxy
WebProxy httpProxy = new WebProxy(proxy.Server, proxy.Port);
if (!string.IsNullOrEmpty(proxy.Username) &&
!string.IsNullOrEmpty(proxy.Password))
{
httpProxy.Credentials = new NetworkCredential(proxy.Username, proxy.Password);
}
serviceProxy .Proxy = httpProxy;
}
Ronak PatelTuesday, October 18, 2011 3:26 PM -
Yup, it's wired up differently to get the service depending on whether it's in a plugin or another type of app though. I would look at how the SDK and SOAP logger are hooking up. There is a helpers common code file they are using that you could also use in your code also.
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
- Marked as answer by Jamie MileyModerator Wednesday, July 11, 2012 6:15 PM
Tuesday, October 18, 2011 3:46 PMModerator -
Hi Jamie,
The Soap Logger sample you cite may help if your goal is to simply log the requests going through. But what if the requirement is that your client must access the server through an HTTP proxy, which itself may require credentials? Ronak's example is how you would handle that scenario with the legacy API. We need a way to do this with the 2011 API.
Any ideas?
Richard
Thursday, February 28, 2013 11:46 PM