Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed View modes: 
User avatar
Certified Developer v6
Certified Developer v6
hoppe - 1/7/2013 11:01:06 AM
   
Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
I'm trying to setup content staging. I've gone through the developer guide, but I'm still getting a 405 error: 'method not allowed' when I click test server availability:
The remote server returned an error: (405) Method Not Allowed.
at System.Net.HttpWebRequest.GetResponse()
at CMSAdminControls_UI_System_ServerChecker.CheckServer(String parameters) in c:\\Websites\\SurroundHealth\\CMSAdminControls\\UI\\System\\ServerChecker.ascx.cs:line 152');

If I try to push a task, I get the following error:
Message: The request failed with HTTP status 400: Bad Request.
Stack Trace:
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 CMS.Synchronization.CMS.SynchronizationEngine.SyncServerWse.ProcessSynchronizationTask(String taskTitle, String taskType, String taskObjectType, String taskData, String taskBinaryData, String taskServerList, String systemVersion)
at CMS.Synchronization.SyncClient.RunTask(TaskInfo taskObj)

What am I doing wrong? I'm using password authentication.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/8/2013 2:11:32 AM
   
RE:Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
Hi,

What is your IIS setting for the anonymous user access (the requests for content staging are made as a anonymous user, is this enabled in your IIS)? And also, what is the configuration in your web.config file (location parameter)?

One option is to set the IIS to allow the anonymous user or second option is in the web.config file - you can specify the location paramater to which locations of the web is the anonymous user allowed to access.

Also, could you please try to open url defined for source server in "Server URL" property (for example http://www.targetserver.com/CMSPages/syncserver.asmx) directly in your browser? What can you see? Can you see "Sync server" page with "The following operations are supported" message?

Best regards,
Martin Danko

User avatar
Certified Developer v6
Certified Developer v6
hoppe - 1/8/2013 9:16:57 AM
   
RE:Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
Hi Martin,

I confirmed in IIS that Anonymous user access is enabled for the target server.

The location parameters are:
  <location path="cms">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<!-- WebDAV location BEGIN -->
<location path="cms/files">
<system.web>
<httpHandlers>
<clear />
<add verb="*" path="*" type="CMS.WebDAV.WebDAVHandler, CMS.WebDAV" />
</httpHandlers>
<httpRuntime executionTimeout="2400" maxRequestLength="2097151" />
</system.web>
<system.webServer>

<handlers>
<clear />
<add name="CMSWebDAVHandler" path="*" verb="*" type="CMS.WebDAV.WebDAVHandler, CMS.WebDAV" />
<remove name="xoml-Integrated" />
<add name="*.vbhtml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.vbhtml" type="System.Web.HttpForbiddenHandler" />
<add name="*.vbhtm_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.vbhtm" type="System.Web.HttpForbiddenHandler" />
<add name="*.cshtml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.cshtml" type="System.Web.HttpForbiddenHandler" />
<add name="*.cshtm_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.cshtm" type="System.Web.HttpForbiddenHandler" />
<add name="*.xamlx_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.xamlx" type="System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.xoml_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.xoml" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.svc_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.svc" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*.soap_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.soap" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="*.rem_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.rem" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<add name="*.asmx_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ScriptResource.axd" preCondition="integratedMode,runtimeVersionv2.0" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="*_AppService.axd_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="eurl.axd_*" preCondition="integratedMode,runtimeVersionv2.0" verb="*" path="eurl.axd" type="System.Web.HttpNotFoundHandler" />
</handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483648" />
</requestFiltering>
</security>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
</location>

If I go to the server URL for the target server, I get the following response:
Description: Message: Request format is unrecognized.
Stack Trace:
at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Site name: S...
Machine name: WINDOWS-74MN8ME
Event URL: /CMSPages/syncserver.asmx
URL referrer:
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11

Thanks,
Joe

User avatar
Certified Developer v6
Certified Developer v6
hoppe - 1/8/2013 9:47:13 AM
   
RE:Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
I just saw that there's a web.config in the cmspages directory. Here's the corresponding entry:
  <!-- Content staging BEGIN -->
<location path="SyncServer.asmx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
<webServices>
<soapExtensionImporterTypes>
<add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</soapExtensionImporterTypes>
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</webServices>
<compilation>
<assemblies>
<add assembly="Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
</system.web>
</location>
<!-- Content staging END -->

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/15/2013 5:30:33 AM
   
RE:Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
Hi Joe,

Thanks for the posts but one more details.. could you please post also your web.config file from root and tell me which .NET version are you using with this site? Is this clean v6 installation or have you upgraded from any previous version?

Best regards,
Martin Danko

User avatar
Certified Developer v6
Certified Developer v6
hoppe - 1/16/2013 8:25:03 AM
   
RE:Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
Hi Martin,

This is an upgrade from Kentico 5.5R2 to Kentico 6. Is that a bug, or does the vanilla 6 installation just function differently than an upgrade?

Thanks,
Joe

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/18/2013 4:36:53 AM
   
RE:Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
Hi,

Generally it's not different, it only matters that from v6 only .NET 3.5 or higher is supported as well as web.config from the previous version could be a little bit different.

Could you please try to increase the maxRequestLength parameter in the web.config file
<httpRuntime maxRequestLength="10000"/>

If that won' help could you please also try to edit the custom errors in IIS -> edit error code 404 -> choose the MESSAGE TYPE -> URL -> insert: /cmspages/handler404.aspx. Then do the same for error code 405.

After changing these settings please restart the application via SiteManager -> Administration -> System -> Restart application.

Best regards,
Martin Danko

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/20/2013 11:39:22 AM
   
RE:Cannot setup content staging: The remote server returned an error: (405) Method Not Allowed
Two things you need to ensure staging works properly: 1) In the bin directory of both servers make sure the Microsoft.Web.Services3.dll.rename file is renamed to Microsoft.Web.Services3.dll. 2). Make sure when setting up the source server you are using the correct url. It should be http://www.yourdomain.com/CMSPages/SyncServer.asmx