websitecopy help

May 26, 2010 at 3:05 PM

Hello fellow bleeding-edge early adopters!

I am having a world of trouble with the final step of implementation websitecopy.  I know there was some discussion about it another thread, but none of those comments fixed my problem and it was clouding up that thread, so I started a new one...

I have created an empty website at http://crmserver:83 (where CRM is at http://crmserver:80 or just https://crmserver) and set anonymous access to be done with the CRM Administrator account, which is a local admin of the server.  I cannot browse to the site, which doesn't surprise me since there is nothing there.  The virtual directory points to an empty folder on the server's D drive.

Here is the command I am issuing:
websitecopy /targetConnectionString:"Authentication Type=AD; Server=http://crmserver:83; User ID=DOMAIN\username; Password=password;" /targetWebsiteName:"Customer Portal" /sourceFile:D:\Temp\CUSTOMER_PORTAL_RTW_R1\Installation\Customizations\customerportal.xml

After a few second, websitecopy crashes and delivers this stack trace:
Importing website 'Customer Portal'...

Unhandled Exception: System.Net.WebException: The request failed with HTTP status 404: Not Found.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Crm.SdkTypeProxy.CrmService.Execute(Request Request)
   at Microsoft.Xrm.Client.Services.CrmServiceWrapper.Execute(Object request)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.InnerExecute(Request request)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute[TRequest,TResponse,TResult](TRequest query, Func`2 execute, Func`2 selector)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.<>c__DisplayClass8`3.<LookupAndInsert>b__6(String _)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass5`1.<Get>b__4(String k)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass2`1.<Get>b__0(Mutex _)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.LookupAndInsert[TRequest,TResponse,TResult](TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Get[TRequest,TResponse,TResult](TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute[TRequest,TResponse,TResult](TRequest request, Func`2 execute, Func`2 selector, StringselectorCacheKey)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Execute[T](Requestrequest, Func`2 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](Request request, Func`5 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](Request request, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](Request request)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.RetrieveMultiple(QueryBase query)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.<>c__DisplayClassc.<Execute>b__b(IOrganizationService service)
   at Microsoft.Xrm.Client.Services.IOrganizationServiceExtensions.Using[T](Func`1 create, Func`2 action)
   at Microsoft.Xrm.Client.Data.Services.BaseDataContext.UsingService[T](Func`2action)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.UsingService[T](Func`2 action)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute(QueryExpression qe, LambdaExpression projection, Type entityType)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute[TElement](QueryExpression qe, LambdaExpression projection, Delegate postMethodCall, LambdaExpression filter, Type entityType)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute[TElement](Expression expression)
   at Microsoft.Xrm.Client.Linq.QueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
   at WebsiteCopy.WebsiteImporter.ImportWebsite(ICrmDataContext crm, String websiteName, XElement websiteElement, Boolean isSubscriber, IDictionary`2 keyMapping)
   at WebsiteCopy.WebsiteImporter.Import(XElement element, String websiteName)
   at WebsiteCopy.WebsiteImporter.Import(Stream input, String websiteName)
   at WebsiteCopy.WebsiteImporter.Import(String inputXml, String websiteName)
   at WebsiteCopy.Copier.Copy(String[] args)
   at WebsiteCopy.Program.Main(String[] args)

I am admittedly pretty weak in web-related stuff, so if you have any comments and don't mind starting from the basics I promise not to be offended. 8-)

 

Thanks in advance,
Dan

May 26, 2010 at 3:13 PM

Point the website copy utility at the CRM application website- ie websitecopy /targetConnectionString:"Authentication Type=AD; Server=http://crmserver:80; User ID=DOMAIN\username; Password=password;" /targetWebsiteName:"Customer Portal" /sourceFile:D:\Temp\CUSTOMER_PORTAL_RTW_R1\Installation\Customizations\customerportal.xml. The utility creates a 'website' and all associated entites and populates all data attributes within the CRM application. Once that's done, point your manually created website on port 83 at the website files within the installation folders and continue on with instructions from that point onwards to get authentication etc working.

HTH

Monty

May 26, 2010 at 3:27 PM

Monty is correct.

The instructions are laid out in step 6 of the following document: Customer Portal Deployment Guide_OnPremise_V1.0.doc

The WebsiteCopy utility copies the "content" of the portal into the CRM.  Note that the portal is based on a content management system, so the content is not in the website project, but is in custom entities in CRM.  The website copy utility will import the content that we have provided in the customerportal.xml file into your CRM.  You need to point the utility at your CRM for it to function.  Setting up the IIS website is covered in steps 13-16, but they will be rewritten in the next update to the documentation to give you clear direction as to how to set up the IIS website in both IIS 6 and IIS 7.

One note - if the user account you are using has permissions in your CRM, you can use Authentication Type=Integrated and omit the User ID and Password fields.  I would also like to point out that it is recommended that you also add your orgname to the url.  ie: if your orgname is contoso, use Server=http://crmserver/contoso as the server parameter.

Shan McArthur
www.shanmcarthur.net

May 26, 2010 at 3:27 PM

