locked
CRM/Webservice URL error RRS feed

  • Question

  • Hi All,

    I am using the following code

            public void ConnectToService(string connection_string)
            {
                Microsoft.Xrm.Client.CrmConnection connection = CrmConnection.Parse(Settings.Default.Conn);
                 _orgService = new OrganizationService(connection);
            }

    And am getting the following error:

    An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll

    Additional information: Format of the initialization string does not conform to specification starting at index 182.

    My connection string that i use is (including quotes):

    "Server=iviewtest.**********,organization=iviewtest,user=CRMInteractiveWS@**********" connectionString="Url=https://iviewtest.**********/;Username=CRMInteractiveWS;Password=********;"

    Any ideas?

    Regards,

    Ben


    • Edited by Ben Riches Thursday, September 15, 2016 9:49 AM Wrong title
    • Moved by Sabah ShariqMVP Thursday, September 15, 2016 11:04 AM Related to CRM
    Thursday, September 15, 2016 9:43 AM

All replies

  • Hi Ben,

    You might be doing your connection wrong. For more info:

    ArgumentException Class

    Connection String

    Hope this helps you.

    Thanks,

    Sabah Shariq

    Thursday, September 15, 2016 10:15 AM
  • I imagine it is :).

    The connection string site, was useful, however i could not find anything to do with CRM connection in there.

    Thanks,

    Ben

    Thursday, September 15, 2016 10:45 AM
  • For on-premises Microsoft Dynamics CRM

    Use the following URL to access the discovery service:

    http://ServerName/XRMServices/2011/Discovery.svc

    For Microsoft Dynamics CRM Online

    Use the following URLs to access the organization service (SOAP endpoint):

    https://OrganizationName.api.crm.dynamics.com/XrmServices/2011/Organization.svc (North America)

    https://OrganizationName.api.crm2.dynamics.com/XrmServices/2011/Organization.svc (South America)

    https://OrganizationName.api.crm3.dynamics.com/XrmServices/2011/Organization.svc (Canada)

    https://OrganizationName.api.crm4.dynamics.com/XrmServices/2011/Organization.svc (EMEA)

    https://OrganizationName.api.crm5.dynamics.com/XrmServices/2011/Organization.svc (APAC)

    https://OrganizationName.api.crm6.dynamics.com/XrmServices/2011/Organization.svc (Oceania)

    https://OrganizationName.api.crm7.dynamics.com/XrmServices/2011/Organization.svc (Japan)

    https://OrganizationName.api.crm8.dynamics.com/XrmServices/2011/Organization.svc (India)

    https://OrganizationName.api.crm9.dynamics.com/XrmServices/2011/Organization.svc (North America 2)

    For on-premises Microsoft Dynamics CRM

    Use the following URL to access the organization service (SOAP endpoint):

    http[s]://ServerName/OrganizationName/XRMServices/2011/Organization.svc

    Thanks !!

    Thursday, September 15, 2016 10:54 AM
  • Hi Ben,

    As your issue is related to CRM and this is a VIsual C# forum. I moved you post to Dynamics forum for getting quick response.

    Thanks,

    Sabah Shariq

    Thursday, September 15, 2016 11:05 AM
  • Hi All,

    Thanks for you replies. i have eventually resolved the connection issue.

    Now i am troubled with the following error:

    [17672] Connected To Service

    [17672] Metadata contains a reference that cannot be resolved: 'https://iviewtest.rhp.org.uk/, Username=******, Password=*******,/XRMServices/2011/Organization.svc?wsdl'.

    We are calling the service from a windows service. I have changed the service account that it runs under, but still get this lovely error.

    Any idea?

    Regards,

    Ben

    Thursday, October 6, 2016 1:01 PM