locked
CRM 4 web service reference problem... RRS feed

  • Question

  • When i try to add web reference to CRM Service I receive error message:

    Microsoft CRM Unhandled Error Details:

    Server Error in '/' Application.

    The global element 'http://schemas.microsoft.com/crm/2007/WebServicesTongue Tiedtring' has already been declared.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Xml.Schema.XmlSchemaException: The global element 'http://schemas.microsoft.com/crm/2007/WebServicesTongue Tiedtring' has already been declared.

    Source Error:

    An unhandled exception was generated during the execution of the current web request.
    Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [XmlSchemaException: The global element 'http://schemas.microsoft.com/crm/2007/WebServicesTongue Tiedtring' has already been declared.]
    System.Xml.Schema.BaseProcessor.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity) +1478462
    System.Xml.Schema.BaseProcessor.AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item) +1479627
    System.Xml.Schema.Preprocessor.Preprocess(XmlSchema schema, String targetNamespace, ArrayList imports) +2494
    System.Xml.Schema.Preprocessor.Execute(XmlSchema schema, String targetNamespace, Boolean loadExternals) +553
    System.Xml.Serialization.XmlSchemas.Compile(ValidationEventHandler handler, Boolean fullCompile) +1501

    [InvalidOperationException: Schema item 'element' named 'string' from namespace 'http://schemas.microsoft.com/crm/2007/WebServices'.
    The global element 'http://schemas.microsoft.com/crm/2007/WebServicesTongue Tiedtring' has already been declared.]
    System.Xml.Serialization.XmlSchemas.CreateValidationException(XmlSchemaException exception, String message) +736503
    System.Xml.Serialization.XmlSchemas.Compile(ValidationEventHandler handler, Boolean fullCompile) +1590
    System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type type, String url) +432
    Microsoft.Crm.WebServices.AspNetServiceDescriptionLoader.LoadCacheData(AspNetServiceDescriptionCacheKey key, IOrganizationContext context) +44
    Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context) +54
    Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context) +98
    Microsoft.Crm.WebServices.CrmWebServiceWsdlBase.Render(HtmlTextWriter writer) +174
    System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
    System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558

    Anyone can to help me?

    Monday, September 29, 2008 10:28 AM

Answers

  • I found solution!

    Need to comment out (temporary) the following lines of code:

    <protocols>
            <add name="HttpSoap"/>
            <!-- <add name="HttpPost"/> -->
            <!-- <add name="HttpGet"/> -->
    </protocols>


    These lines of code enable the HTTP protocols in the web.config file.
    Thursday, October 2, 2008 9:42 AM

All replies

  • Whats the URL you are referencing?

     

    This is URL i use:

     

     

    OR

     

    Code Snippet

    // Authentication into CRM web services.

    CrmAuthenticationToken token = new CrmAuthenticationToken();

    token.AuthenticationType = 0;

    token.OrganizationName = "CONTOSO";

    CrmService service = new CrmService();

    service.Url = "http://192.168.1.15:5555/mscrmservices/2007/crmservice.asmx";

    service.CrmAuthenticationTokenValue = token;

    service.Credentials = new NetworkCredential("USERNAME", "PASSWORD", "DOMAIN");

     

     

    Monday, September 29, 2008 10:02 PM
  • i use this url:

    http://my_server_ip_address/mscrmservices/2007/CrmService.asmx?WSDL&uniquename=my_organization_name

    i don't use port number because it's port 80 by default.

    but i tried to use also this way:

    http://my_server_ip_address/mscrmservices/2007/CrmServiceWsdl.aspx?uniquename=my_organization_name


    not work Sad

    i receive this error during adding web reference to my project (not in program code).

    Monday, September 29, 2008 11:09 PM
  • Wednesday, October 1, 2008 9:12 PM
  • Karlo S
    Not help to me... Sad
    Thursday, October 2, 2008 6:39 AM
  • HI Mazer,

    1. Using I.E, try browse to http://yourserver:5555/mscrmservices/2007/CrmService.asmx - I assume your server is on port 5555.
    You should see a great deal of xml.

    2. If no 1 worked, create a new windows console project, right click on web references and add the URL (or your server's URL).

    3. What web references do you already have in your project? Do you have any existing references to that URL ?

    Cheers,

    Karlo

    Thursday, October 2, 2008 7:31 AM
  • Hi Karlo,

    1. My server is on port 80.

    2. Not help.
        I receive this error during adding web reference to my project.
        I tried to view CrmService.asmx through Settings -> Customization -> Download Web Service Description Files -> Main Data Web Service - the same error Sad

    3. There is clean project without web references...

    Thanks!
    Thursday, October 2, 2008 7:54 AM
  • I found solution!

    Need to comment out (temporary) the following lines of code:

    <protocols>
            <add name="HttpSoap"/>
            <!-- <add name="HttpPost"/> -->
            <!-- <add name="HttpGet"/> -->
    </protocols>


    These lines of code enable the HTTP protocols in the web.config file.
    Thursday, October 2, 2008 9:42 AM
  • very helpfull, but has any-one an explanation for this?
    rather annoying to do this every time
    Friday, November 14, 2008 9:56 AM
  • We had a similar problem when attempting to download the Web Service description (WSDL) files:

    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: Web Event
    Event ID: 1309

    Exception information:
        Exception type: InvalidOperationException
        Exception message: Schema item 'element' named 'string' from namespace 'http://schemas.microsoft.com/crm/2007/WebServices'. The global element 'http://schemas.microsoft.com/crm/2007/WebServices:string' has already been declared.

    Temporary putting the HttpPost and HttpGet protocols in comment in the web.config files is a valid workaround:

      </system.web>
        <webServices>
          <protocols>
            <add name="HttpSoap" />

              <!-- <add name="HttpPost"/> -->
              <!-- <add name="HttpGet"/> -->

          </protocols>
        </webServices>
      </system.web>

    This is indeed an issue that should be resolved by Microsoft.

    Tuesday, July 26, 2011 3:06 PM
  • Thanks! it's very helpfull!
    Edoardo Molinaro Product Specialist E-Mail: edo106@gmail.com
    Wednesday, September 28, 2011 10:17 AM