best method to refer .Net functions via php - c#

can any one please advice me, is there any possibilities to access .Net modules using php

One thing that i can suggest is
step 1 : create web service in .net which is client script enable
or create one aspx page
setp 2 : call the web service method or web page using jquery ajax or javascript ajax
by this way you can achieve things you want

Ditto pranay. .NET makes it extremely easy to create WSDL-based web services that PHP can easily communicate with. In my experience you should shy away from using DLLs if you can - doing so locks you into running your application on IIS, bit of a nasty surprise and rewrite if you ever need to switch your PHP application to a *nix based server setup.
However, depending on your needs you may not want/need to call it using jQuery. PHP has more than adequate SOAP functionality built into the core.

Related

Calling JavaScript functions in a service

I don't know if what i want to do is possible, but I have a JavaScript library i would like to use in the Server end of my Blazor app. Specifically in a service class.
My Blazor app has 2 environments, a Client and a Server. I am able to call my JavaScript functions on the client end using wwwroot/index.html and a blazor component, but i'm not sure how to go about doing it in the Server end. A lot of the documentation suggest providing the JavaScript function in Pages/_Host.cshtml but my project doesn't have (it has only Pages/_Layout.cshtml)
Any help is appreciated!
If you have a wwwroot/index.html and you don't have Pages/_Host.cshtml means you are using Blazor WASM project hosted by a Server project but the app code doesn't run on the server. It runs only on the browser.
If you want to use a JS library on the Server project you need to use nodejs and INodeServices. You can read this post to know how to use it : https://www.c-sharpcorner.com/article/nodeservices-where-javascript-and-net-meet-back-on-the-other-side/
INodeServices is now obsolete and there isn't replacement but you can still use it. Or you can choose to use Javascript.NodeJS instead.

Is there such a thing as an entirely empty website project?

I'm looking at working my long-standing API to run on IIS rather than in a desktop app as it is now. Everything on the API is working so I'd rather not change too much if I don't have to. I know about the new Web API template in ASP.NET MVC 4 and I've worked with it, but I found that it didn't give me the control over everything that this particular project needs.
So my question is, is there any way to build an application for IIS that has something like an entry-point where I can just get a web request then use entirely my own code from there? Or do I have to build something that uses the Web API?
Yes, you'll want an ASP.NET handler.
How To Create an ASP.NET HTTP Handler by Using Visual C# .NET
http://support.microsoft.com/kb/308001
You'll need to handle parsing the request and serializing the result yourself. It's probably much better to create a web-api facade in front of your services than trying to do it manually.

Login to ASP .NET MVC website under HTTPS using Windows Service

I have some administrative methods under ASP .NET MVC website that is under https.
So it looks like
https://mysite.com/cms
and there are some actions like CheckUsers
My question is
Can we develop some external Windows Service to sign in to that website and execute some methods?
I mean how to do it technically (sign in and call methods?)
So tha chain is like that
Windows Service <---> call method CheckUsers() under
https://mysite.com/cms <---> other https://site2.com
I just need to automate execution of some methods and do it periodically with Windows Service.
It is a question of possible communication between Windows Service and ASP .NET MVC.
Any clue?
We've been using http://htmlunit.sourceforge.net/ for sending requests to third-party web sites. It allows you to send requests, receive response/status code/etc. Basically, its a small GUI-less browser which evaluates HTMKL, JavaScript, etc.
(it's a Java lib, so you could either google for a .Net port or use a converter to convert Java assembly into .Net assembly - see http://blog.stevensanderson.com/2010/03/30/using-htmlunit-on-net-for-headless-browser-automation/ for guidance. We've used the convertion approach).
If your requirements are less sophisticated, you can just use HttpClient or WebClient to send simple requests and parse responses manually.
NB: in case you're going to parse HTML manually, I suggest that you use Html Afgility Pack: this is the right way to parse HTML(mainly, because it "fixes" invalid tags, errors, etc).

C#/ASP Based Reverse AJAX

I have a current project running using APE that needs to work on C#/.NET... I was wondering if anyone had any suggestions for either a method of approaching Reverse AJAX/Comet on C#/.NET or any packages such as APE that are available.
EDIT
For clarification, APE doesn't work on Windows. Which is a restriction I have with the project.
I think that you asking for something like
http://www.frozenmountain.com/websync/
or
http://www.aaronlerch.com/blog/2007/07/08/creating-comet-applications-with-aspnet/
This is called comet technique and is a web application model in which a long-held HTTP request allows a web server to push data to a browser, without the browser explicitly requesting it.
PokeIn comet ajax library works platform independent. ( Mono + .Net )

How to transform a WebService call that is using behaviours?

We have some really old code that calls WebServices using behaviours (webservice.htc), and we are having some strange problems... since they've been deprecated a long time ago, I want to change the call.
What's the correct way of doing it? It's ASP.NET 1.1
You should be able to generate a proxy class using wsdl.exe. Then just use the web service as you normally would.
While I'm not 100% sure what the Web Service behavior does, I recall it allows client-side script to call Web Services, which would make AJAX it's contemporary replacement.
Since you're using .NET 1.1 how about using Ajax.NET Professional to connect to the web services?

Categories

Resources