SignalR StockTicker example not working - asp.net

Hello and thanks for trying to help :).
I am currently attempting to learn basic signalR so I downloaded the library with NuGet to an existing application to test it out.
The existing app is written in VB (not sure if thats a problem or not)
Error im receiving is "ticker is undefined" which from what I understand is the connection string.
Now Ive read that it MIGHT be the hubs dir which seems to be working fine. So i'm stuck. Any idea's would be great.

Figured it out. Turned out that because the app was written in vb I had to add a cs code to the app code folder and then map it in the web.config.

For me this was solved because i wasn't including the auto generated file "../signalr/hubs"

Related

SignalR $.connection not defined, intermittent successful definition on some PCs

I have a MVC5 project using signalr to perform updates to a list. Inside script.js, there is a variable link to defined as var link = $.connection.hub. There is also a bundleconfig file to load the dependent scripts, signalr/jquery and jquery in the proper order of course.
The script /signalr/hubs is loaded in from the html manually.
bundles.Add(new ScriptBundle("~/bundles/signalr").Include(
"~/Scripts/script.js",
"~/Scripts/jquery.signalR-2.0.2.min.js"));
When the VS 2013 Web project is run, it works fine until the project is copied over to another PC that it does not work as intended. The variable link is undefined as $.connection is undefined too ($ is defined though).
I presume that jquery.signalR-2.0.2.min.js is not read or executed at all.
Questions:
Might this have anything to do with the environment of the PCs? (Windows 7 is OK, Windows 8 is not OK)
What could prevent jquery.signalR-2.0.2.min.js from running?
Does creating a new View/Controller play a part in the error (creating a view, using a layout page)?
Please see similar question: SignalR and MVC bundle as it shows how to add SignalR into an MVC bundle. I think their answer should help solve your problem.
I would comment instead of answer, but I don't have enough reputation.

Using HighchartsExport Library for .Net I am getting Blank Page

I am working on embedding HighStock/HighCharts into our site and we want to enable users to export the charts without sending the data off to the HighCharts servers to render the jpg/pdf/svg etc. The only ASP.NET wrapper I could find is this. This worked well on a local demo build but integrating this into our product site is giving a blank page for:
http://oursite.com/path/where/called/HighchartsExport.axd
Following the sparse documentation I verified that I had added a reference to the 3 DLLs needed. Our site already uses the requestValidationMode needed (2.0). So I added just the httpHandlers item:
<add verb="POST" path="HighchartsExport.axd" type="Tek4.Highcharts.Exporting.HttpHandler, Tek4.Highcharts.Exporting"/>
I am not sure what else is needed here to get this to work. Any help would be greatly appreciated.
Perhaps it helps to run a chart.getSVG() before you send the SVG to the ASP.NET export-module. This will sanitize the SVG representing the chart.
When this asp exporting module isn't working for you, you could consider using PhantomJS and run a shell command with the Highcharts convert script for PhantomJS. Or perhaps run this script as an internal webserver and do an POST request from your .NET application. This is how the java export-server of Highcharts is working in general. Read more on Highcharts, PhantomJS and exporting to images here
I faced a similar issue before, the issue was in a part of the HTML rendered that caused error while exporting.
if there is a clip-path tag in your chart HTML, try to remove it before export.

Flex Webservice in swf question

I'm trying to use for getting infomation from an WSDL file online. I have no problem running and testing in my FLEX 3 builder. However, After I export release build into SWF file. The program doesn't work even running local. IE/firefox said "transferring data from http://www.webservicex.net" on the status bar and doesn't response.
This is my code for webService tag:
<mx:WebService id="stockWebService"
wsdl="http://www.webservicex.net/stockquote.asmx?WSDL"
fault="handleFault(event)" result="handleResult(event)"/>
I try to google the problems but cannot found the answer. Can someone please help me? Thank you very much for you time!

silverlight error - the opreation is not supported for a relative uri

I've just started developing silverlight applications. I've created a webserivce in my asp.net project. Now, when I try to connect to it through my silverlight project I receive the following error:
"the opreation is not supported for a relative uri"
I am using the following url -->
http://192.168.1.2/MyWebsite/SubVersionedHistory.svc
I can find the class and its methods, but I receive this horrific error when I add it.
Thank you for your help and advice,
Vondiplo
I don't think you're alone in hitting this problem. I hit it today with VS2008SP1 + SL2 trying to create a Service Reference for an ADO.NET Data Service. First time I've hit the error.
Others have detailed similar experiences to reach this error:
http://silverlight.net/forums/t/87535.aspx
http://silverlight.net/forums/t/56629.aspx
It's not entirely clear at this point if the issue is with the IDE "Add Service Reference" dialog or something specific in the services causing this error. In my case, however, my code still worked despite the error message. I simply passed the URL to my service in the constructor of my DataService proxy client, like this:
var context = new DataServiceContext(new Uri("NorthwindDataService.svc", UriKind.Relative));
Summary point: Just because you hit this error in the IDE, your service reference may still work. Give it a try and let us know if you're seeing errors at run time.
Hope that helps.
[UPDATE] Based on some other advice I've found and tested, you can also try:
deleting your Service Reference
deleting your ServiceReferences.ClientConfig file
saving your solution
and then closing and reopening it in VS.
The simple act of closing and reopening your project has been shown to fix several problems with the Add Service wizard. Re-run the Add Service Ref wizard and you may have better luck. I personally tested this solution on a project today and can confirm it works. Hope that adds extra help to finding your solution.
You should be more specific about your problem. For example, are you having this problem when adding the reference or when you actually try to consume the service?
It sounds like you need to be using a full path, including the "http://" but that is just a shot in the dark based on the error message you provide.
[edit]If you are using the built in ASP.NET server instead of IIS then be sure you set a specific port number and use it in your path. For example, I have used http://localhost:4940/MyService.svc for testing[/edit]
Maybe this response can help you
You cannot use AbsolutePath, You need to use AbsoluteURL. Build your URL this way:
Uri url = new Uri(App.Current.Host.Source, "../settings.xml");client.DownloadStringAsync(url);
http://silverlight.net/forums/p/28912/95541.aspx
HTH
Braulio
Check the ServiceReferences.ClientConfig
if there are multiple endpoints there you will get this exception. one thing that can cause this is referencing a service using casini, later switiching to IIS express and rereferencing the service.

Why is this code stopping? VB ASP.NET

Hey I am coding using Visual Studio 2003. My program worked fine until I introduced a dll I made using CreateObject.
Code:
Set docs2 = server.CreateObject("DocGetter.Form1")
docs2.GetDocument oXMLDom,numID
It appears to be getting stuck at this code. I've already used regasm to register the dll.
What else could be wrong?
Add a reference to the dll in your project and instantiate the object like this:
Dim docs2 As New DocGetter.Form1()
If that doesn't make sense, then fix it so it does. There's no good reason to use CreateObject in .Net code. (Okay, that's hyperbole. But the principal is sound).
Can you clarify - is this a web app or a client (winform) app? Form1 sounds like a winform. ASP.NET runs at the server, so showing a form would be inappropriate - it would happen at the server, not the client. In short, don't do this!
I also can't see where "stored procedures" figures in this, so I've removed the tag.
What are you trying to do? Options for showing something more complex at the client include:
dhtml
flash
silverlight
clickonce [requires windows client]
ocx [not recommended]
I'd bet money that this function isn't defined with this name and/or parameters.
docs2.GetDocument oXMLDom,numID
But because of the way you're instantiating the object, the compiler has no way of knowing this... I think.

Resources