Writing A Simple Webservice In C# And Calling It From Ruby On Rails

Mar 12, 2010

I need to create a simple webservice in C# but I'm not sure where to start (I've coded UI apps in C# before but all my web experience is in Ruby on Rails). Where do I start?

The only client for the webservice will be a Ruby on Rails app so there's no need for any HTML rendering. I was thinking of just returning a XML or YAML formatted string unless there's an easier way. I'm not too keen on SOAP but if it's easy/natural in C# & Ruby then I'd consider it (or anything else).

View 4 Replies


Similar Messages:

MVC Versus Ruby On Rails

Nov 30, 2010

If you were starting a new web development project would you use ASP.Net MVC 2 or Ruby on Rails?

I have recently invested some time in to learning Ruby on Rails because I wanted to learn a solid web development framework. Then I took a new job where I will be using ASP.Net MVC 2.

I know this question is very subjective, but I am planning to write some websites on my own, outside of work, and I would like to get some opinions from others.

View 4 Replies

What Is Faster MVC Or Ruby On Rails

Nov 16, 2010

I am investing some time in learning ASP.NET and more specifically ASP.NET MVC and I am curious how it stacks up to the competition. I really like what I am seeing so far with the framework, and I think the icing on the cake would be if it shows rock solid speed like I have seen with some ASP.NET form sites.

Has anyone done or seen fair comparisons or benchmarks? I would be interested to see how ASP.NET MVC stacks up against other solutions such as PHP MVC too.

View 2 Replies

Is There An Equivalent To Ruby On Rails' Respond_to Format.xml, Etc In MVC

Jan 8, 2010

In Ruby on Rails you can write a simple controller action such as:

def index
@movies = Movies.find(:all)
respond_to do |format|
format.html #index.html.erb
format.xml { render :xml => @movies }
format.json { render :json => @movies }
end
end

For those unfamiliar with RoR, def index in this case would be the equivalent of public ActionResult Index() within an ASP.Net MVC Controller and would allow the following calls:

[URL] returns as an html page from the view index.html.erb (think index.aspx)[URL] returns the same data in xml format (@movies is the object containing the data all of the views use)[URL] returns a JSON string, useful when making javascript calls needing the same data/logic

An equivalent flow in ASP.Net MVC would (if possible) likely look something like this (if it could be less verbose, even better):

[code]....

View 3 Replies

Which Technology Is Best For A Facebook Application Ruby On Rails Or C#

May 13, 2010

My friend and I want to write a Facebook application. We've narrowed down the list of possible technologies to Ruby on Rails and C# with ASP. Here are the pros and cons we've thought of.

Cons:

ASP - proprietary tools like Visual Studio etc. cost (lots of) money. We both don't know ASP (although we're not bad at C#).

