I need help to connect WebSocket SignalR - asp.net

i have a problem to connect my app.js on my hubs/socket.js
when made my js and put the conecction
var stream = $.connection.sockets;
show my this error
app.js:2 Uncaught TypeError: Cannot read property 'sockets' of undefined
i coppy a example from other proyect and i don't know how does it work
i made the proyect in asp.net mvc in visual studio 2015

What is the order of js references you have made?
Also, have you added reference to the signalr jQuery library and signalr/hubs?

Related

Aspnet Angular SPA template not working after updating to angular 5

I have updated aspnet JavaScriptServices angular template to Angular 5.0.2
everything looks fine but when it published i'm getting following error
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: No ResourceLoader implementation has been provided. Can't read the url "app.component.html"
Error: No ResourceLoader implementation has been provided. Can't read the url "app.component.html" at Object.get
If I turn off the server side prerendering, by removing asp-prerender-module="ClientApp/dist/main-server" then it will work fine without any issues.
Any ideas on this?
Note: I have done the changes to use AngularCompilerPlugin instead of AotPluginas well

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.

Trouble using Epplus and Service.svc

I have a Web Site with an Service.svc file, i created this using the Add New Item -> AJAX-enabled WCF Service, for weeks, everything works fine.
Today, i imported the EPplus.dll to generate some excel files. When i try to compile i get this error
Error 1 Reference.svcmap:
Failed to generate code for the service reference 'QUAY.Tractebel.COP.Servicos'.
Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension:
System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Type 'OfficeOpenXml.ExcelRangeBase' is a recursive collection data contract which is not supported.
Consider modifying the definition of collection 'OfficeOpenXml.ExcelRangeBase' to remove references to itself.
XPath to Error Source: //wsdl:definitions[#targetNamespace='']/wsdl:portType[#name='Servicos'] App_WebReferences/QUAY/Tractebel/COP/Servicos/
I have no idea how to solve it, someone can help me?
Just had the same problem while referencing a custom wcf class i use.
The strange problem is that on my old development pc (windows vista 32bit, visual studio 2010) i haven't got this problem, it only pops up in my new system (windows 8 64bit).
Bah.
However, i bypassed the problem opening App_WebReferences --> "your service name" --> Right click on depending Refrence icon --> "Configure service reference"
In this screen move the option button from "Reuse types in all referenced assembiles" to "Reuse types in specified assemblies" and check all the depending libraries EXCEPT EPPlus
Compile and ... voila
If someon has also a logic explanation, i'll gladly listen

unable to generate fault type while calling java axis webservice

Hi my sincere thanks to techies,
let me explain what im facing issue.
iam calling axis java webservice from vs 2010
if iam trying to call the service direclty using [.wsdl] link using soap ui and in .net add ref im getting errors.
now i was generated the wsdl file and type1.xsd and fault.xsd from java tools.
if im using these .wsdl phycal file ,im unable to get the fault.xsd, or fault type
and in proxy the fault class is not created.
can you help where im doing wrong.
thanks
If you want to call Axis Service from .net client, use wsdl.exe from visual studio command prompt to generate proxy or use Service Reference. That will make your task easy

404 Error using Flash Builder 4 BlazeDS wizard

My issue this time around is trying to use the new DCD BlazeDS wizard in Flash Builder 4. If I set my project up as a combined Java/Flex app I am unable to connect to the RDS servlet using the wizard. I get a 404 error every time.
I'm certain the service is set up correctly since my app can access the exposed java classes and BlazeMonster can see the exposed services.
Is anyone else having this issue and if so has anyone found a work-around? I'd very much like to use the code generation features of the wizard for my project.
Thanks as always,
Codeflayer
You also need to make sure you have the RDSDispatchServlet setup in the web.xml config file.

Resources