|
Hi All,
I am trying to build an telephone central dashboard (broadsoft).
This system is using httpwebrequests to select data.
First i need to build an channel to broadsoft. This works correct. I do get an channelId and expire time back from this server.
Then i would like to subscribe an event over this channel. When i try that i get an error that the channel that i just made doesn't exist (expiry time for this channel did not expired).
This is my code:
1. URL
public DataSet EventRequest(string request, string id = null)
{
string method = string.Empty;
string url = string.Empty;
string xml = string.Empty;
bool chunked = false;
switch (request)
{
case "CreateEventChannel":
method = "POST";
url = "http://xsp.voipit.nl/com.broadsoft.async/com.broadsoft.xsi-events/v2.0/channel/";
xml = "<?xml version='1.0' encoding='UTF-8'?><Channel xmlns='http://schema.broadsoft.com/xsi'><channelSetId>SomeChannelSetId</channelSetId><priority>1</priority><weight>50</weight><expires>3600</expires></Channel>";
chunked = true;
break;
case "CreateSubscription":
method = "POST";
url = "http://xsp.voipit.nl/com.broadsoft.xsi-events/v2.0/user/<userId>";
xml = "<?xml version='1.0' encoding='UTF-8'?><Subscription xmlns='http://schema.broadsoft.com/xsi'> <targetIdType>User</targetIdType> <event>Standard Call</event> <expires>300000</expires> <channelSetId>SomeChannelSetId</channelSetId> <applicationId>SomeApplicationId</applicationId></Subscription>";
break;
default:
url = "";
break;
}
return GetData(url, method, xml, chunked);
}
2. Request method
public DataSet GetData(string destinationUrl, string method = null, string requestXml = null, bool chunked = false)
{
string output = string.Empty;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(destinationUrl);
request.ProtocolVersion = HttpVersion.Version10;
request.KeepAlive = true;
request.Timeout =
request.ReadWriteTimeout = 60000;
request.Accept = @"application/xml";
request.PreAuthenticate = true;
request.ContentType = "application/xml; encoding='utf-8'";
request.SendChunked = chunked;
request.Method = method;
request.Credentials = new NetworkCredential(WebConfigurationManager.AppSettings["Username"], WebConfigurationManager.AppSettings["Password"]);
if (requestXml != string.Empty)
{
byte[] bytes;
bytes = System.Text.Encoding.ASCII.GetBytes(requestXml);
request.ContentLength = bytes.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
}
return CreateRequestDataSet(request);
}
3. Get data
public DataSet CreateRequestDataSet(HttpWebRequest request)
{
string output = string.Empty;
HttpWebResponse response = null;
try
{
response = (HttpWebResponse)request.GetResponse();
WebHeaderCollection header = response.Headers;
string StatusCode = Convert.ToString(response.StatusCode);
string StatusDescription = response.StatusDescription;
}
catch (WebException e)
{
using (WebResponse responseTest = e.Response)
{
HttpWebResponse httpResponse = (HttpWebResponse)responseTest;
string ErrorCode = httpResponse.StatusCode.ToString();
using (Stream data = responseTest.GetResponseStream())
using (var reader = new StreamReader(data))
{
string ErrorResponse = reader.ReadToEnd();
}
}
}
try
{
var encoding = ASCIIEncoding.UTF8;
using (var reader = new System.IO.StreamReader(response.GetResponseStream(), encoding))
{
output = reader.ReadToEnd();
}
}
catch (Exception) { }
DataSet ds = new DataSet();
DataTable dt = new DataTable();
using (StringReader stringReader = new StringReader(output))
{
if (output != string.Empty)
{
ds = new DataSet();
try
{
ds.ReadXml(stringReader);
}
catch (Exception) { }
}
}
return ds;
}
Can someone maybe tell me why my channel doesn't exist anymore when i call CreateSubscription
|
|
|
|
|
Does the site you're calling rely on cookies? If so, you'll need to find a way to pass the same CookieContainer[^] instance to the HttpWebRequest.CookieContainer property[^] for both the channel and subscription requests. How you do that depends on how you're calling the code.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi, I have a word document i.e. the report I want. I have already written the lines i want in my document. The issue is I have 15 such files and I want to populate those documents with data from SQL.
Is there any way to populate document with sql data. Not talking about export to word.
Using Asp.net
SQL 2012
TIA
|
|
|
|
|
|
Thanks is there any expample online?? and will this dll cause any issue after publishing in server???
|
|
|
|
|
Yes, please feel free to Google them at your leisure.
As for causing issues....like what? I honestly don't know a blessed thing about your server infrastructure and if adding document processing libraries has been known to cause it problems, I daresay that you have bigger issues to address than report generation.
|
|
|
|
|
Thank you for your wonderful reply. by issue I mean Last time I used Interop and after publishing my code in server I was unable to generate any reports...
|
|
|
|
|
Office Interop is not supported in ASP.NET, or any other unattended application:
Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.
OpenXML is supported, and doesn't require Office to be installed on the server.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I probably should have included that tidbit.
I'm amazed that you didn't supply the GUIDs for the assemblies from memory.
|
|
|
|
|
Hi, I have an issue, that when I send get request to my ASP.NET Web API, also my post function in my controller gets called. Here is my code, I'd appreciate if anyone could help.
I'd like to know what do I do wrong when I declare my post function that it also gets called with my get request.
both my get and post function in my controller:
public IHttpActionResult GetAffiliate(int id)
{
Classes.Data d = new Classes.Data();
Tuple<int16, affiliate=""> result = d.getAffiliateById(id);
Int16 status = result.Item1;
Affiliate affiliate = result.Item2;
if (status == 0)
{
return NotFound();
}
return Ok(affiliate);
}
[AcceptVerbs("POST")]
public HttpResponseMessage Post([FromBody]Address address)
{
Classes.Data d = new Classes.Data();
d.addressEdit(address);
return Request.CreateResponse(HttpStatusCode.OK, "Address changed.");
}
my jQuery code where I apply get request:
function getInfo() {
//point to the api
var uri = 'api/affiliate';
//clear the list div first
$("#aff_name").empty();
var aff_id = $('#aff_id').val();
$.getJSON(uri + '/' + aff_id)
.done(function (data) {...
and here is my post request in jquery:
$.ajax({
type: "POST",
data: JSON.stringify(address),
url: "api/affiliate/",
contentType: "application/json"
});
Thank you so much for your consideration.
|
|
|
|
|
Are you sure you're simply not running both bits of javascript?
|
|
|
|
|
I am using linq to sql. I want to fetch single row from stored procdure by providing specifc id and show columns data into textboxes any body have idea?
Below is my query and store procdure:
var db = new dbDataContext();
var query = from emp in db.Sp_Getvalue(idget)
select emp;
and something like below I want:
txt1.Text = query.EMP_FNAME;
txt2.Text = query.EMP_MNAME;
txt3.Text = query.EMP_LNAME;
txt4.Text = query.EMP_EMAIL;
txt5.Text = query.EMP_DOB;
|
|
|
|
|
Hi,
I am going through an issue with Telerik controls, all my Telterik Control because disabled, like RadEditor, RadListBox and RadAutoComplete. I installed the Telerik Version=2016.1.113.35, before that I was having the Telerik Version=2015.2.623.45. After installing I converted all my Application and its related components from .Net 3.5 to .Net 4.0, now all my Telerik Controls became disabled, the ones which were working before also became disabled.
Any help what could the reason and solution for it, any think like a link, a code snippet or even a suggestion would be helpful.
Here is my code:
<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="ResearchStudiesAdmin.Website.Login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radLongDesc" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings><br />
</telerik:RadAjaxManager><br />
<telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
<div class="demo-containers">
<pre>
<div class="demo-containers">
<telerik:RadEditor Height="300px" Width="700px" ID="radLongDesc" runat="server" ToolbarMode="Default"
StripFormattingOptions="all" ContentAreaMode="Div">
<tools>
<telerik:EditorToolGroup Tag="MainToolbar">
<telerik:EditorTool Name="Print" ShortCut="CTRL+P" />
<telerik:EditorTool Name="AjaxSpellCheck" />
<telerik:EditorTool Name="FindAndReplace" ShortCut="CTRL+F" />
<telerik:EditorTool Name="Cut" />
<telerik:EditorTool Name="Copy" ShortCut="CTRL+C" />
<telerik:EditorTool Name="Paste" ShortCut="CTRL+V" />
<telerik:EditorTool Name="FormatStripper" />
<telerik:EditorTool Name="PasteStrip" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="Undo" ShortCut="CTRL+Z" />
<telerik:EditorTool Name="Redo" ShortCut="CTRL+Y" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup Tag="InsertToolbar">
<telerik:EditorTool Name="LinkManager" ShortCut="CTRL+K" />
<telerik:EditorTool Name="Unlink" ShortCut="CTRL+SHIFT+K" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup Tag="Superscript">
<telerik:EditorTool Name="Subscript" />
<telerik:EditorTool Name="InsertParagraph" />
<telerik:EditorTool Name="InsertHorizontalRule" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="Bold" ShortCut="CTRL+B" />
<telerik:EditorTool Name="Italic" ShortCut="CTRL+I" />
<telerik:EditorTool Name="JustifyLeft" />
<telerik:EditorTool Name="JustifyCenter" />
<telerik:EditorTool Name="JustifyRight" />
<telerik:EditorTool Name="JustifyFull" />
<telerik:EditorTool Name="JustifyNone" />
<telerik:EditorTool Name="Indent" />
<telerik:EditorTool Name="Outdent" />
</telerik:EditorToolGroup>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="InsertOrderedList" />
<telerik:EditorTool Name="InsertUnorderedList" />
<telerik:EditorTool Name="ToggleTableBorder" />
</telerik:EditorToolGroup>
</tools>
</telerik:RadEditor>
<br />
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Long Description."
CssClass="ErrorMsg" ControlToValidate="radLongDesc" ValidationGroup="vgSave" Display="Dynamic"></asp:RequiredFieldValidator>
</div>
</div>
Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
If they are all disabled it sounds like a licensing issue, perhaps. Either way, I'd suggest contact their support to figure out what has happened.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi,
I am new to the Telerik, I have big story to ask, first I installed the Version=2016.1.113.35 on my Local machine, and started using the application everything was working good, before that I had different Version=2015.2.623.45 of Telerik on the same machine on top of it I installed the current Version=2016.1.113.35. But when I deployed it on the Server, and server has the older version= 2015.2.623.45 that I had on my machine. And on the Server Telerik controls stopped working like RadEditor was completely disabled.
Then I did some crazy mistake, I tried to manually copy the dlls of the same Version from Server and added them in to References thinking that this will work as backward compatibility would exist. Now it started giving me different Compilation errors. I am little frustrated can somebody please help me in this regards.
My errors are as below:
Unable to resolve type 'Telerik.Web.UI.RadAjaxLoadingPanel, Telerik.Web.UI, Version=2016.1.113.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4'
Unable to resolve type 'Telerik.Web.UI.RadTextBox, Telerik.Web.UI, Version=2016.1.113.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4'
Unable to resolve type 'Telerik.Web.UI.RadMaskedTextBox, Telerik.Web.UI, Version=2016.1.113.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4'
Unable to resolve type 'Telerik.Web.UI.RadAutoCompleteBox, Telerik.Web.UI, Version=2016.1.113.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4'
Unable to resolve type 'Telerik.Web.UI.RadAjaxManager, Telerik.Web.UI, Version=2016.1.113.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4'
And my Web Config is as below any help please?
<remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
<remove name="Telerik_Web_UI_DialogHandler_aspx" />
<remove name="Telerik_RadUploadProgressHandler_ashx" />
<remove name="Telerik_Web_UI_WebResource_axd" /><add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
<add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
Any help would be very very helpful a link, a code snippet or even a suggestion would be very very helpful, thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
That's because the assemblies are Strong Named. You need to use the same version on both the Dev machine and the server.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
I need the project .. Using Complex Event Processing for Dynamic Business Process Adaptation (CEVICHE Framework) In C#.Net
|
|
|
|
|
Then you 'need' to start designing it. We have no idea what is is supposed to do.
|
|
|
|
|
This looks like you're referencing an article. There should be a code download link on the article itself or a sub forum attached to it. Posting here makes it completely pot luck if the original author will see it or feel inclined to double their effort up.
|
|
|
|
|
A quick Google comes up with a bunch of links to various documents from around 2010. It looks like there isn't any kind of source code for it.
What do you get when you cross a joke with a rhetorical question?
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
Do questions with multiple question marks annoy you???
|
|
|
|
|
Hi All,
I have deployed my web application on the Server and it started giving me the following error, I tried by giving Permissions to IISUser still it is giving me the error.
Just a small thing I did was before I deployed the Project I myself have given the Network Share on that folder so that I can have direct deployment, and I didn't change Web config or deployed it. Still it started giving me the following error.
Can anybody please help me in resolving this issue? Thanks in advance.
Here is the error message I am getting when I tried to browse the default page on the IIS.
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Config File \\?\D:\websites\IntranetAdminApplications\ResearchStudiesAdmin\web.config
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
It's not clear what you're doing TBH, I don't know why it is looking at "\\" for your web.config file? The files all need to be in the physical directory, they're not going to run via UNCs as IIS doesn't have rights to access remote machines.
|
|
|
|
|
|
The message as here
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070005
Config Error Cannot read configuration file due to insufficient permissions<br />
Config File \?\D:\websites\IntranetAdminApplications\ResearchStudiesAdmin\web.config
Requested URL <a href="http://intranettools.development.sutterhealth.org:80/ResearchStudiesAdmin/Default.aspx">http:
Physical Path D:\websites\IntranetAdminApplications\ResearchStudiesAdmin\Default.aspx
Logon Method Not yet determined
Logon User Not yet determined
It is saying Config source as
-1:
0:
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
That looks like incorrect NTFS permissions on the web.config file.
On the server, open the root folder of the site in Windows Explorer. Right-click on the folder and select "Properties". On the "Security" tab, make sure that the IIS_IUSRS group has read access.
If the group already has permission, click "Advanced", tick the "Replace all child object permission entries with inheritable permission entries from this object" box at the bottom of the Advanced Security Settings dialog, and click "OK". That will reset the NTFS permission on all files and folders below the selected folder to match the permissions on the selected folder.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|