How to use client-side script(javascript) in .Net Remoting

Hi all,

    It was known that SAO and Singleton object about .Net Remoting. When I Create an object in server side and hosting in IIS's virtual directory,I want to use javascript asynchronous invoking the remote object by HTTP channel, 80 port and SOAP formatter just like XMLHTTP invoking web service. My code as following,

<script> 

objXmlDoc = new ActiveXObject("Msxml2.DOMDocument");

objHttp = new ActiveXObject("Msxml2.XMLHTTP");

strEnvelope = ??

objHttp.onreadystatechange = function()

{

...... 

 

szUrl = "http://ServerName/RemoteService/RemoteObjectURI.soap";

objHttp.open("POST", szUrl, true);

objHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

objHttp.send(strEnvelope);

</script>

 

I have some problems.

First, what is the strEnvelope ?

Second,is the szUrl right?

Is anything else?

Thanks.Embarrassed

0
NathanTsai
9/17/2007 8:27:28 AM
asp.net.networking-webservices 2181 articles. 0 followers. Follow

2 Replies
1155 Views

Similar Articles

[PageSpeed] 15

I am trying to do a very similar thing.  I have an object Remoted and would like to AJAX enable the object.  By using IIS to host the Remote object, IIS magically provides a SOAP interface to the Remote object, and the WSDL can be seen by appending ?wsdl to the URL, for example, http://ServerName/RemoteService/RemoteObjectURI.soap?wsdl.  So, the object should be consumable by client script.

It seems to me if we could figure out how to point the ASP.Net AJAX client scripts to ANY web service instead of only .Net web services with the [System.Web.Script.Services.ScriptService()] attribute the problem would be solved, and there would be no need to instantiate the ActiveXObject, set the SOAP Envelope, etc... as those would be handled by the ASP.Net AJAX client scripts.

 Is it possible to have the ASP.Net AJAX SOAP proxy point to a web service that does not contain the [System.Web.Script.Services.ScriptService()] attribute?

 

0
rdestryw
10/17/2007 5:20:02 PM

In my previous post I assumed you wanted to consume the Remoted service using the built-in ScripManager and ScriptService utilities provided by ASP.Net AJAX (which is my case).  Still assuming so, I found a solution here:  http://www.ftponline.com/channels/net/2007_09/dwahlin/ that I had actually thought of, but at the time assumed it was unnecessary.  However, it seems the ScriptManager may have some restrictions and other complexities, so this solution begins to sound more reasonable.  The basic idea is to wrap your Remoted object with a .asmx Web Service, because the .asmx is easily consumable by the ASP.Net AJAX framework. 

Unfortunately I can't be of much help if you're writing your own JavaScript proxy.  I have used webservice.htc in the past which makes it easy to consume Web Services, but it is out dated and and has some other quirks.

 

 

0
rdestryw
10/17/2007 7:38:45 PM
Reply:

Similar Artilces:

How to use client-side script(javascript) in DNA using .Net Remoting
Hi all,     It was known that SAO and Singleton object about .Net Remoting. When I Create an object in server side and hosting in IIS's virtual directory,I want to use javascript asynchronous invoking the remote object by HTTP channel, 80 port and SOAP formatter just like XMLHTTP invoking web service. My code as following, <script> objXmlDoc = new ActiveXObject("Msxml2.DOMDocument"); objHttp = new ActiveXObject("Msxml2.XMLHTTP"); strEnvelope = ?? objHttp.onreadystatechange = function() { ...... }   szUrl = "http://ServerNa...

How to use HTTP protocol in .Net Remoting? Thanks and Regards,How to use Http protocol in .net Remoting
<>Hi,     <><>How to use HTTP protocol in .Net Remoting ? Is there any specific code bits requires for that ?    I am using TCP protocol it's working but when i change it to  HTTP it throwing an error like "Arugument null exception"<>  Could  anybody give samples for that? Thanks & Regards,Vijay Here is an example of HTTP remoting:http://msdn2.microsoft.com/en-us/library/system.runtime.remoting.channels.http.httpchannel.aspxCheers,       Kev...

Using AJAX and client side scripting with .NET objects?
I'm wanting to use client-side scripting and AJAX with some drop down boxes.  I can't seem to do this with server-side .NET objects... changing the runat tag doesn't do anything either.  How can I expose .NET server objects so that they are affected by java script and AJAX? Depends on what, exactly, you're trying to do with them.  If you just need access to the html properties (e.g. selectedValue), then you simply grab them as if they were their html equivilants (select element) in javascript.  If you want to pass custom properties back and forth (or any .Net property ...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

How to write data to a file in client side using javascript or someother client side scripting language.
Hi, I would like to know how to write a data to a client side file using javascript or someother client side scripting language. The file type expected is ini file. txt file would also be appreciable. Thanks in advance.   If the site is a trusted and you are running IE then you could try http://www.w3schools.com/asp/asp_ref_filesystem.asp The Old Sewing FactoryThat twitter nonsense. You can write to the server, but not to the client's machine.  Being able to do so would be a huge security breach.When you ask a question, remember to click "mark as answered"...

In datawindow.net,access the database from client side event using javascript
In powerbuilder,for example,a datawindow has two columns:itemno,description. input an itemno,validate it.if not found from the database,return 1 to trigger itemerror event; if found,get the description of the item from the database,and fill it into the column "description". The question is how to fulfill the function in web datawindow,through web service? if so,I need an example to realize it. You will need to use AJAX or make a round trip on item change event. -- Dean Jones CEO PowerObjects http://www.powerobjects.com (612) 339-3355 Ext. 112 TeamSybase * *...

what is difference between webservice and .net remoting in .net
what is difference between webservice and .net remoting in .net Refer a good article on this at http://www.developer.com/net/net/article.php/2201701  The answer depends partly upon upon which version of .Net you are referring to. With 3.0/3.5 you have Windows Communication Foundation (WCF) which at runtime can be switched between being a web service and comminucation by remoting.The difference boils down to: Web ServiceHttp or HTTPS transmission of an XML data stream.Can be cross platform and open protocol.RemotingBinary transmissionMicrosoft only. Don't forget to click &qu...

When to use client side varidation and server side varidation in .net?
In .net or classic web application we can varidate user data either on client isde or server side. How to select which side varidate to be used? Thanks! Generally, I use both client and server validation. I make sure the input is in the correct format and reasonably valid on the client, then I verify the data on the server. The extent of validation also depends on the type of data that I need to validate.Here are a few references:Validating ASP.NET Server ControlsIntroduction to Validating User Input in Web FormsClient-Side Validation for ASP.NET Server ControlsSecurity Checklist...

communication between client side(java script) and server side in .net project
I have a question which is, when building a .net project, we are able to use server side code and client side code(java script). How do they communicate? Thanks Client Side coding works with the WebBrowser. So when ever you write client side code you have to keep browser compatability in your mind and you have to code. Server Side code works with Web Server (IIS) and it's ASPNET ISAPI's. The won't directly communicate with each other. But using AJAX you can all server side code from Client Side! Example article on Ajax@ http://www.devarticles.com/index2.php?option=content&task=...

WebService as client in .NET Remoting scenario
Hello... I am implementing .NET remoting with a WebService as client. All works fine the first time, but when I call again the method from WS that gets the remote object and calls a remote method, I don`t get into the method(I've put a breakpoint in it... and it stops only the first time...). The second time I get to this line... and ... it stops... no exeption.. no nothing.. remoteObject.Test(); where remoteObject = Activator.GetObject(typeof(Remotable), location) as Remotable; I`ve implemented a Singleton pattern for a Class in WS like this :   interface ISingleton ...

.Net varible into client side JavaScript
I'm need to get a variable from my web app and place its value in a JavaScript. I tried doing this with a Label but I get the HTML included. I don't think I can use the <%# %> from classic ASP? Anyone have any ideas on how they would approach this problem? tbone_stl wrote:Anyone have any ideas on how they would approach this problem? Hi, and welcome to the ASP.NET forums. It's possible to pass a variable to a javascript function. I created a small coding snippet: <%@ Page Language="C#" %>   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http...

how ro use EAServer webservice in dw.net dev in vb.net?
i use pb10 dev a webservice but use dw.net have any problem such as sybase.datawind.blob, fullstate,changes and so on.how to deserialize Since PB10 is in beta, you need to post such questions in the private beta newsgroup. On 3 Jun 2004 07:21:01 -0700, "ma.frank" <ma.frank@163.com> wrote: >i use pb10 dev a webservice but use dw.net have any problem such as >sybase.datawind.blob, fullstate,changes and so on.how to deserialize > Bruce Armstrong [TeamSybase] http://www.teamsybase.com Two new books on developing with PowerBuilder http://www.pb9books...

Client validation using both Javascript and .NET controls
 Hello,I have implemented an online questionnaire. The questionnaire is composed by several textboxes to gather information such as name, organization,email, phone, etc. and a long series of radiobuttonlists and textboxes (text area). These last textboxes need to be filled out only if the user select a specific value in the radiobuttonlists.To perform client validation I used .NET controls to check the format of the first textboxes (name, organization,email, phone, etc. ) and the text areas to ensure that no invalid characters have been entered.To check the all the radiobuttonlist has b...

how to consume a .net webservice using java client ?
Hi experts, I really need your help. I have create one .net webservice , it is really simple , the code is shown below .   [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Service1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { ...

Web resources about - How to use client-side script(javascript) in .Net Remoting - asp.net.networking-webservices

Resources last updated: 11/23/2015 8:35:46 PM