Technical support This forum is closed.
Version 1.x > Technical support > Microsoft.Web.Services2 View modes: 
User avatar
Guest
rhavlick - 1/30/2006 6:01:29 PM
   
Microsoft.Web.Services2
Hello,

For some reason after installing CMS on our server, all of the web services also on our site now don't function. I found out that they need Microsoft.Web.Services2.dll to be copied into the bin directory but this still occurs on the HelloWorld application. We just installed the 1.1 framework version, so I'm not sure why it's using Services2.

Thanks.





An unhandled exception of type 'System.Web.Services.Protocols.SoapHeaderException' occurred in system.web.services.dll

Additional information: System.Web.Services.Protocols.SoapHeaderException: Server unavailable, please try later ---> System.Configuration.ConfigurationException: WSE032: There was an error loading the microsoft.web.services2 configuration section. ---> System.Configuration.ConfigurationException: WSE040: Type Kentico.CMS.SyncWebService.WebServiceAuthorization, Kentico.CMS.SyncWebService could not be loaded. Please check the configuration file.
at System.Web.Configuration.HttpConfigurationRecord.Evaluate(String configKey, SectionRecord section)
at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String configKey, Boolean cacheResult)
at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String configKey, Boolean cacheResult)
at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String configKey, Boolean cacheResult)
at System.Web.HttpContext.GetConfig(String name)
at System.Web.Configuration.HttpConfigurationSystemBase.System.Configuration.IConfigurationSystem.GetConfig(String configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String sectionName)
at Microsoft.Web.Services2.Configuration.WebServicesConfiguration.Initialize()
--- End of inner exception stack trace ---
at Microsoft.Web.Services2.Configuration.WebServicesConfiguration.Initialize()
at Microsoft.Web.Services2.WebServicesExtension.BeforeDeserializeServer(SoapServerMessage message)
--- End of inner exception stack trace ---

User avatar
Guest
admin - 1/31/2006 8:16:00 AM
   
Re: Microsoft.Web.Services2
Hello,

Kentico CMS doesn't make any changes to system settings, so it couldn't influence other web services on your machine. Please make sure that your web site's (built with Kentico CMS) /bin folder contains the library Microsoft.Web.Services2.dll. This version is intended for .NET 1.1 and it's not a standard part of the .NET framework.

Best Regards,

User avatar
Guest
rhavlick - 1/31/2006 4:06:14 PM
   
Re: Microsoft.Web.Services2
Hello,

When I go to create just the Microsoft Hello World Web Service it will not run if I have the web.config file for the CMS in the root directory. If I temporarly rename the web.config file in the root, then all the web services run fine. We didn't alter the web.config file, but have included the one below that we are using minus our database and license info.


<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="microsoft.web.services2" type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration, Microsoft.Web.Services2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<appSettings>
<add key="CMSConnectionString" value=" "/>
<add key="CMSMetadataFolder" value="/CMSDesk/Metadata" />
<add key="CMSFilesFolder" value="" />
<add key="CMSLicenseKey" value=" " />
<add key="CMSParentFrameName" value="application" />
<add key="CMSCacheMinutes" value="0" />
<add key="CMSCachePageInfoMinutes" value="0" />
<add key="CMSWebSiteBaseAliasPath" value="" />
<add key="CMSUseFriendlyURLs" value="true" />
<add key="CMSWebApplicationVirtualPath" value="/" />
<add key="CMSUseMultilingualSupport" value="false" />
<add key="CMSDefaultCultureCode" value="en-us" />
<add key="CMSSendWorkflowEmails" value="true" />
<add key="CMSSchedulerInterval" value="1" />
<add key="CMSSMTPServer" value="localhost" />
<add key="CMSSendWorkflowEmailsFrom" value="automail@yourdomain.com" />
<add key="CMSSecuredAreas" value="/Customer Support" />
<add key="CMSSecuredAreasLogonPage" value="~/CustomerSupportSignIn.aspx" />
<add key="CMSWysiwygEditor" value="FCKEditor" />
<add key="CMSStoreFilesInDatabase" value="false" />
<add key="CMSFriendlyURLStyle" value=".aspx" />
<add key="CMSExcludedDirectories" value="/ControlsExamples" />
<add key="CMSUseOutputFilter" value="true" />
<add key="CMSFixFormAction" value="true" />
<add key="CMSGenerateFriendlyUrlFiles" value="false" />
<add key="CMSSendNewslettersFrom" value="automail@yourdomain.com" />
<add key="CMSDefaultAliasPath" value="/home" />
<add key="CMSSendForumPostsFrom" value="automail@yourdomain.com" />
</appSettings>
<system.web>
<pages validateRequest="false" />
<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="vb" debug="true" />
<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.