RoR - It's scripting so might be harder to maintain. My friend doesn't know RoR at all (but he's a fairly proficient programmer so will probably be able to pick it up quickly).

Pros:

ASP - Facebook has an official SDK for .NET.
RoR - I know RoR. It's open source, free and has fast development time.

What says the community? Is there something we haven't thought of?

View 2 Replies

C# - Comparing Framework To Cakephp, Zend , Ruby On Rails?

Mar 27, 2010

I am a PHP developer migrating to C# ASP.Net Framework. As of right now, I am experienced in using Php for developing sites and I use CakePhp and Zend framework as my RAD tools to produce better applications.

As I move over to ASP.NET, I have this view that C# ASP.Net framework itself is already a RAD tool and is equivalent to using Cakephp, Zend, or even Ruby on Rails. So I really shouldn't have no concerns trying to find a separate library for ASP.NET that will better applications. To me, in a sense the ASP.NET is already like a MVC cause it seperates the model from the view and the methods are almost like controllers.

View 1 Replies

C# - How To Learn Ruby On Rails As A Complete Programming Beginner

May 8, 2010

I want to build a scalable dynamic Web Application. I have never programmed an Object Oriented language before. Or, let's just say I am completely new to programming, because the previous experiences aren't worth talking about.

I know I have a really big task ahead of me ^^ but I wanted to get into coding for the last 10 years and now that I'm finally doing it, I would like to know how to get there in the most efficient way.

Any good books/tutorials you could recommend?

View 4 Replies

Finding Good Ruby Tutorials On Rails Book For A Developer

Dec 3, 2010

I'm predominantly a .Net developer but am wanting to look into ruby on rails.

Has anyone else been in this situation? And can they recommend any good books/tutorials/general resources for someone wanting to cross over?

View 3 Replies

AJAX :: Cascading Dropdown Not Calling Webservice - Super Simple Example Just Not Working

May 25, 2010

I ultimately need to show countries in one drop down then states/provinces drop down of the previously selected drop down. I'm sure everyone has seen this many times. My page shows the countries but does not show values in the province/states drop down. It's as if the webservice is never run. I've tried removing and adding the ajaxtoolkit reference. The tableadaters run simple working sql code. I'm really at a lose here.

default.aspx:
...
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
...
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<%--Dropdown to display countries--%>
Country:<asp:DropDownList ID="ddlCountries" runat="server" DataSourceID="ods_Countries"
DataTextField="country" DataValueField="abbreviation">
</asp:DropDownList>
<%--data source for the country drop down list--%>
<asp:ObjectDataSource ID="ods_Countries" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="GetAllCountries" TypeName="countryDataSetTableAdapters.CountriesTableAdapter">
</asp:ObjectDataSource>....................................

View 8 Replies

MVC :: Equivalent To Ruby On Rails "script/runner"?

Mar 29, 2010

I'm new to ASP.NET MVC and come from a Ruby on Rails background. In Ruby on Rails you can use the "runner" script (http://guides.rubyonrails.org/command_line.html#runner) to load up the app along with the rails framework and then run a script that accesses the model, etc. I use this to run scripts that fetch data from other databases and then insert it into my app's db using the methods on the model classes.s there a similar option in ASP.NET MVC?

View 3 Replies

Calling/writing The Results Of A Function?

Dec 13, 2010

I am trying to show the results of a function with information from a form on the previous page.I was working on this project in the past and the following code worked, but it does not anymore.I know its alot to look at but if someone could help that would be great.The form on the first asp page:

<FORM METHOD="POST" ACTION="RollingRiverFarmCustomerQuote.asp" id="InformationForm">

View 10 Replies

Parsing Simple Xml With Jquery From Webservice?

Nov 8, 2010

I'm breaking my head over this for a while now and I have no clue what I do wrong. The scenario is as followed, I'm using swfupload to upload files with a progressbar via a webservice. the webservice needs to return the name of the generated thumbnail. This all goes well and though i prefer to get the returned data in json (might change it later in the swfupload js files) the default xml data is fine too.

So when an upload completes the webservice returns the following xml as expected (note I removed the namespace in webservice):

<?xml version="1.0" encoding="utf-8"?>
<string>myfile.jpg</string>

Now I want to parse this result with jquery and thought the following would do it:

var xml = response;
alert($(xml).find("string").text());

But I cannot get the string value. I've tried lots of combinations (.html(), .innerhtml(), response.find("string").text() but nothing seems to work. This is my first time trying to parse xml via jquery so maybe I'm doing something fundemantally wrong. The 'response' is populated with the xml.

View 2 Replies

Looking For A Good/Simple Webservice Which Can Be Consumed Using .net?

Sep 23, 2010

I was looking for Good/Simple webservice which can be consumed using asp.net but i can't a find a free webservice that can be used with asp.net..

View 1 Replies

ASP Webservice Calling WCF Service?

Oct 27, 2010

I have almost the same problem as you have described in [URL] service. I have a asp.net webservice that calls a WCF service. On my development machine this is working fine. But if i deploy my ASP.net Webservice it is not working. Both the ASP Webservice en WCF service needs my cridentials. How did you solved your problem. In the logging of the WCF service I see that my credentials is not passing to WCF.

View 1 Replies

JQuery Not Calling Webservice

Feb 6, 2011

I am new to programming especially jQuery and webservices. I want to pass the values to the to database via the webservice. Below is the code for the .aspx page:

<html xmlns="[URL]xhtml">
<head id="Head1" runat="server">
<title></title>
<link href="[URL]"
rel="stylesheet" type="text/css" />
<script src="[URL]" type="text/javascript"></script>
<script src="[URL]"
type="text/javascript"></script>
<script src="[URL]"
type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#sortable").sortable();
$("#sortable").disableSelection();
$("#sortable input[type=text]").width($("#sortable img").width() - 10);
$("#sortable label").mouseover(function () {
$(this).parent().children("input[type=text]").show().val($(this).html());
$(this).hide();
});
$("#sortable input[type=text]").mouseout(function () {
$(this).parent().children("label").show().html($(this).val());
$(this).hide();
});
$(".ContainerDiv").hover(
function () {
$(this).find(".deleteClass").show();
},
function () {
$(this).find(".deleteClass").hide();
});
$(".deleteClass").click(function () {
$(this).closest("li").remove();
});
$("#orderPhoto").click(function () {
var photos = $.map($("li.ui-state-default"), function (item, index) {
var imgDetail = new Object();
imgDetail.Id = $(item).find("img").attr("id");
imgDetail.Caption = $(item).find("label").html();
imgDetail.Order = index + 1;
return imgDetail;
});
//photos contains all the photo and order and the chhanged caption.
//pass to server
$.ajax({
type: "POST",
url: "WebService.asmx/updateOrder",
data: JSON.stringify(photos),
contentType: "application/json; charset=utf-8",
success: function (data) {
if (data.d === "saved") {
$("<p>").text("New order saved!")
.addClass("success").appendTo("#left");
} else {
$("<p>").text("Save failed")
.addClass("failure").appendTo("#left");
}
}
});
});
});
</script>
<style type="text/css">
#sortable
{
list-style-type: none;
margin: 0;
padding: 0;
}
#sortable li
{
position: relative;
margin: 3px 3px 3px 0;
padding: 1px;
float: left;
text-align: left;
}
.deleteClass
{
/* PhotoListItem is relative so relative to it */
position: absolute;
top: 1px;
right: 3px;
background: black;
color: Red;
font-weight: bold;
font-size: 12px;
padding: 5px;
opacity: 0.60;
filter: alpha(opacity="60");
margin-top: 3px;
display: none;
cursor: pointer;
}
.deleteClass:hover
{
opacity: 0.90;
filter: alpha(opacity="90");
}
.image_resize {
width: 250px;
height: 250px;
border: 0;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ListView ID="ListView1" runat="server" GroupItemCount="15">
<LayoutTemplate>
<ul id="sortable">
<li id="groupPlaceholder" runat="server">1</li>
</ul>
</LayoutTemplate>
<GroupTemplate>
<tr id="itemPlaceholderContainer" runat="server">
<td id="itemPlaceholder" runat="server">
</td>
</tr>
</GroupTemplate>
<ItemTemplate>
<li class="ui-state-default">
<div class="ContainerDiv">
<div class="deleteClass">X</div>
<img id='<%#Eval("photo_id")%>' src='<%# "uploads/"+Eval("photo_file_name")%>' alt="" class="image_resize" />
<div style="height: 25px; margin-top: 3px">
<label>
<%# Eval("photo_title")%></label>
<input type="text" style="display: none" />
</div>
</div>
</li>
</ItemTemplate>
</asp:ListView>
<input type="button" id="orderPhoto" value="Save change" />
</form>
</body>
</html>

I used the debugging tool and can confirm that the photos contains the correct values. Its just calling the webservice part that I am unsure about.

View 1 Replies

C# - Calling WebService From Same Project?

Apr 19, 2010

I'm trying to call an asp.net webservice from the same project it's in:

[MethodImpl(MethodImplOptions.Synchronized)]
public static void OnFileCreated(object source, FileSystemEventArgs e) {
trackdata_analyse rWebAnalyse = new trackdata_analyse();
rWebAnalyse.Analyse(@"pending" + e.Name, "YOUNIVATE");
}

However i always get the following "HttpContext is not available. This class can only be used in the context of an ASP.NET request." when calling Server.MapPath from the webservice:

[WebMethod]
public int Analyse(string fileName, string PARSING_MODULE){
int nRecords;
TrackSession rTrackSession = new TrackSession() ;
string filePath = Server.MapPath(@"..data") + fileName;

Do i have to add the WebReference instead, though the webservice is in the same project?

View 3 Replies

Calling A Webservice To Send Email

May 13, 2010

I need to call this webservice from a ssis package.In the ssis package i should be mentioning the wsdl path of the webservice. How can wsdl path of a webservice be obtained?

View 4 Replies

WCF / ASMX :: Calling Java Webservice From C#

Dec 9, 2010

I need to call a Java webservice from my ASP.Net application. The webservice uses Java Key Store (JKS) certificate. Could some one help me with how I could do this? As a side note, when I try to add Web Reference or Service Reference to my Visual Studio project by providing the WSDL, Visual Studio always crashes.

View 1 Replies

WPAD Queries Calling Webservice From ASP

Oct 2, 2010

We have an ASP.NET website which calls a webservice. If impersonation is not on for the ASP.NET website the call to the webservice is slow - using WireShark we see that it is making WPAD queries. If impersonation is on and it's impersonating an admin user the call to the webservice is fast - using WireShark we that it is NOT making WPAD queries. Has anyone seen this before? How do we prevent the networkService, which by default is what the ASP.NET website uses, does not make WPAD queries. Why does impersonating as an admin user not cause WPAD queries?

This is the entry we see in WireShark:

NBNS Name Query NB WPAD<00>

View 1 Replies

AJAX :: AutoExtender Not Calling Webservice?

Jun 21, 2010

Here is aspx code. that refers Master Page.

<
asp:TextBox
ID="txtClientSearch"
CssClass="txtfld01"
Width="75%"
runat="server"></asp:TextBox

[Code]....

Now i dont understand why my Autoextender is not call the webservice. I have tried callin the webservice from button click event...it works but not using AutoExtender..

View 2 Replies

MVC :: Calling An Asmx Webservice From ActionResult?

Feb 11, 2011

I have an old legacy webservice that I need to call from a controller ActionResult and I have no idea how to do it.

View 5 Replies

VS 2005 - Timeout Calling Webservice

Feb 15, 2012

I have an intranet application that is calling a webservice (code below). The webservice calls a stored procedure in q sql server 2005 that again does an openquery on a db2 (AS400) machine. The stored procedure is returning a temp table. On the call to the webservice I am getting a time out. At this point if time out the web service is still running and I can also see the query is in the program stack on the db2 machine. The query itself can take up to 20-30 minutes as it is reading 3 mill+ records. If I call the web service directly I get the result returned.

Code:
Dim getOrderDetail As New localhost.OrderDetail
myDataTable = getOrderDetail.GetOrderDetailRecords_DataTable(myUserId)

View 5 Replies

Calling WebMethods / WebService Using Jquery Is Blocking?

Apr 6, 2010

I'm generating a file on the server which takes some time. For this, I have a hidden iframe which I then set the .src attribute to an aspx file i.e iframe.src = "/downloadFile.aspx"While this is taking place, I'd like to have a call to a web service return the progress. To do this, I thought I could use window.setInterval or window.setTimeout but Javascript seems to be blocked as soon as I set the iframe src attribute.Does anyone know how to get around this or perhaps try a different approach?I have also tried handlers, but the request never gets to the server so I'm assuming is a browser/javascript issue.

//Function that gets the file
function GetFile() {
setTimeout(GetProgress, 1000);
var iframe = document.createElement("iframe");

[code]...

View 2 Replies

WCF / ASMX :: Calling Webservice From Javascript Side?

Nov 17, 2010

This is the webservice am using.

[code]....

But my function is not going to Hello() soon after calling SetOCXVariables()

After my 'P' comes undefined and does the remaining, it goes to hello()

why is this happening?

View 7 Replies

AJAX :: JQuery / Javascript Calling Webservice

Oct 5, 2010

I've tried a bunch of different examples and still can't get this to work. I have a jQuery GalleryView control I'm using and I simply want to log impressions. I set up a webservice that works, but I can't figure out how to get it to work in javascript. I have verified that the webservice is working as expected.

Imports System.Web

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved