The request failed with HTTP status 401: Unauthorized.

Apr 22, 2010 at 3:17 PM

I am getting the following error, does anyone know how to get around this?

C:\CRMM2M>CRMAssocManyToMany.exe "hah_diagnosis_hah_patientcarerecord" "hah_diag
nosis" "hah_patientcarerecord" "c:\crmM2M\data.csv"
ERROR
The request failed with HTTP status 401: Unauthorized.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClie
ntMessage message, WebResponse response, Stream responseStream, Boolean asyncCal
l)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodN
ame, Object[] parameters)
   at CRMAssocManyToMany.CrmSdk.CrmService.Execute(Request Request)
   at CRMAssocManyToMany.Program.Main(String[] args)
0 Associations Imported Succesfully

Coordinator
Sep 7, 2010 at 10:41 PM

Sorry, didn't have notification of discussions turned on!

Bit untimely of a reply, but I would say either the organisation name or the server url is incorrect, either that or the user you are using does not have access.

Cheers

Matt

 

Dec 22, 2011 at 9:43 AM

I have the same error.(Already wrote you a message) I have windows integrated authentication on the server. I run the command prompt from the admin account directly on the server.

How can I specify the appropriate user for the programm run, or how can i check the user which is used by programm?

P.s.

I double checked the org name, table name and server url - they are correct

Thank You!

Dec 22, 2011 at 10:28 AM
Edited Dec 22, 2011 at 10:30 AM

Also i have another error,

In previous example import prompt was

C:\temp\CRMManyToMany-52176\Executable\CRMAssocManyToMany.exe import "http://mscrmcall:5555" "Databasename"  "diam_account_contactBase"  "account" "contact" "C:\temp\test BULK import\test2_imp_manytomany.txt"

Parameter OrgName  was equal to the Databasename of MSCRM

When i change it to the real org name, as i found recently in CRM C:\temp\CRMManyToMany-52176\Executable\CRMAssocManyToMany.exe import "http://mscrmcall:5555" "OrgName"  "diam_account_contactBase"  "account" "contact" "C:\temp\test BULK import\test2_imp_manytomany.txt"

then i have error

Error Line 1, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

Error Line 2, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

Error Line 3, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

Error Line 4, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

4 Associations Processed with 4 Errors

 

But i have such table in the database

Coordinator
Dec 22, 2011 at 9:22 PM
Syotik wrote:

I have the same error.(Already wrote you a message) I have windows integrated authentication on the server. I run the command prompt from the admin account directly on the server.

How can I specify the appropriate user for the programm run, or how can i check the user which is used by programm?

P.s.

I double checked the org name, table name and server url - they are correct

Thank You!


Ok, so when you say "Admin" is this a Windows Admin or CRM Admin?  A CRM System Admin in CRM needs to be given the "System Administrator" role inside CRM.  You don't have to run as admin, but the user you run as must have access to create the relationship between the two entities you're trying to import data for (i.e. can the user create a N:N relationship using the UI?).

To specify which user to use, you either log in as the user which has permissions and start up a command line and run it from there, or you can find the command line icon in windows, hold down shift and right click it then choose "Run as different user" (this works in Windows 2008, you may need to do it differently in Windows 2003).

 

Coordinator
Dec 22, 2011 at 9:30 PM
Edited Dec 22, 2011 at 9:30 PM
Syotik wrote:

Also i have another error,

In previous example import prompt was

C:\temp\CRMManyToMany-52176\Executable\CRMAssocManyToMany.exe import "http://mscrmcall:5555" "Databasename"  "diam_account_contactBase"  "account" "contact" "C:\temp\test BULK import\test2_imp_manytomany.txt"

Parameter OrgName  was equal to the Databasename of MSCRM

When i change it to the real org name, as i found recently in CRM C:\temp\CRMManyToMany-52176\Executable\CRMAssocManyToMany.exe import "http://mscrmcall:5555" "OrgName"  "diam_account_contactBase"  "account" "contact" "C:\temp\test BULK import\test2_imp_manytomany.txt"

then i have error

Error Line 1, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

Error Line 2, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

Error Line 3, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

Error Line 4, Error Message:
  0x8004024a
  Entity Relationship diam_account_contactBase was not found in the metadata

  Platform

4 Associations Processed with 4 Errors

 

But i have such table in the database

You are looking at the database tables, look at the views instead.  You should find a view called "diam_account_contact".  Change it to the view name and you should be good to go.

Dec 23, 2011 at 9:04 AM
yes, you are absolutely right. The problem was that i am looking in the database tables not in views. After i corrected the destination table name to the name of appropriate view, everything works correctly!
Have a nice day!
Best regards,
Sergey Budyak

2011/12/22 mhunter <notifications@codeplex.com>

From: mhunter

Syotik wrote:

Also i have another error,

In previous example import prompt was

C:\temp\CRMManyToMany-52176\Executable\CRMAssocManyToMany.exe import "http://mscrmcall:5555" "Databasename" "diam_account_contactBase" "account" "contact" "C:\temp\test BULK import\test2_imp_manytomany.txt"

Parameter OrgName was equal to the Databasename of MSCRM

When i change it to the real org name, as i found recently in CRM C:\temp\CRMManyToMany-52176\Executable\CRMAssocManyToMany.exe import "http://mscrmcall:5555" "OrgName" "diam_account_contactBase" "account" "contact" "C:\temp\test BULK import\test2_imp_manytomany.txt"

then i have error

Error Line 1, Error Message:
0x8004024a
Entity Relationship diam_account_contactBase was not found in the metadata

Platform

Error Line 2, Error Message:
0x8004024a
Entity Relationship diam_account_contactBase was not found in the metadata

Platform

Error Line 3, Error Message:
0x8004024a
Entity Relationship diam_account_contactBase was not found in the metadata

Platform

Error Line 4, Error Message:
0x8004024a
Entity Relationship diam_account_contactBase was not found in the metadata

Platform

4 Associations Processed with 4 Errors

But i have such table in the database

You are looking at the database tables, look at the views instead. You should find a view called "diam_account_contact". Change it to the view and you should be good to go.

Read the full discussion online.

To add a post to this discussion, reply to this email (CRMManyToMany@discussions.codeplex.com)

To start a new discussion for this project, email CRMManyToMany@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Dec 23, 2011 at 1:10 PM

Everything is fine. The error was in the table name.