"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors mode="Off" />
<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
its settings for the application. Anonymous access must be disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter their credentials, and then
you authenticate them in your application. A user credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member sites.
-->
<authentication mode="Forms">
<forms name="CMSCookie" loginUrl="~/cmsdesk/logon.aspx" protection="All" path="/" slidingExpiration="true" timeout="60">
</forms>
</authentication>
<!-- <authentication mode="Windows"/> -->
<!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users.
-->
<authorization>
<allow users="*" />
<!-- Allow all users -->
<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>
<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application.
Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
trace information will be displayed at the bottom of each page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your web application
root.
-->
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong to a particular session.
If cookies are not available, a session can be tracked by adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-US" uiCulture="en-US" />
<machineKey validationKey="48D5420B3133626A149238482CC86B904789D8B8D4415576D1AA560FB3137FB6BCD0515BE0EBD6203AFB35481BAC27ABE20D8DCA4946965572F8E16DFC2EEBC0" decryptionKey="C947D882DFD5A6C3783FDA6A950D72F1004AECB94BD46AD0" validation="SHA1" />
<webServices>
<soapExtensionTypes>
<add type="Microsoft.Web.Services2.WebServicesExtension, Microsoft.Web.Services2, Version=2.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" priority="1" group="0" />
</soapExtensionTypes>
</webServices>
</system.web>
<location path="cmsdesk">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="cmsdesk/calendar">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
<location path="cmsdesk/design">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
<location path="cmsdesk/install.aspx">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
<microsoft.web.services2>
<security>
<securityTokenManager type="Kentico.CMS.SyncWebService.WebServiceAuthorization, Kentico.CMS.SyncWebService" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" qname="wsse:UsernameToken" />
<x509 allowTestRoot="true" allowRevocationUrlRetrieval="false" verifyTrust="true" />
</security>
</microsoft.web.services2>
</configuration>

User avatar
Guest
admin - 2/1/2006 9:22:57 AM
   
Re: Microsoft.Web.Services2
Hello,

the issue is probably caused by the fact that your web service is placed under the Kentico CMS web site and it uses its web.config file and is processed by Kentico CMS engine.

The easiest way how to separate your web service from Kentico CMS is to create a virtual directory where you place your web service with its own bin folder and its own web.config.

Another option is excluding the web service from Kentico CMS space - you can do that by modifying the following parameter:

<add key="CMSExcludedDirectories" value="/ControlsExamples;/mywebservice" />

It will exclude your /mywebservice directory so that it's not processed by Kentico CMS.

I think this problem isn't connected to Microsoft.Web.Services2.dll and config sections - these are used only for Web Services Enhancements (web services security library) and they shouldn't influence standard ASP.NET web services.

Please let me know if it helped.

Best Regards,

User avatar
Guest
rhavlick - 2/1/2006 4:57:44 PM
   
Re: Microsoft.Web.Services2
Yeah tried the virtual directory, that for some reason had the same issues. Tried the exclude directories on the root web.config file. But I can still rename the main web.config that CMS uses and it all goes back to working fine.

I'm not sure like you said if it has anything to do with the Microsoft.Web.Services2.dll though, just seems like that's the first thing that's getting called when it's running into whatever problem it's having.

Any other ideas?

Thanks.

User avatar
Member
Member
Martin_Kentico - 2/2/2006 8:39:54 AM
   
Re: Microsoft.Web.Services2
Hi,

Considering the exception error you get, it is connected to the SOAP protocol format, it is configured within the:

<system.web>
<webServices>
<soapExtensionTypes>

configuration section of your web.config file, and unfortunately it is not compatible between different versions of web services, so you need to configure it separately for you web.service according to the standard .NET web.services library instructions.

You should probably configure the different services in the separate <location> sections to keep them off themselves. The other configuration sections should not be influenced by having different kind of services, so you don't need to take care of them.

