This is a migrated thread and some comments may be shown as answers.

WcfService error

3 Answers 57 Views
Notification
This is a migrated thread and some comments may be shown as answers.
RvdGrint
Top achievements
Rank 1
RvdGrint asked on 18 Apr 2012, 09:57 AM
Hello,

I'm trying to use RadNotification with WcfService. My WcfService is in an separeted project file. I've added an 'Service Reference' ni my current project to the Web Service. I'm trying to implement this service om my RadNotification but Im receiving to following error:

XmlHttpPanel loading error:
Exception=Method Not Allowed

My RadNotication:
<telerik:RadNotification ID="RadNotification1" runat="server" Width="320" Animation="Fade"
  EnableRoundedCorners="true" Skin="Windows7" EnableShadow="true" Style="z-index: 35000"
  LoadContentOn="TimeInterval" OffsetX="-20" OffsetY="-20" VisibleTitlebar="true"
  WcfRequestMethod="POST" WcfServicePath="~/Service References/ProcessLogServiceRef/Reference.svcmap"
  WcfServiceMethod="GetLogData" UpdateInterval="5000" OnClientUpdating="RadNotificationUpdating">
</telerik:RadNotification>

Javascript
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
  <script type="text/javascript">
    function RadNotificationUpdating(sender, args) {
      //alert('Hallo');
    }
  </script>
</telerik:RadScriptBlock>

WcfService:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Activation;
 
namespace YBS.Services.SYS
{
  // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "ProcessLog" in both code and config file together.
  [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
  public class ProcessLog : IProcessLog
  {
    public void GetLogData(string sTimeStamp)
    {
    }
  }
}

Can someone help me???

Regards,
  Jos Meerkerk





3 Answers, 1 is accepted

Sort by
0
RvdGrint
Top achievements
Rank 1
answered on 18 Apr 2012, 11:56 AM
I was using WCF Service Library and I changed it to WCF Service application.
Now the error changed to 'No Transport'.

Anyone?

Telerik: is it possible to provide an example with WCF Service from an WCF Service Application??

Regards,
Jos.

0
RvdGrint
Top achievements
Rank 1
answered on 18 Apr 2012, 12:23 PM
I'm receiving an 'WCF WebHttp Service returns HTTP 415 “Unsupported Media Type”' error when adding a service reference to my WCF Services application using the following web.config
<?xml version="1.0"?>
<configuration>
 
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="ProcessLogBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="ProcessLogBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="ProcessLogBehavior" name="ProcessLog">
        <endpoint binding="basicHttpBinding" contract="SYS.IProcessLog" behaviorConfiguration="ProcessLogBehavior" />
      </service>
    </services>
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
   
</configuration>

0
Marin Bratanov
Telerik team
answered on 20 Apr 2012, 03:38 PM
Hello,

A webservice defined in this way cannot be accessed via JavaScript. It needs an object in the code-behind, which is not available in this case. What I would advise is that you examine the live demos folder to see how the supported scenario is implemented - an svc file pointing to a class in the App_Code folder. In the same manner a regular WebService can be used. These approaches are shown in this demo for WCF and in this one for the regular WebService. I believe you may also find interesting the Callback update approach, as it is also a lightweight solution for updating content. With it you could also implement custom logic in the code-behind to access services you need to. As long as they return a proper string you can easily feed it to the RadNotification.


Kind regards,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Notification
Asked by
RvdGrint
Top achievements
Rank 1
Answers by
RvdGrint
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or