locked
adding web reference error @ crm 4.0 RRS feed

  • Question

  •  

     Hi everyone;

    i upgrade my crm 3.0 to 4.0 but when i want to add web reference on visual studio(c#) something goes wrong

     

    i m using this url for add webservice :

                   http://<server ip>:<port>/mscrmservices/2007/crmservice.asmx

    when i type url above i m gettin this error :

    i can see functions of service but "Add Reference" button is not enable.             

     

    some sources says  "about registering crm dll s on GAC" but i dont know(think) ?

    is anyone have idea ?!?

    Saturday, March 29, 2008 11:42 AM

Answers

  • Hi,

     

    Inside the CRM UI, if you go to settings and then customization you should see a option to download the Web Services WSDL. Is in the same place where the options for import/export customizations are.

     

    The redirection to CrmServicewsdl.aspx is normal, in version 4 that's the web page that generates the WSDL for CrmWebService. The odd thing is that it shouldn't show that message in Visual Studio in the description area.

    http://localhost:5555/MSCRMServices/2007/CrmServiceWsdl.aspx

     

    Try to navigate with the IE to that address and see if it produces the WSDL. Do you have more than one org? In that case you should use include the name like in this example http://moss:5555/MSCrmServices/2007/CrmServiceWsdl.aspx?uniquename=OrganizationName

     

    Let me know your findings.


    Marco

    Monday, March 31, 2008 9:47 AM
    Moderator

All replies

  • Hi,

     

    It's really odd, I can't give you any idea why if you are seeing the funtions of the web services endpoint the Add Reference button is not working. Are you using any proxy? If that's the case review this KB article that might help to solve the problem http://support.microsoft.com/kb/910804

     

    Anyway, you can try to work around this using the new functionality included in the CRM 4.0 UI to obtain the WSDL file with the web services definition. It's in Settings->Customization->Download Web Service Definition. With this wsdl file you should be able to add the web reference to your Visual Studio project just pointing to this file in the add web reference dialog instead of using the web services url.

     

    Registering the dlls of CRM in the GAC won't solve this problem, the Web Services proxys doesn't require any CRM dll.

     

    I hope that someone can provide you more insight on this.

     

    Marco

    Saturday, March 29, 2008 9:13 PM
    Moderator
  • first thx for reply but i still have error Sad

    i didnt find path that you said "Settings->Customization->Download Web Service Definition" where in it ?

     

    bytheway when i type on adding web reference screen  http://<ip>:<port>/mscrmservices/2007/CrmService.asmx url redirect me to http://<ip>:<port>/mscrmservices/2007/CrmServicewsdl.aspx

     

    and at description area this message shown:

    The HTML document does not contain Web service discovery information.

     

     

    Monday, March 31, 2008 8:25 AM
  • Hi,

     

    Inside the CRM UI, if you go to settings and then customization you should see a option to download the Web Services WSDL. Is in the same place where the options for import/export customizations are.

     

    The redirection to CrmServicewsdl.aspx is normal, in version 4 that's the web page that generates the WSDL for CrmWebService. The odd thing is that it shouldn't show that message in Visual Studio in the description area.

    http://localhost:5555/MSCRMServices/2007/CrmServiceWsdl.aspx

     

    Try to navigate with the IE to that address and see if it produces the WSDL. Do you have more than one org? In that case you should use include the name like in this example http://moss:5555/MSCrmServices/2007/CrmServiceWsdl.aspx?uniquename=OrganizationName

     

    Let me know your findings.


    Marco

    Monday, March 31, 2008 9:47 AM
    Moderator
  • Lots of thx Marco. You r my superman Smile

     

    "?uniquename=OrganizationName"  

     

    That's IT.

    See you [ new cases Big Smile ]

     

    Monday, March 31, 2008 11:57 AM
  • Hey All,

    Thanks for the solution, it pointed me in the right direction but I just wanted to add in another aspect that caused the same symptoms as above and the above solution didn't work.

    During my development, I was VPN'ed into my network on the same domain as the CRM server I was trying developing against.

    When adding the web reference, I had the same issue the the "Add Reference" button not clickable. I added in the "?uniquename=myorg" and I was still running into problems. When reviewing the event logs on the CRM server, it was spitting back Event ID: 1309  errors but as I looked further, it seemed that, even though I was entering a valid user/pwd for accessing the CRM web services, it was trying to access the web service through my domain account that I was logged into the Domain with via VPN.

    I closed my VPN connection, retried adding the web service and voila! It worked...

    HTH

    Dave

    Friday, June 13, 2008 7:04 PM
  • I have a similar problem whn trying to add the CrmService we reference.

    I tried to access the Crm Service via the url: http://localhost:5555/MSCRMServices/2007/CrmServiceWSDL.aspx?uniquename=OrgName

    But it returned an error and the url changed to http://localhost:5555/OrgName/_common/error/errorhandler.aspx?ErrorCode=&RequestUri=%2fMSCrmServices%2f2007%2fCrmServiceWsdl.aspx%3funiquename%3dOrgName&BackUri=

    From CRM, when I tried to get the WSDL files too the same problem occurs. But when I downloaded the MetadataService it works absolutely fine.

    What can be the cause for this problem?

    Regards


    And God said "Let there be Light." ... [Genesis 1:3]
    Wednesday, April 14, 2010 9:07 AM
  • I'm experiencing the exact same problem Paul mentioned. 

    I triple checked the SPN, good there.  If I use an internal user to the system or a domain admin or a service account that has access to CRM, same problem.

    What's unfortunate is the error message is very descriptive "Unexpected Error". 

    The event log message is this:

    Log Name:      Application
    Source:        ASP.NET 2.0.50727.0
    Date:          7/30/2010 2:49:49 PM
    Event ID:      1309
    Task Category: Web Event
    Level:         Warning
    Keywords:      Classic
    User:          N/A
    Computer:      CrmServer.DOMAIN.net
    Description:
    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 7/30/2010 2:49:49 PM
    Event time (UTC): 7/30/2010 6:49:49 PM
    Event ID: 3c69b1b7b92f42e2b11a0af4ae1e9c78
    Event sequence: 10513
    Event occurrence: 53
    Event detail code: 0
     
    Application information:
        Application domain: /LM/W3SVC/1/ROOT-1-129249057601907003
        Trust level: Full
        Application Virtual Path: /
        Application Path: E:\inetpub\wwwroot\
        Machine name: CrmServer
     
    Process information:
        Process ID: 3340
        Process name: w3wp.exe
        Account name: DOMAIN\CrmUser
     
    Exception information:
        Exception type: CrmInvalidOperationException
        Exception message: The metadata for entity '1111' could not be found.
     
    Request information:
        Request URL: http://CrmServer/MSCrmServices/2007/CrmServiceWsdl.aspx?uniquename=CrmCompany
        Request path: /MSCrmServices/2007/CrmServiceWsdl.aspx
        User host address: 10.128.7.78
        User: DOMAIN\CrmUser
        Is authenticated: True
        Authentication Type: Negotiate
        Thread account name: DOMAIN\CrmUser
     
    Thread information:
        Thread ID: 9
        Thread account name: DOMAIN\CrmUser
        Is impersonating: False
        Stack trace:    at Microsoft.Crm.Sdk.EntityMetadatas.GetEntity(Int32 objectTypeCode)
       at Microsoft.Crm.Sdk.ServiceDescription.LoadMessage(SdkMessageType message)
       at Microsoft.Crm.Sdk.ServiceDescription.LoadConfiguration(SdkMessages sdkMessages)
       at Microsoft.Crm.Sdk.ServiceDescription..ctor(Guid organizationId, String targetNamespace, SdkMessages sdkMessages, EntityMetadatas entityMetadatas)
       at Microsoft.Crm.Sdk.ServiceDescriptionCache.ServiceDescriptionCacheLoader.LoadCacheData(String targetNamespace, ExecutionContext context)
       at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Sdk.CrmSchemaFixer..ctor(Guid organizationId, String namespaceName, Boolean renderPrivateMethods)
       at Microsoft.Crm.Sdk.CrmServiceSoapExtensionReflector.ReflectMethod()
       at System.Web.Services.Description.SoapProtocolReflector.AllowExtensionsToReflectMethod()
       at System.Web.Services.Description.SoapProtocolReflector.ReflectMethod()
       at System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding reflectedBinding)
       at System.Web.Services.Description.ProtocolReflector.Reflect()
       at System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[] reflectors)
       at System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type type, String url)
       at Microsoft.Crm.WebServices.AspNetServiceDescriptionCache.AspNetServiceDescriptionLoader.LoadCacheData(AspNetServiceDescriptionCacheKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.WebServices.CrmWebServiceWsdlBase.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     
     
    Custom event details:

    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="ASP.NET 2.0.50727.0" />
        <EventID Qualifiers="32768">1309</EventID>
        <Level>3</Level>
        <Task>3</Task>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2010-07-30T18:49:49.000Z" />
        <EventRecordID>30912</EventRecordID>
        <Channel>Application</Channel>
        <Computer>CrmServer.DOMAIN.net</Computer>
        <Security />
      </System>
      <EventData>
        <Data>3005</Data>
        <Data>An unhandled exception has occurred.</Data>
        <Data>7/30/2010 2:49:49 PM</Data>
        <Data>7/30/2010 6:49:49 PM</Data>
        <Data>3c69b1b7b92f42e2b11a0af4ae1e9c78</Data>
        <Data>10513</Data>
        <Data>53</Data>
        <Data>0</Data>
        <Data>/LM/W3SVC/1/ROOT-1-129249057601907003</Data>
        <Data>Full</Data>
        <Data>/</Data>
        <Data>E:\inetpub\wwwroot\</Data>
        <Data>CrmServer</Data>
        <Data>
        </Data>
        <Data>3340</Data>
        <Data>w3wp.exe</Data>
        <Data>DOMAIN\CrmUser</Data>
        <Data>CrmInvalidOperationException</Data>
        <Data>The metadata for entity '1111' could not be found.</Data>
        <Data>http://CrmServer/MSCrmServices/2007/CrmServiceWsdl.aspx?uniquename=CrmCompany</Data>
        <Data>/MSCrmServices/2007/CrmServiceWsdl.aspx</Data>
        <Data>10.128.7.78</Data>
        <Data>DOMAIN\CrmUser</Data>
        <Data>True</Data>
        <Data>Negotiate</Data>
        <Data>DOMAIN\CrmUser</Data>
        <Data>9</Data>
        <Data>DOMAIN\CrmUser</Data>
        <Data>False</Data>
        <Data>   at Microsoft.Crm.Sdk.EntityMetadatas.GetEntity(Int32 objectTypeCode)
       at Microsoft.Crm.Sdk.ServiceDescription.LoadMessage(SdkMessageType message)
       at Microsoft.Crm.Sdk.ServiceDescription.LoadConfiguration(SdkMessages sdkMessages)
       at Microsoft.Crm.Sdk.ServiceDescription..ctor(Guid organizationId, String targetNamespace, SdkMessages sdkMessages, EntityMetadatas entityMetadatas)
       at Microsoft.Crm.Sdk.ServiceDescriptionCache.ServiceDescriptionCacheLoader.LoadCacheData(String targetNamespace, ExecutionContext context)
       at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Sdk.CrmSchemaFixer..ctor(Guid organizationId, String namespaceName, Boolean renderPrivateMethods)
       at Microsoft.Crm.Sdk.CrmServiceSoapExtensionReflector.ReflectMethod()
       at System.Web.Services.Description.SoapProtocolReflector.AllowExtensionsToReflectMethod()
       at System.Web.Services.Description.SoapProtocolReflector.ReflectMethod()
       at System.Web.Services.Description.ProtocolReflector.ReflectBinding(ReflectedBinding reflectedBinding)
       at System.Web.Services.Description.ProtocolReflector.Reflect()
       at System.Web.Services.Description.ServiceDescriptionReflector.ReflectInternal(ProtocolReflector[] reflectors)
       at System.Web.Services.Description.ServiceDescriptionReflector.Reflect(Type type, String url)
       at Microsoft.Crm.WebServices.AspNetServiceDescriptionCache.AspNetServiceDescriptionLoader.LoadCacheData(AspNetServiceDescriptionCacheKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.CreateEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.Caching.CrmMultiOrgCache`2.LookupEntry(TKey key, IOrganizationContext context)
       at Microsoft.Crm.WebServices.CrmWebServiceWsdlBase.Render(HtmlTextWriter writer)
       at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
       at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    </Data>
      </EventData>
    </Event>

    Also, Update Rollup 10 is applied.

    Anyone else seeing something similar to this?

    Thanks

    Ted

    Friday, July 30, 2010 7:41 PM
  • Since this post was already answered and mine is somewhat of a new issue, I'll post separately.

    Thursday, August 5, 2010 12:13 PM