Hello all,
I am stuck while creating connection from ssis package to online crm through sdk.
Here is my code to connect :
ClientCredentials client = new ClientCredentials();
client.UserName.UserName = "ritu@sitaindia.onmicrosoft.com";
client.UserName.Password = "pass@123";
proxy = new OrganizationServiceProxy(new Uri("https://sitaindia.api.crm5.dynamics.com/XRMServices/2011/Organization.svc"), null, client, null);
proxy.EnableProxyTypes();
service = (IOrganizationService)proxy;
But its prompting me error
[Script Component [371]] Error: System.InvalidOperationException: Metadata contains a reference that cannot be resolved: 'https://xyz.api.crm5.dynamics.com/XRMServices/2011/Organization.svc?wsdl&sdkversion=7.1'. ---> System.Net.WebException: The remote
server returned an error: (407) Proxy Authentication Required.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.DownloadMetadata(TimeoutHelper timeoutHelper)
at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
--- End of inner exception stack trace ---
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PreExecute()
at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPreExecute(IDTSManagedComponentWrapper100 wrapper)
Please help
Thanx in advance !!