locked
Trying to implement Customized web chat among users but couldn't able to integrate AJAX with the web application, I have developed so far RRS feed

  • Question

  • User-897307390 posted

    Hi,

    I have almost developed a website using Dot net, C#, Jquery, Javascript etc. Now, for having chat among visitors, we picked the AJAX code from https://code.msdn.microsoft.com/CSASPNETAJAXWebChat-c4c9b8fe and customized it... 

    When we see the demo in there, it successfully shows the chatboxes and implements the chats well... But we couldn't able to integrate it with our already built web application (Web forms and not MVC). Since we get no errors, its very hard to predict the issue clearly. Do I have to make some changes in web.config?

    Getting 2 warnings alone which are as follows

    <div>

    Warning 2 The 'contract' attribute is invalid - The value 'PlayZone.Services.SessionPool' is invalid according to its datatype 'serviceContractType' - The Enumeration constraint failed. E:\Projects\PlayZoneJUNE04\PlayZone\Web.config 57 48 PlayZone

    </div> <div></div> <div>Warning 1 The 'name' attribute is invalid - The value 'PlayZone.Services.SessionPool' is invalid according to its datatype 'serviceNameType' - The Enumeration constraint failed. E:\Projects\PlayZoneJUNE04\PlayZone\Web.config 55 22 PlayZone</div>

    Actually, I took the code from MSDN and pasted it successfully. The problem seems to occur in the Web.Config's service region.

    WEB.CONFIG's SERVICE

    <services>
          <service name="WebChat.Services.Transition">
            <endpoint address="" behaviorConfiguration="Sever.Services.TransitionAspNetAjaxBehavior"
                binding="webHttpBinding" contract="WebChat.Services.Transition" />
          </service>
          <service name="WebChat.Services.SessionPool">
            <endpoint address="" behaviorConfiguration="Sever.Services.SessionPoolAspNetAjaxBehavior"
                binding="webHttpBinding" contract="WebChat.Services.SessionPool" />
          </service>
        </services>
    Let me know where I have done the mistake in this service part of the web.config.
    Thanks in advance and have a nice day ahead. 

    Thursday, June 4, 2015 6:45 AM

All replies

  • User1534684113 posted

    Hi bigprey,

    Thanks for your post. As per this case, I am suspecting that you missed some steps. It's recommended that you follow the steps to do it again carefully:

    1. Download the project, and unzip the file. In the c#->CSASPNETAJAXWebChat folder, you could see the project files, such as App_Data, Data, Logic Scripts folders .etc.

    2. Follow the steps, Create an "ASP.NET Empty Web Application" in Visual Studio 2010/Visual Web Developer 2010. In this sample it is "WebChat". Right-click the App_Data directory, then you could simply copy and paste the files within the App_Data to the new created App_Data folder.

    3. Create a new directory, "Data". Right-click the directory and click Add -> New Item -> Linq to SQL classes.(If you could not find that template, please click the Data node of the tree view at the left hand.) In this sample, it is SessionDB.dbml.

    4. Open the SessionDB.dbml and double-click the SessionDB.mdf, you will see the database in the Server Explorer. Expand the SessionDB.mdf, expand the Tables folder, and select the four tables, and drag them all to the stage of the SessionDB.dbml.

    5. Create a new directory, "Logic". then you could simply copy and paste the files from the corresponding folder to it.

    6. Create a new directory, "Services". then you could simply copy and paste the files from the corresponding folder to it.

    7. Create a new directory, "Scripts". then you could simply copy and paste the files from the corresponding folder to it.

    8. Copy the  Default.aspx,  Default.aspx.cs and Default.aspx.designer.cs to the root directory of the project.

    9. Copy the ChatBox.aspx to the root directory of the project.

    10. Build the application and you can debug it.

    Monday, June 8, 2015 4:20 AM
  • User-897307390 posted

    Here are the details

    i) I downloaded Ajax based group chat, which was done following the procedures on the pagehttps://code.msdn.microsoft.com/CSASPNETAJAXWebChat-c4c9b8fe#content.

    ii) The sample alone as a separate site works fine... But when combined with my website code, it shows the warnings and the chat is not working.

    iii) Our Dot net framework version is 4.5... but the web chat's framework on MSDN shows version 4 when run alone.

    iv) Server - IIS (Local machine)

    Hope this helps you to understand further. Thanks for your concern and have a nice day ahead.

    Wednesday, June 10, 2015 12:39 AM