Thanks, Monty.  That at least changed the error message, which is now:
Unhandled Exception: System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.Crm.SdkTypeProxy.CrmService.Execute(Request Request)
   at Microsoft.Xrm.Client.Services.CrmServiceWrapper.Execute(Object request)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.InnerExecute(Request request)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute[TRequest,TResponse,TResult](TRequest query, Func`2 execute, Func`2 selector)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.<>c__DisplayClass8`3.<LookupAndInsert>b__6(String _)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass5`1.<Get>b__4(String k)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass2`1.<Get>b__0(Mutex _)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
   at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.LookupAndInsert[TRequest,TResponse,TResult](TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Get[TRequest,TResponse,TResult](TRequest query, Func`2 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute[TRequest,TResponse,TResult](TRequest request, Func`2 execute, Func`2 selector, StringselectorCacheKey)
   at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Execute[T](Request request, Func`2 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](Request request, Func`5 execute, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](Request request, Func`2 selector, String selectorCacheKey)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](Request request)
   at Microsoft.Xrm.Client.Services.CachedOrganizationService.RetrieveMultiple(QueryBase query)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.<>c__DisplayClassc.<Execute>b__b(IOrganizationService service)
   at Microsoft.Xrm.Client.Services.IOrganizationServiceExtensions.Using[T](Func`1 create, Func`2 action)
   at Microsoft.Xrm.Client.Data.Services.BaseDataContext.UsingService[T](Func`2 action)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.UsingService[T](Func`2 action)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute(QueryExpression qe, LambdaExpression projection, Type entityType)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute[TElement](QueryExpression qe, LambdaExpression projection, Delegate postMethodCall, LambdaExpression filter, Type entityType)
   at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute[TElement](Expression expression)
   at Microsoft.Xrm.Client.Linq.QueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
   at WebsiteCopy.WebsiteImporter.ImportWebsite(ICrmDataContext crm, String websiteName, XElement websiteElement, Boolean isSubscriber, IDictionary`2 keyMapping)
   at WebsiteCopy.WebsiteImporter.Import(XElement element, String websiteName)
   at WebsiteCopy.WebsiteImporter.Import(Stream input, String websiteName)
   at WebsiteCopy.WebsiteImporter.Import(String inputXml, String websiteName)
   at WebsiteCopy.Copier.Copy(String[] args)
   at WebsiteCopy.Program.Main(String[] args)

 

I set my CRM web site to allow anonymous access, again with the CRM Administrator account which can authenticate against CRM with the CRM web client, and Windows Integrated Authentication is also checked.  "Everyone" has read, execute and list access to the web site.

Any other thoughts?

Thanks
Dan

May 26, 2010 at 3:32 PM

You should NOT modify the website for your CRM.  Please undo the changes you made to your CRM website.

The website copy utility will use the CRM web services to copy the content into custom entities in your CRM.  You should not make any changes to the CRM website as that will break authentication and possibly the entire CRM.   If you made changes to your CRM website to allow anonymous, IIS is no longer going to authenticate the user and CRM will be unable to detect who the user is and will issue an error that the user is not allowed, including over the web services.  This is the error message that you gave, so I would expect that if you made changes to IIS authentication.

Shan

May 26, 2010 at 3:33 PM

Alright, well this seems to have worked:

D:\Temp\CUSTOMER_PORTAL_RTW_R1\Installation\Website\Microsoft.Xrm\Tools>websitecopy /targetConnectionString:"Authentication Type=Integrated; Server=http://crmserver:80/orgname;" /targetWebsiteName:"Customer Portal" /sourceFile:D:\Temp\CUSTOMER_PORTAL_RTW_R1\Installation\Customizations\customerportal.xml

Not sure how it is different from the many variations I tried yesterday and this morning, but I probably either had the wrong port number or didn't include the orgname.

Many thanks, Monty and Shan.  Perhaps someone else will find this thread useful as well.

Regards,
Dan

Nov 1, 2010 at 11:50 AM

Hi All,

 

Please help me out, i am trying to integrate Customer portal accelerator from last 4 days.. i am stuck at 1 point,i have made all customizations, but the step, which says abt copying content onto crm has failed all the time, i am tryng hard to run the WebsiteCopy.exe utility, but its nt working.

 

this is my command script

WebsiteCopy.exe /targetConnectionString:"Authentication Type=AD; Server=http://iontest.ionsoftnet.com; User ID=administrator; Password=pass@word1" /targetwebsiteName:"Customer Portal" /sourceFile:customerportal.xml

and when i run the source code provided with the installation, i get his error

<add name="CrmRoleProvider" type="Microsoft.Xrm.Portal.Web.Security.CrmContactRoleProvider"/>

i have implmented IFD deployement on my CRM.

and m nt able get the log for the error.

So, please help me out from this, m no where near the success to this portal integration.

Thanks in advance.

Meghshyam Gaur

Nov 1, 2010 at 12:09 PM

Hi,

finally, i am able to get rid from that error, but nw a new error comes.

whenever i run the Websitecopy utility, i stuck in middle n shows the error, Index was outside the bounds of the array..

Please help me on this.

 

Thanks in advance.

Meghshyam Gaur

 

Nov 1, 2010 at 5:13 PM

In your connection string, you need to use the format of domain\username for the User ID field if you are using Active Directory for authentication.

Shan McArthur
www.shanmcarthur.net

Nov 2, 2010 at 4:32 AM

Hi shan,

Thanks for ur reply, when i use domain\username for the User ID, i get unauthorized error Code: 401,

and when i use only username for the User ID,it starts impporting the contents , but after few seconds it gives me a windows popup window, saying "WebsiteCopy has stopped working, close window or debug" something like error, n after debugging it shows, Index was outside the bounds of the array..

n 1 more thing, when i m debugging the accelerator website code, it also gives the same error, i.e.  Index was outside the bounds of the array..

Please help me on this.

Thanks in Advance

Meghshyam Gaur



 

Nov 2, 2010 at 6:47 PM

When you use Authentication Type=AD, it is REQUIRED that you use domain\username format.  The "index is outside the bounds of the array" error is because it is trying to split the credentials into an array, and if you don't have the backslash separator, it tried to find your username in an array that doesn't exist.  If you are getting a 401 error, then something else is wrong with your connection string.  Your server URL doesn't include the orgname - I suspect your 401 error is because the user account you are using does not have access to the default org.  Append your orgname to the end of the url.  This is documented in the SDK documentation.

Shan