If you plan to run your service within the context of the KenticoCMS application, you will probably also need to keep the service directory within the CMSExcludedDirectories parameter, because otherwise the system could have negative influence just to get to the service "page", but also to the result data the service returns.

If you still get the errors after separating the configuration sections, try to completely remove all the web.services2 configuration parameters and configure the web page just for the service you try to make work.

Let me know if it helped and if it didn't paste your changed web.config file content again, and I will try to check it or give you some more advice about that

Best regards

User avatar
Guest
rhavlick - 2/6/2006 8:42:43 PM
   
Re: Microsoft.Web.Services2
Thanks Martin,

So I'm just using the standard web.config that Visual Studio creates, since these are farily simple web services. I've added the directory to the CMSExcludedDirectories. Could you show me what to add to my web.config file that is for the simple web service I've created:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.web>

<!-- DYNAMIC DEBUG COMPILATION
Set compilation debug="true" to insert debugging symbols (.pdb information)
into the compiled page. Because this creates a larger file that executes
more slowly, you should set this value to true only when debugging and to
false at all other times. For more information, refer to the documentation about
debugging ASP.NET files.
-->
<compilation defaultLanguage="vb" debug="true" />

<!-- CUSTOM ERROR MESSAGES
Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Add <error> tags for each of the errors you want to handle.

"On" Always display custom (friendly) messages.
"Off" Always display detailed ASP.NET error information.
"RemoteOnly" Display custom (friendly) messages only to users not running
on the local Web server. This setting is recommended for security purposes, so
that you do not display application detail information to remote clients.
-->
<customErrors mode="RemoteOnly" />

<!-- AUTHENTICATION
This section sets the authentication policies of the application. Possible modes are "Windows",
"Forms", "Passport" and "None"

"None" No authentication is performed.
"Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to
its settings for the application. Anonymous access must be disabled in IIS.
"Forms" You provide a custom form (Web page) for users to enter their credentials, and then
you authenticate them in your application. A user credential token is stored in a cookie.
"Passport" Authentication is performed via a centralized authentication service provided
by Microsoft that offers a single logon and core profile services for member sites.
-->
<authentication mode="Windows" />


<!-- AUTHORIZATION
This section sets the authorization policies of the application. You can allow or deny access
to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous
(unauthenticated) users.
-->
<authorization>
<allow users="*" /> <!-- Allow all users -->

<!-- <allow users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
<deny users="[comma separated list of users]"
roles="[comma separated list of roles]"/>
-->
</authorization>

<!-- APPLICATION-LEVEL TRACE LOGGING
Application-level tracing enables trace log output for every page within an application.
Set trace enabled="true" to enable application trace logging. If pageOutput="true", the
trace information will be displayed at the bottom of each page. Otherwise, you can view the
application trace log by browsing the "trace.axd" page from your web application
root.
-->
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />


<!-- SESSION STATE SETTINGS
By default ASP.NET uses cookies to identify which requests belong to a particular session.
If cookies are not available, a session can be tracked by adding a session identifier to the URL.
To disable cookies, set sessionState cookieless="true".
-->
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>

<!-- GLOBALIZATION
This section sets the globalization settings of the application.
-->
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

</system.web>

</configuration>

User avatar
Member
Member
Martin_Kentico - 2/7/2006 9:01:11 AM
   
Re: Microsoft.Web.Services2
Hi,

It is difficult to say, because there is lots of options web services offer and lots of the configuration types. The simpliest web service shouldn't need any additional configuration at all, just reference to the web services library, but it still might be influenced by any other service configuration on a global level. I think you should try to to create the simple working service first in an standalone application, just by the example from MSDN or whatever, and after that put it into the Kentico CMS system environment, and try to combine the service settings by using the different <location> sections.

I don't think the error you get should remain the same (SOAP), after complete change of the web.config file, does it?


I need some more infomation about the current situation of yours to analyze the problem:

1) What is the error you get right now? (if it is still the SOAP error, you should check if there is not any other web.config file within your directory structure that could influence your application)

2) Can I find the sample web service application you are using somewhere on the internet or in MSDN library?

3) What is the way you run the web service? Is it trough the .asmx page interface, or calling from the application code? (if code, pleas paste the calling code)

4) If you place the working service into the Kentico CMS environment, is the .asmx service interface page displayed properly, or is there a redirection or exception error message?

Best regards