Search Results

Search found 752 results on 31 pages for 'restful'.

Page 7/31 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Creating a WCF Restful service, concurrency issues

    - by pmillio
    Hi i am in the process of creating a restful service with WCF, the service is likely to be consumed by at least 500 people at any given time. What settings would i need to set in order to deal with this. Please give me any points and tips, thanks. Here is a sample of what i have so far; [ServiceBehavior(IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)] And this is an example of a method being called; public UsersAPI getUserInfo(string UserID) { UsersAPI users = new UsersAPI(int.Parse(UserID)); return users; } [OperationContract] [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json, UriTemplate = "User/{UserID}")] [WebHelp(Comment = "This returns a users info.")] UsersAPI getUserInfo(string UserID);

    Read the article

  • Update database using restful ASP.NET MVC 1.0

    - by Mike
    We are building an MVC 1.0 application right now and using Linq - SQL for our DAL. Following the restful approach we have multiple action events depending on if you are updating or loading or what not. The two that I'm concerned with at this point are the edit and update action methods. Here is the signatures. public ActionResult Update(int customerId, int Id, AggregateModel viewModel) public ActionResult Edit(int customerId, int Id, AggregateModel viewModel) So the idea is that in the Edit method we load up our viewModel and pass it to the view. The user makes changes to the model and then posts back to the Update method. The first thing I could think of to do would be to get the viewModel from the database again, copy the changes in one by one from the posted back model and then submit it back. This would work but does seem clunky to me. What is the best way to insert those changes into the database at this point?

    Read the article

  • Authorization in Rails

    - by sev
    Who can show me how I must use declarative_authorization (http://github.com/stffn/declarative_authorization) with restfult_authentication (http://github.com/technoweenie/restful-authentication)?

    Read the article

  • How to model file system operations with REST?

    - by massive
    There are obvious counterparts for some of file systems' basic operations (eg. ls and rm), but how would you implement not straightforwardly RESTful actions such as cp or mv? As answers to the question REST services - exposing non-data “actions” suggest, the preferred way of implementing cp would include GETting the resource, DELETing it and PUTting it back again with a new name. But what if I would need to do it efficiently? For instance, if the resource's size would be huge? How would I eliminate the superfluous transmission of resource's payload to client and back to the originating server? Here is an illustration. I have a resource: /videos/my_videos/2-gigabyte-video.avi and I want copy it into a new resource: /videos/johns_videos/copied-2-gigabyte-video.avi How would I implement the copy, move or other file system actions the RESTful way? Or is there even a proper way? Am I doing it all wrong?

    Read the article

  • RESTful WCF Data Service Authentication

    - by Adrian Grigore
    Hi, I'd like to implement a REST api to an existing ASP.NET MVC website. I've managed to set up WCF Data services so that I can browse my data, but now the question is how to handle authentication. Right now the data service is secured via the site's built in forms authentication, and that's ok when accessing the service from AJAX forms. However, It's not ideal for a RESTful api. What I would like as an alternative to forms authentication is for the users to simply embed the user name and password into the url to the web service or as request parameters. For example, if my web service is usually accessible as http://localhost:1234/api.svc I'd like to be able to access it using the url http://localhost:1234/api.svc/{login}/{password} So, my questions are as follows: Is this a sane approach? If yes, how can I implement this? It seems trivial redirecting GET requests so that the login and password are attached as GET parameters. I also know how to inspect the http context and use those parameters to filter the results. But I am not sure if / how the same approach could be applied to POST, PUT and DELETE requests. Thanks, Adrian

    Read the article

  • Posting XML form data to a RESTful Server with Javascript or PHP

    - by pjs-worker
    Hi folks, I've been given the task of posting to a RESTful server. I'm new to the official "REST" but I've played with the concept before. However, this time I have an XML Payload example file that I am supposed to post. I'm struggling to figure out how the two relate. Can you help? Right now I can post to a specific site, say www.pcpost.com/schema/Application I can generate the URL for the inital, ie: postApplication?userid=4&... Being relatively new to web programming, I find that don't know how to take the following and interface it with the server. I'm at least familiar with Javascript and PHP. If this is impossible with those two types, I can learn whatever would be best. Thanks for your help on this. C <?xml version=\"1.0\" ?> <Application xmlns="http://www.pcpost.com/schema/Application" SchemaVersion="1.0" ProgramId="8" ApplicationDate="2009-08-29"> <Vendors> <Vendor Role="Applicant" Company="Test Company" Contact="Smith, John"/> <Vendor Role="Seller" Company="Test Company" Contact="Doe, Jane"/> <Vendor Role="Installer" Company="Test Company" Contact="Funk, Carl"/> </Vendors> <Participants> <Participant TaxStatus="Individual" Sector="Commercial"> <Roles> <Role>Host Customer</Role> </Roles> </Participants> </Application>

    Read the article

  • How OpenStack Swift handles concurrent restful API request?

    - by Chen Xie
    I installed a swift service and was trying to know the capability of handling concurrent request. So I created massive amount of threads in Java, and sent it via the RestFUL API Not surprisingly, when the number of requests climb up, the program started to throw out exceptions. Caused by: java.net.ConnectException: Connection timed out: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:378) at sun.net.www.http.HttpClient.openServer(HttpClient.java:473) at sun.net.www.http.HttpClient.(HttpClient.java:203) But can anyone tell me how that time outhappened? I am curious of how SWIFT handles those requests. Is that by queuing the requests and because there are too many requests in the queue and wait for too long time and it's just get kicked out from the queue? If this holds, does it mean that it's an asynchronized mechanism to handle requests? Thanks.

    Read the article

  • Looking for a RESTful or SOAP pipeline between WordPress and InterWoven TeamSite

    - by deanpeters
    I've been Googling my brains out trying see if there's a simple way to bridge content to and from WordPress to and from TeamSite. I'm coming at this from the perspective of a WordPress developer. I see in the book "The Definitive Guide to Interwoven TeamSite" (http://bit.ly/d3z4wI) mention of objects for the Interwoven LiveSite product: com.interwoven.livesite.external.impl.RSS com.interwoven.livesite.external.impl.SOAP If I understand the above objects correctly, these allow me to instantiate objects of these data types, which after populating them via various method calls, allow me to render content using com.interwoven.livesite.external.ExternalCall ... but I'm not sure. Nor do I think this approach provides me the 2-way street I seek. As it stands now, from my limited understanding, it appears that the least path of resistance is deploying Interwoven's LiveSite with the existing TeamSite implementation so content can be both consumed and rendered via RSS ... an channel which WordPress can produce and consume; the latter with plugins such as wp-o-matic and/or feedpress. So the question is, does anyone out there have experience with a SOAP or RESTful API approach to InterWoven's TeamSite? If so, can I get some direction on documentation? Or is the addition of LiveSite + RSS the most feasible 2-way channel?

    Read the article

  • Resource mapping in a Ruby on Rails URL (RESTful API)

    - by randombits
    I'm having a bit of difficulty coming up with the right answer to this, so I will solicit my problem here. I'm working on a RESTFul API. Naturally, I have multiple resources, some of which consist of parent to child relationships, some of which are stand alone resources. Where I'm having a bit of difficulty is figuring out how to make things easier for the folks who will be building clients against my API. The situation is this. Hypothetically I have a 'Street' resource. Each street has multiple homes. So Street :has_many to Homes and Homes :belongs_to Street. If a user wants to request an HTTP GET on a specific home resource, the following should work: http://mymap/streets/5/homes/10 That allows a user to get information for a home with the id 10. Straight forward. My question is, am I breaking the rules of the book by giving the user access to: http://mymap/homes/10 Technically that home resource exists on its own without the street. It makes sense that it exists as its own entity without an encapsulating street, even though business logic says otherwise. What's the best way to handle this?

    Read the article

  • Rails: RESTful Find, Initialize, or Create

    - by Andrew
    I have an app that has Cities in it. I'm looking for some suggestions on how to RESTfully structure a controller so that I can lookup, initialize, and create city records via AJAX requests. For instance: Given a text field city_name A user enters the name of a City, like "Paris, France" The app checks this location to see if there is such a city in the database already If there is, it returns the city object If there is not, it returns a new record initialized with the name "Paris" and the country "France", and prompts the user to confirm they want to add this city to the database If the user says "Yes" the record is saved. If not the record is discarded and the form is cleared. Now, my first approach was to change the Create action to use find_or_create, so that an AJAX post to cities_path would result in either returning the existing city or creating it and returning it. That works ok... However, it would be better to setup controller actions that would take a string input, find , or else initialize and return, then only create if the user confirms the generated record is correct. The ideal scenario would put this all in one action so AJAX request can go to that url, the server responds with JSON objects, and javascript can handle things from there. I'd like to keep all the user-interaction logic client side, and also minimize the number of requests it takes to achieve this. Any suggestions on the cleanest, most RESTful way to accomplish this?

    Read the article

  • Rails RESTful routs without #new, rspec trouble

    - by pdkl95
    I'm currently writing a Rails app, and hit a somewhat strange quirk. I have a controller PermissionsController, which is mainly for display purposes at the moment. So my routing is locked down: map.resources :permissions, :only => [:index, :show] Unfortunately, when writing the tests, one of the routing tests fails: it "does not recognize #new" do { :get => "/permissions/new" }.should_not be_routable end with the error: Expected 'GET /permissions/new' to fail, but it routed to {"action"=>"show", "id"=>"new", "controller"=>"permissions"} instead Obviously, the #show action's route is matching with /permissions/:id, which also gives the expected error Couldn't find Permission with ID=new if you actually browse to that URL. This is not a serious error, as it is correctly raising an exception with the bad :id parameter, but it's kind of ugly. Is there any way to actually make Rails reject that route? Some trick in the routing options that I'm missing? I suppose I should just leave that test out and ignore it, or maybe remove the whole RESTful idea altogether and go back to a simpler map.connect 'permissions/:id' style. I strongly suspect I'll be expanding this in the future, though, and kind of wanted to keep my controllers consistent with each other. Just having to add occasional :only or :except rules made routes.rb nice and clean...

    Read the article

  • RESTful API: How to model JSON representation?

    - by Jan P.
    I am designing a RESTful API for a booking application. You can request a list of accommodations. And that's where I don't really know how to design the JSON represenation. This is my XML representation: <?xml version="1.0" encoding="utf-8"?> <accommodations> <accommodation> <name>...</name> <category>couch</category> </accommodation> <accommodation> <name>...</name> <category>room</category> </accommodation> <accommodations> My first try to convert this to JSON resulted in this output (1): { "0": { "name": "...", "category": "couch" }, "1": { "name": "...", "category": "room" } } But as I looked how others APIs did it, I found something looking more like this (2): [ { "name": "...", "category": "couch" }, { "name": "...", "category": "room" } ] I know version 1 is an object, and version 2 an array. But which one is better in this case?

    Read the article

  • rails restful select_tag with :on_change

    - by Sam
    So I'm finally starting to use rest in rails. I want to have a select_tag with product categories and when one of the categories is selected I want it to update the products on change. I did this before with <% form_for :category, :url => { :action => "show" } do |f| %> <%= select_tag :id, options_from_collection_for_select(Category.find(:all), :id, :name), { :onchange => "this.form.submit();"} %> <% end %> however now it doesn't work because it tries to do the show action. I have two controllers 1) products 2) product_categories products belongs_to product_categories with a has_many How should I do this. Since the products are listed on the products controller and index action should I use the products controller or should I use the product_categories controller to find the category such as in the show action and then render the product/index page. But the real problem I have is how to get this form or any other option to work with restful routes.

    Read the article

  • WCF configuration for WebHttpBinding(Restful) for supporting both HTTP and HTTPS

    - by KSS
    We are using AJAX Cascading dropdown and AutoComplete functionality with Restful WebService Services providing data. With one endpoint(non-secured) eveything was working fine, until we tried same web page with https. Our Webappplication needs to support both. Our of very few articiles/blogs on this issue I found 2 which applies to my requirements. 1. http://blog.abstractlabs.net/2009/02/ajax-wcf-services-and-httphttps.html 2. _http://www.mydotnetworld.com/post/2008/10/18/Use-a-WCF-Service-with-HTTP-and-HTTPS-in-C.aspx I followed same pattern, added 2 endpoints, assuming WCF will pickup appropriate endpoint looking at HTTP or HTTPS protocol. Worked like a charm in my dev machine(XP-IIS5) and 1 Server 2003R2(IIS6), however did work in Production server 2003-IIS6. Website in IIS is exact same(including permission etc). The error it throws - Error 500(Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http]..) Here's the sample configuration(ignore typos) <system.serviceModel> <bindings> <webHttpBinding> <binding name="SecureBinding"> <security mode="Transport"/> </binding> </webHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="SearchServiceAspNetAjaxBehavior"> <enableWebScript /> </behavior> </endpointBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> <services> <service name="SearchService"> <endpoint address="" behaviorConfiguration="SearchServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="SearchServiceContract" /> <endpoint address="" behaviorConfiguration="SearchServiceAspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="SecureBinding" contract="SearchServiceContract" /> </service> </services> </system.serviceModel> Any help on this is highly appreciated ? Thanks KSS

    Read the article

  • Understanding REST: is GET fundamentally incompatible with any "number of views" counter?

    - by cocotwo
    I'm trying to understand REST. Under REST a GET must not trigger something transactional on the server (this is a definition everybody agrees upon, it is fundamental to REST). So imagine you've got a website like stackoverflow.com (I say like so if I got the underlying details of SO wrong it doesn't change anything to my question), where everytime someone reads a question, using a GET, there's also some display showing "This question has been read 256 times". Now someone else reads that question. The counter now is at 257. The GET is transactional because the number of views got incremented and is now incremented again. The "number of views" is incremented in the DB, there's no arguing about that (for example on SO the number of time any question has been viewed is always displayed). So, is a REST GET fundamentally incompatible with any kind of "number of views" like functionality in a website? So should it want to be "RESTFUL", should the SO main page either stop display plain HTML links that are accessed using GETs or stop displaying the "this question has been viewed x times"? Because incrementing a counter in a DB is transactional and hence "unrestful"? EDIT just so that people Googling this can get some pointers: From http://www.xfront.com/REST-Web-Services.html : 4. All resources accessible via HTTP GET should be side-effect free. That is, the request should just return a representation of the resource. Invoking the resource should not result in modifying the resource. Now to me if the representation contains the "number of views", it is part of the resource [and in SO the "number of views" a question has is a very important information] and accessing it definitely modifies the resource. This is in sharp contrast with, say, a true RESTFUL HTTP GET like the one you can make on an Amazon S3 resource, where your GET is guaranteed not to modify the resource you get back. But then I'm still very confused.

    Read the article

  • Is there a standard for machine-readable descriptions of RESTful services?

    - by ecmendenhall
    I've interacted with a few RESTful APIs that provided excellent documentation for humans and descriptive URIs, but none of them seem to return machine-readable descriptions of themselves. It's not too tough to write methods of my own that assemble the right paths, and many language-specific API libraries are already just wrappers around RESTful requests. But the next level of abstraction seems really useful: a library that could read in an API's own machine readable documentation and generate the wrappers automatically, perhaps with a call to some standard URI like base_url + '/documentation' Are there any standards for machine-readable API documentation? Am I doing REST wrong? I am a relatively new programmer, but this seems like a good idea.

    Read the article

  • REST, HTTP DELETE and parameters

    - by Chris McCauley
    Is there anything non-RESTful about providing parameters to a HTTP DELETE request? My scenario is that I'm modeling the "Are you sure you want to delete that?" scenario and eventually I end up having to pass a parameter to the delete request with "?force_delete=true" e.g. DELETE http://server/resource/id?force_delete=true If the user does not specify force_delete then I'm returning 409 Conflict - is that correct?

    Read the article

  • Endpoints or URIs for a WCF client test-drive

    - by Xencor
    I am aware of the Amazon.com exposed URIs ... which I need to sign up for and then on I can use them ... roll-up my sleeves and get some WCF Client test-drive coding. What are the other such publicly exposed end points that reflect real or almost real-time services? Any offerings specifically from Microsoft? I am basically looking for writing WCF clients for both WCF and non-WCF services...RESTful ones and even otherwise.

    Read the article

  • Rails new vs create

    - by Senthil
    Why is there a need to define a new method in RESTful controller, follow it up with a create method? Google search didn't provide me the answer I was looking for. I understand the different, but need to know why they are used the way they are.

    Read the article

  • REST, HTTP verbs and current development in .NET and silverlight

    - by vtortola
    Hi, I've read several posts in the internet about that Silverlight only supports GET and POST, and that the most of the web browsers too. Is this true? has it changed lately? I'm developing a RESTful web service for a Silverlight application, still in early stage, and I'd like to know if I should use just POST and GET, or otherwise I could use PUT and delete. Cheers

    Read the article

  • WCF Restful services getting error 400 (bad request) when post xml data

    - by Wayne Lo
    I am trying to self host a WCF services and calling the services via javascript. It works when I pass the request data via Json but not xml (400 bad request). Please help. Contract: public interface iSelfHostServices { [OperationContract] [WebInvoke(Method = "POST", UriTemplate = INFOMATO.RestTemplate.hello_post2,RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Wrapped)] Stream hello_post2(string helloString); } Server side code: public Stream hello_post2(string helloString) { if (helloString == null) { WebOperationContext.Current.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.BadRequest; return null; } WebOperationContext.Current.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK; return new MemoryStream(Encoding.UTF8.GetBytes(helloString)); } JavaScript: function testSelfHost_WCFService_post_Parameter() { var xmlString = "<helloString>'hello via Post'</helloString>"; Ajax_sendData("hello/post2", xmlString); } function Ajax_sendData(url, data) { var request = false; request = getHTTPObject(); if (request) { request.onreadystatechange = function() { parseResponse(request); }; request.open("post", url, true); request.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); charset=utf-8"); request.send(data); return true; } } function getHTTPObject() { var xhr = false; if (window.XMLHttpRequest) { xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) {...} }

    Read the article

  • Telephony RESTful API

    - by Sergei
    I'm looking for a simple telephony API for use with Rails application. The application must be able to make a notification call through the API and receive confirmation code from the dialpad.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >