Search Results

Search found 44086 results on 1764 pages for 'web filtering'.

Page 14/1764 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • How Would a Newborn Baby Learn Web Programming?

    - by Mugatu
    Hello all, I chose that title because I equate my knowledge of web programming and web development with that of a newborn. Here's the shortest version of my story and what I'm looking to do: A friend and I have been coming up with website ideas for a couple years, mostly just jotting them down whenever we come up with a good, useful idea when browsing the web. For the past 6 months we've hired a couple different programmers to make a couple of the sites for us, but have been disappointed with how it's gone. Been too slow and too many miscommunications for our liking. So like the saying goes if you want something done right do it yourself, we're going to do it ourselves. I know nothing about programming, I've never written a line of code in my life. I consider myself very good with math and about as logical as you can get, but I have zero real-life programming knowledge. The sites we want to make are all pretty 'Web 2.0'ish', meaning user-generated content, commenting on posts, pages that change on the fly, etc. So here are some of my questions for anyone who's been there before: Is there a language you'd recommend learning first? Something that is a good indicator how most other languages work? What web programming languages do you recommend learning first based on popularity both now and the future. I don't want to learn a language that's going to be outdated by the time I'm an expert at it. Any specific books you'd recommend? Any general advice you'd give to someone literally starting at square zero for coding who plans on being in it for the long haul? Thanks in advance for the help

    Read the article

  • Matching my skills with Java and Web Programming

    - by John R
    here is my main question: What is the most common way that Java is used in web development? The reason I ask: I am currently in the process of finding my first internship. Every employer has a separate set of languages, technologies and acronyms they want their candidates to know. In school I did well with Java. As a hobby and interest I have developed a handful of web pages widgets, scripts, etc. My university emphasized Java, C and theory. My hobbies emphasize HTML, PHP, JavaScript, CSS, and a little jQuery, etc. I can't learn a dozen different technologies to satisfy most prospective employers (in what is left of the summer). I think my best bet is combine my skills with Java and my interests in web development. That brings me back to my original question: What is the most common way that Java is used in web development?

    Read the article

  • Vidéo sur le développement Web avec Dart, le langage orienté Web de Google, par Yohan Beschi

    Yohan Beschi de la société SOAT (http://blog.soat.fr/) vous propose une vidéo sur une introduction au développement Web avec Dart, le langage orienté Web de Google.Au cours de cette vidéo vous verrez :comment Dart permet de développer des applications clientes aussi bien que serveurs ; quelques éléments du langage ; mais aussi les outils permettant un développement industrialisé et une productivité accrue. Le lien de la vidéo : http://soat.developpez.com/videos/da...web-avec-dart/N'hésitez...

    Read the article

  • Develop web site from existing software or cherry pick and use a web framework?

    - by erisco
    A small team and I are tasked with developing a web site. The client has referenced a particular open source project (we'll call it X) when describing some of the features. Because of this, the team wants to start with X and adapt it to satisfy the client. I have looked at X and its code and, in my opinion, it would be unwise. However, my experience is limited, and could really benefit from the insights of others so that I can figure out what I should be asserting as the right direction for the team. My red flags are going up and this is why. X was developed in the earlier days of PHP; 500 line blocks of code are the norm; global variables are abundant; giant switch cases are the norm for switching between which page is shown. There is no clear mapping between URL and where the code for that page sits. From a feature-set standpoint, X is actually software specialized for a different task and has dozens of features we don't need or have use for that come as core assumptions. We will be unable to adapt X through its plugin system. That said, there are a few features which can be mapped, with some modification, to suit our purposes. I believe this is the attraction the team feels. I would feel comfortable if, instead of using X directly, we lifted what is salvageable and useful to us. We can then use that code, and the same 3rd party libraries X is using, in a new code base built on top of a PHP web framework (particularly Agavi, so you understand what I mean by 'web framework'). The web framework gives us a strong MVC structure and provides the common facilities for web development, or adapters to work with 3rd party libraries that do so. We will also have a clean slate feature-wise to work from, which means we can work additively instead of subtractively. Because the code base is better structured, and contains none of what we don't need, it will be easier to document, which is a critical requirement of our client. So to summarize, the team wants to use X, whereas I want to take the bits we can from X and use a web framework instead. I want to bounce this opinion off of other's experiences so that I can be more informed. Thanks for your insight.

    Read the article

  • Filtering forms in MS Access

    - by terence6
    I have a simple form showing products from my database. Each product has a foreign key to manufacturer_id . I would like to filter my form by manufacturer_id instead of default product_id. How I can do that ? I know I must create a macro. Also I've already created a query, that takes manufacturer's name as argument and returns manufacturer_id. So basically it should work in this way, that when I press 'Filter' button on my form, it runs macro that opens my query asking for manufacturer's name. And when the name is returned the whole form is filtered (so somewhere there should be comparison between manufacturer_id in product and that returned from query, but I can't manage to do that). I'm using access 2007. Model:

    Read the article

  • Google I/O 2012 - Putting the App Back into Web App - Web Programming with Dart

    Google I/O 2012 - Putting the App Back into Web App - Web Programming with Dart Dan Grove, Vijay Menon Do you want to build blazingly fast applications with beautiful graphics and offline support? Would you like to run those apps anywhere on the open web? Would you like to develop those apps in a language that supports modular large-scale development while keeping the lightweight feel of a scripting language? This session will show you how to use the Dart programming language to develop the next generation of amazing applications for the open web. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 187 4 ratings Time: 57:16 More in Science & Technology

    Read the article

  • Fiddler - A useful free tool for checking Web Services (and web site) traffic

    - by TATWORTH
    Recently I had reason to be very glad that I had Fiddler. I was able to record some web service traffic and identify a problem as Fiddler can record both the call to a web service and response from the web service. By seeing the actual data traffic I was able to resolve a problem found in testing in less time than it has taken me to write this blog entry! This tool is also useful for studying general web site traffic. Fiddler is available from http://www.fiddler2.com/fiddler2/ There are training videos available on the above site.

    Read the article

  • Filtering a dataframe in row names from a column value in R

    - by user1755155
    Basically I have dataframe with two columns (target_id and fpkm). I want to keep only those row names in first column that are not duplicated. For example in the below dataframe you can see there are two row names with the same name (almost) comp267138_c0_seq1 comp267138_c0_seq2 and from both and I want to keep only one comp267138_c0_seq2 based of high value in column 2. target_id fpkm comp247393_c0_seq1 3.197885 comp257058_c0_seq4 1.624577 comp242590_c0_seq1 1.750319 comp77911_c0_seq1 1.293059 comp241426_c0_seq1 1.626589 comp288413_c0_seq1 14.828853 comp294436_c0_seq1 11.555596 comp63603_c0_seq1 1.982386 comp267138_c0_seq1 8.594494 comp267138_c0_seq2 11.134958 comp321623_c0_seq1 6.934149

    Read the article

  • Compute jvm heap size to host web application

    - by Enrique
    Hello, I want to host a web application on a private JVM they offer 32, 64, 128, 256 MB plans. My web application uses Spring. And I store some objects for every logged in user session. My question is: How can I profile my web app to see how much heap size it needs so I can choose a plan?, How can I simulate hundreds of users logged in at the same time? I'm developing the application using Netbeans 6.7 Java 1.6 Tomcat 6.0.18 Thank you.

    Read the article

  • Programmatically filtering contacts in Outlook 2010 Add-In

    - by Leon Havin
    I am trying to programmatically filter Outlook contacts in the Contacts folder in Outlook 2010. I followed DASL filter rules, but it seems working for Find function and throws exception when I assign this filter to view.Filter = FilterString. Any ideas what I am doing wrong? The correct result would display filtered contacts in the existing contacts view. Outlook.Application myApp = ThisAddIn.myApp; Outlook.NameSpace myNamespace = ThisAddIn.nSpace; Outlook.MAPIFolder myContactsFolder = ThisAddIn.contactsFolder; if (myContactsFolder == null) { Log.Verbose("Contacts folder not found"); return null; } Outlook.Items contactItems = ThisAddIn.contactItems; //use filter to take only contact and not DistListItem Outlook.Items outlookContacts = contactItems.Restrict("[MessageClass] = 'IPM.Contact'"); Outlook.ContactItem contact = null; int iOutlookContacts = contactItems.Count; if (iOutlookContacts > 0) { string FilterString = "[FullName]='" + param + "'"; // Find works with this filter contact = (Outlook.ContactItem)outlookContacts.Find(FilterString); if (contact != null) { // need to display in contacts search window Outlook.View currentView = myApp.ActiveExplorer().CurrentView; currentView.Filter = FilterString; // cannot parse exception occurs here currentView.Save(); currentView.Apply(); } }

    Read the article

  • .NET Web Serivce hydrate custom class

    - by row1
    I am consuming an external C# Web Service method which returns a simple calculation result object like this: [Serializable] public class CalculationResult { public string Name { get; set; } public string Unit { get; set; } public decimal? Value { get; set; } } When I add a Web Reference to this service in my ASP .NET project Visual Studio is kind enough to generate a matching class so I can easily consume and work with it. I am using Castle Windsor and I may want to plug in other method of getting a calculation result object, so I want a common class CalculationResult (or ICalculationResult) in my solution which all my objects can work with, this will always match the object returned from the external Web Service 1:1. Is there anyway I can tell my Web Service client to hydrate a particular class instead of its generated one? I would rather not do it manually: foreach(var fromService in calcuationResultsFromService) { ICalculationResult calculationResult = new CalculationResult() { Name = fromService.Name }; yield return calculationResult; } Edit: I am happy to use a Service Reference type instead of the older Web Reference.

    Read the article

  • Customized generation/filtering resources with maven

    - by zamza
    I wonder what is the Maven way in my situation. My application has a bunch of configuration files, let's call them profiles. Each profile configuration file is a *.properties file, that contains keys/values and some comments on these keys/values semantics. The idea is to generate these *.properties to have unified comments in all of them. My plan is to create a template.properties file that contains something like #Comments for key1/value1 key1=${key1.value} #Comments for key2/value2 key2=${key2.value} and a bunch of files like #profile_data_1.properties key1.value=profile_1_key_1_value key2.value=profile_1_key_2_value #profile_data_2.properties key1.value=profile_2_key_1_value key2.value=profile_2_key_2_value Then bind to generate-resources phase to create a copy of template.properties per profile_data_*, and filter that copy with profile_data_*.properties as a filter. The easiest way is probably to create an ant build file and use antrun plugin. But that is not a Maven way, is it? Other option is to create a Maven plugin for that tiny task. Somehow, I don't like that idea (plugin deployment is not what I want very much).

    Read the article

  • Alternative Web model

    - by Above The Gods
    One of the problems web apps have against native apps, especially on the mobile front, is the constant need to re-download each web page on request. Ultimately, this leads to slower performance. Why if web apps only download new pages if they're actually needed, not because they're simply requested. For example: perhaps the server can store a web page version in a cookie. Every slight change to the page on the server-side changes the version number. Now instead of the browser requesting a new page each time, why not just check the version number and have the server send the page if they're different? If the page similar, the user can just use a cached page. I'm sure browsers doesn't necessarily have to change to accommodate changes to this, correct?

    Read the article

  • matlab: simple matrix filtering - group size

    - by Art
    I have a huuuge matrix storing information about X and Y coordinates of multiple particle trajectories , which in simplified version looks like that: col 1- track number; col 2- frame number; col 2- coordinate X; col 3- coordinate Y for example: A = 1 1 5.14832 3.36128 1 2 5.02768 3.60944 1 3 4.85856 3.81616 1 4 5.17424 4.08384 2 1 2.02928 18.47536 2 2 2.064 18.5464 3 1 8.19648 5.31056 3 2 8.04848 5.33568 3 3 7.82016 5.29088 3 4 7.80464 5.31632 3 5 7.68256 5.4624 3 6 7.62592 5.572 Now I want to filter out trajectories shorter than lets say 2 and keep remaining stuff like (note renumbering of trajectories): B = 1 1 5.14832 3.36128 1 2 5.02768 3.60944 1 3 4.85856 3.81616 1 4 5.17424 4.08384 2 1 8.19648 5.31056 2 2 8.04848 5.33568 2 3 7.82016 5.29088 2 4 7.80464 5.31632 2 5 7.68256 5.4624 2 6 7.62592 5.572 How to do it efficiently? I can think about some ideas using for loop and vertcat, but its the slowest solution ever :/ Thanks!

    Read the article

  • When building a web Application project, TFS 2008 Builds two spearate projects in the _PublishedFold

    - by Steve Johnson
    Hi all, I am trying to a perform build automation on one of web application projects built using VS 2008. The _PublishedWebSites contains two folders: Web and Deploy. I just want the TFS 2008 to generate only the Deploy Folder and Not the Web Folder. Here is my TFSBuild.proj File <Project ToolsVersion="3.5" DefaultTargets="Compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" /> <Import Project="$(MSBuildExtensionsPath)\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets" /> <ItemGroup> <SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Main/MySoftware.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> </ItemGroup> <ItemGroup> <ConfigurationToBuild Include="Release|AnyCPU"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>Any CPU</PlatformToBuild> </ConfigurationToBuild> </ItemGroup> <!--<ItemGroup> <SolutionToBuild Include="$(BuildProjectFolderPath)/../../Development/Main/MySoftware.sln"> <Targets></Targets> <Properties></Properties> </SolutionToBuild> </ItemGroup> <ItemGroup> <ConfigurationToBuild Include="Release|x64"> <FlavorToBuild>Release</FlavorToBuild> <PlatformToBuild>x64</PlatformToBuild> </ConfigurationToBuild> </ItemGroup>--> <ItemGroup> <AdditionalReferencePath Include="C:\3PR" /> </ItemGroup> <Target Name="GetCopyToOutputDirectoryItems" Outputs="@(AllItemsFullPathWithTargetPath)" DependsOnTargets="AssignTargetPaths;_SplitProjectReferencesByFileExistence"> <!-- Get items from child projects first. --> <MSBuild Projects="@(_MSBuildProjectReferenceExistent)" Targets="GetCopyToOutputDirectoryItems" Properties="%(_MSBuildProjectReferenceExistent.SetConfiguration); %(_MSBuildProjectReferenceExistent.SetPlatform)" Condition="'@(_MSBuildProjectReferenceExistent)'!=''"> <Output TaskParameter="TargetOutputs" ItemName="_AllChildProjectItemsWithTargetPathNotFiltered"/> </MSBuild> <!-- Remove duplicates. --> <RemoveDuplicates Inputs="@(_AllChildProjectItemsWithTargetPathNotFiltered)"> <Output TaskParameter="Filtered" ItemName="_AllChildProjectItemsWithTargetPath"/> </RemoveDuplicates> <!-- Target outputs must be full paths because they will be consumed by a different project. --> <CreateItem Include="@(_AllChildProjectItemsWithTargetPath->'%(FullPath)')" Exclude= "$(BuildProjectFolderPath)/../../Development/Main/Web/Bin*.pdb; *.refresh; *.vshost.exe; *.manifest; *.compiled; $(BuildProjectFolderPath)/../../Development/Main/Web/Auth/MySoftware.dll; $(BuildProjectFolderPath)/../../Development/Main/Web/BinApp_Web_*.dll;" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always' or '%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'" > <Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/> <Output TaskParameter="Include" ItemName="_SourceItemsToCopyToOutputDirectoryAlways" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/> <Output TaskParameter="Include" ItemName="_SourceItemsToCopyToOutputDirectory" Condition="'%(_AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/> </CreateItem> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.WebDeployment.targets. <Target Name="BeforeBuild"> </Target> <Target Name="BeforeMerge"> </Target> <Target Name="AfterMerge"> </Target> <Target Name="AfterBuild"> </Target> --> </Project> I want to build everything that the builtin Deploy project is doing for me. But i dont want the generated Web Project as it conatains App_Web_xxxx.dll assemblies instead of a single compiled assembly. Please help. Thanks

    Read the article

  • Changes to JBoss web.xml have no effect

    - by sixtyfootersdude
    I just added this to my web.xml on my JBOSS server. But it had no effect. I am still allowed to connect to ports that do not use bi-directional certificate exchange. Anyone have an ideas? <!-- Force SSL for entire site as described here: http://wiki.metawerx.net/wiki/ForcingSSLForSectionsOfYourWebsite --> <security-constraint> <!-- defines resources to be protected (in this case everything)--> <web-resource-collection> <!-- name for the resource, can be anything you like --> <!-- Question: is this referenced anywhere else? --> <web-resource-name> Entire Application </web-resource-name> <!-- protect the entire application --> <url-pattern> /* </url-pattern> </web-resource-collection> <!-- defines protection level for protected resource --> <user-data-constraint> <!-- data cannot be observed or changed --> <!-- how it works in tomcat: --> <!-- if (set to integral or confidential && not using ssl) --> <!-- redirect sent to client, redirecting them to same url --> <!-- but using the port defined in the redirect port --> <!-- attribute in the <Connector> element of server.xml --> <!-- default is 443, so in other words user is redirected --> <!-- to same page using ssl. --> <!-- BUT it is differnt for JBOSS!! See this link: http://wiki.metawerx.net/wiki/ForcingSSLForSectionsOfYourWebsite --> <transport-guarantee> CONFIDENTIAL </transport-guarantee> </user-data-constraint> </security-constraint> <login-config> <!-- Client-side SSL certificate based authentication. The cert is passed to the server to authenticate --> <!-- I am pretty sure that CLIENT-CERT should have a dash NOT an underscore see: http://www.mail-archive.com/[email protected]/msg139845.html --> <!-- CLIENT-CERT uses a client's AND server's certificates. See: http://monduke.com/2006/01/19/the-mysterious-client-cert/ --> <auth-method> CLIENT-CERT </auth-method> </login-config> Update Actually it appears that I have made an error in my original posting. The web.xml does block users from connecting to the webservice using http (port C below). However users are still allowed to connect to ports that do not force users to authenticate themselves (port B). I think that users should be able to connect to port A (it has clientAuth="true") but I dont think that people should be able to connect to port B (it has clientAuth="false"). Excerpt from server.xml <Connector port="<A>" ... SSLEnabled="true" ... scheme="https" secure="true" clientAuth="true" keystoreFile="... .keystore" keystorePass="pword" truststoreFile="... .keystore" truststorePass="pword" sslProtocol="TLS"/> <Connector port="<B>" ... SSLEnabled="true" ... scheme="https" secure="true" clientAuth="false" keystoreFile="... .keystore" keystorePass="pword" sslProtocol = "TLS" /> <Connector port="<C>" ... />

    Read the article

  • Asp.net web service: Problems accessing without www

    - by MysterM
    I have a Asp.net web service running on www.domain.com/Service.svc that I connect to using jQuery from my asp.net website. Everything works perfect if the user access my website with www.domain.com. But if the user uses only domain.com I get error: There was no channel actively listening at 'http://domain.com/Service.svc/get?date=2010-10-09'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening. In my web.config I use the serviceHostingEnvironment tag to get the service running on my webhost (it doesn't work otherwise). Maybe this is what causes the error? Here is my system.serviceModel in web.config (I had some problems setting up the web service so that's why my web.config might be a bit messy: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="ServiceAspNetAjaxBehavior"> <enableWebScript /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="ServiceBehavior"> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"> <baseAddressPrefixFilters> <add prefix="http://www.domain.com"/> </baseAddressPrefixFilters> </serviceHostingEnvironment> <services> <service behaviorConfiguration="ServiceBehavior" name="Service"> <endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="ServiceBinding" contract="Service" /> </service> </services> <bindings> <webHttpBinding> <binding name="ServiceBinding" maxBufferPoolSize="1000000" maxReceivedMessageSize="1000000"> <readerQuotas maxDepth="1000000" maxStringContentLength="1000000" maxArrayLength="1000000" maxBytesPerRead="1000000" maxNameTableCharCount="1000000" /> </binding> </webHttpBinding> </bindings> </system.serviceModel> How can I make it possible for my users to access my webservice also when using only domain.com?

    Read the article

  • New Features in ASP.NET Web API 2 - Part I

    - by dwahlin
    I’m a big fan of ASP.NET Web API. It provides a quick yet powerful way to build RESTful HTTP services that can easily be consumed by a variety of clients. While it’s simple to get started using, it has a wealth of features such as filters, formatters, and message handlers that can be used to extend it when needed. In this post I’m going to provide a quick walk-through of some of the key new features in version 2. I’ll focus on some two of my favorite features that are related to routing and HTTP responses and cover additional features in a future post.   Attribute Routing Routing has been a core feature of Web API since it’s initial release and something that’s built into new Web API projects out-of-the-box. However, there are a few scenarios where defining routes can be challenging such as nested routes (more on that in a moment) and any situation where a lot of custom routes have to be defined. For this example, let’s assume that you’d like to define the following nested route:   /customers/1/orders   This type of route would select a customer with an Id of 1 and then return all of their orders. Defining this type of route in the standard WebApiConfig class is certainly possible, but it isn’t the easiest thing to do for people who don’t understand routing well. Here’s an example of how the route shown above could be defined:   public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "CustomerOrdersApiGet", routeTemplate: "api/customers/{custID}/orders", defaults: new { custID = 0, controller = "Customers", action = "Orders" } ); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); GlobalConfiguration.Configuration.Formatters.Insert(0, new JsonpFormatter()); } } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }   With attribute based routing, defining these types of nested routes is greatly simplified. To get started you first need to make a call to the new MapHttpAttributeRoutes() method in the standard WebApiConfig class (or a custom class that you may have created that defines your routes) as shown next:   public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Allow for attribute based routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } Once attribute based routes are configured, you can apply the Route attribute to one or more controller actions. Here’s an example:   [HttpGet] [Route("customers/{custId:int}/orders")] public List<Order> Orders(int custId) { var orders = _Repository.GetOrders(custId); if (orders == null) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound)); } return orders; }   This example maps the custId route parameter to the custId parameter in the Orders() method and also ensures that the route parameter is typed as an integer. The Orders() method can be called using the following route: /customers/2/orders   While this is extremely easy to use and gets the job done, it doesn’t include the default “api” string on the front of the route that you might be used to seeing. You could add “api” in front of the route and make it “api/customers/{custId:int}/orders” but then you’d have to repeat that across other attribute-based routes as well. To simply this type of task you can add the RoutePrefix attribute above the controller class as shown next so that “api” (or whatever the custom starting point of your route is) is applied to all attribute routes: [RoutePrefix("api")] public class CustomersController : ApiController { [HttpGet] [Route("customers/{custId:int}/orders")] public List<Order> Orders(int custId) { var orders = _Repository.GetOrders(custId); if (orders == null) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.NotFound)); } return orders; } }   There’s much more that you can do with attribute-based routing in ASP.NET. Check out the following post by Mike Wasson for more details.   Returning Responses with IHttpActionResult The first version of Web API provided a way to return custom HttpResponseMessage objects which were pretty easy to use overall. However, Web API 2 now wraps some of the functionality available in version 1 to simplify the process even more. A new interface named IHttpActionResult (similar to ActionResult in ASP.NET MVC) has been introduced which can be used as the return type for Web API controller actions. To return a custom response you can use new helper methods exposed through ApiController such as: Ok NotFound Exception Unauthorized BadRequest Conflict Redirect InvalidModelState Here’s an example of how IHttpActionResult and the helper methods can be used to cleanup code. This is the typical way to return a custom HTTP response in version 1:   public HttpResponseMessage Delete(int id) { var status = _Repository.DeleteCustomer(id); if (status) { return new HttpResponseMessage(HttpStatusCode.OK); } else { throw new HttpResponseException(HttpStatusCode.NotFound); } } With version 2 we can replace HttpResponseMessage with IHttpActionResult and simplify the code quite a bit:   public IHttpActionResult Delete(int id) { var status = _Repository.DeleteCustomer(id); if (status) { //return new HttpResponseMessage(HttpStatusCode.OK); return Ok(); } else { //throw new HttpResponseException(HttpStatusCode.NotFound); return NotFound(); } } You can also cleanup post (insert) operations as well using the helper methods. Here’s a version 1 post action:   public HttpResponseMessage Post([FromBody]Customer cust) { var newCust = _Repository.InsertCustomer(cust); if (newCust != null) { var msg = new HttpResponseMessage(HttpStatusCode.Created); msg.Headers.Location = new Uri(Request.RequestUri + newCust.ID.ToString()); return msg; } else { throw new HttpResponseException(HttpStatusCode.Conflict); } } This is what the code looks like in version 2:   public IHttpActionResult Post([FromBody]Customer cust) { var newCust = _Repository.InsertCustomer(cust); if (newCust != null) { return Created<Customer>(Request.RequestUri + newCust.ID.ToString(), newCust); } else { return Conflict(); } } More details on IHttpActionResult and the different helper methods provided by the ApiController base class can be found here. Conclusion Although there are several additional features available in Web API 2 that I could cover (CORS support for example), this post focused on two of my favorites features. If you have .NET 4.5.1 available then I definitely recommend checking the new features out. Additional articles that cover features in ASP.NET Web API 2 can be found here.

    Read the article

  • Advanced tasks using Web.Config transformation

    - by dcadenas
    Does anyone know if there is a way to "transform" specific sections of values instead of replacing the whole value or an attribute? For example, I've got several appSettings entries that specify the Urls for different webservices. These entries are slightly different in the dev environment than the production environment. Some are less trivial than others <!-- DEV ENTRY --> <appSettings> <add key="serviceName1_WebsService_Url" value="http://wsServiceName1.dev.domain.com/v1.2.3.4/entryPoint.asmx" /> <add key="serviceName2_WebsService_Url" value="http://ma1-lab.lab1.domain.com/v1.2.3.4/entryPoint.asmx" /> </appSettings> <!-- PROD ENTRY --> <appSettings> <add key="serviceName1_WebsService_Url" value="http://wsServiceName1.prod.domain.com/v1.2.3.4/entryPoint.asmx" /> <add key="serviceName2_WebsService_Url" value="http://ws.ServiceName2.domain.com/v1.2.3.4/entryPoint.asmx" /> </appSettings> So far, I know I can do something like this in the Web.Release.Config: <add xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" key="serviceName1_WebsService_Url" value="http://wsServiceName1.prod.domain.com/v1.2.3.4/entryPoint.asmx" /> <add xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" key="serviceName2_WebsService_Url" value="http://ws.ServiceName2.domain.com/v1.2.3.4/entryPoint.asmx" /> However, everytime the Version for that webservice is updated, I would have to update the Web.Release.Config as well, which defeats the purpose of simplfying my web.config updates. I know I could also split that URL into different sections and update them independently, but I rather have it all in one key. I've looked through the available web.config Transforms but nothings seems to be geared towars what I am trying to accomplish. These are the websites I am using as a reference: Vishal Joshi's blog, MSDN Help, and Channel9 video Any help would be much appreciated! -D

    Read the article

  • Threading calls to web service in a web service - (.net 2.0)

    - by Ryan Ternier
    Got a question regarding best practices for doing parallel web service calls, in a web service. Our portal will get a message, split that message into 2 messages, and then do 2 calls to our broker. These need to be on separate threads to lower the timeout. One solution is to do something similar to (pseudo code): XmlNode DNode = GetaGetDemoNodeSomehow(); XmlNode ENode = GetAGetElNodeSomehow(); XmlNode elResponse; XmlNode demResponse; Thread dThread = new Thread(delegate { //Web Service Call GetDemographics d = new GetDemographics(); demResponse = d.HIALRequest(DNode); }); Thread eThread = new Thread(delegate { //Web Service Call GetEligibility ge = new GetEligibility(); elResponse = ge.HIALRequest(ENode); }); dThread.Start(); eThread.Start(); dThread.Join(); eThread.Join(); //combine the resulting XML and return it. //Maybe throw a bit of logging in to make architecture happy Another option we thought of is to create a worker class, and pass it the service information and have it execute. This would allow us to have a bit more control over what is going on, but could add additional overhead. Another option brought up would be 2 asynchronous calls and manage the returns through a loop. When the calls are completed (success or error) the loop picks it up and ends. The portal service will be called about 50,000 times a day. I don't want to gold plate this sucker. I'm looking for something light weight. The services that are being called on the broker do have time out limits set, and are already heavily logged and audited, so I'm not worried on that part. This is .NET 2.0 , and as much as I would love to upgrade I can't right now. So please leave all the goodies of 2.0 out please.

    Read the article

  • Get XML-RPC (Andorid - PHP) web service different params type

    - by Jovan
    Hi, I want to create XML-RPC web service for Andorid (client) - PHP (Server) communication I create XML-RPC PHP web service server using this tutorial: http://articles.sitepoint.com/article/own-web-service-php-xml-rpc/5 For andorid client web service I use this project: http://code.google.com/p/android-xmlrpc/ server and client communication is OK, but I have problem with getting params from andorid client to php server. From andorid client I send two params (first integer and second float number) Object[] params = { 3, 3.6f, }; method.call(params); , but I don't know how to handle this parameters in php server?? in php server there is some function , but with only one param ($news_id): function news_viewNewsItem ( $news_id ) { /* Define the query to fetch the news item */ $query = "SELECT * FROM kd_xmlrpc_news WHERE news_id = '" . $news_id . "'"; $sql = mysql_query ( $query ); if ( $result = mysql_fetch_array ( $sql ) ) { /* Extract the variables for sending in our server response */ $news_item['news_id'] = $result['news_id']; $news_item['date'] = XMLRPC_convert_timestamp_to_iso8601( mysql_datetime_to_timestamp( $result['date'] ) ); $news_item['title'] = $result['title']; $news_item['full_desc'] = $result['full_desc']; $news_item['author'] = $result['author']; /* Respond to the client with the news item */ XMLRPC_response(XMLRPC_prepare($news_item), KD_XMLRPC_USERAGENT); } else { /* If there was an error, respond with a fault code instead */ XMLRPC_error("1", "news_viewNewsItem() error: Unable to read news:" . mysql_error(), KD_XMLRPC_USERAGENT); } } In server.py file there is functions for every method but I dont know how to write in php server: def add(self, x, y): print print "input x=%s, y=%s" % (str(x), str(y)) sum = x + y print "output", sum print return sum Can some one help me with code , and tell me how to handle various types from client to server?? Thanks and Happy New Year

    Read the article

  • my web service works locally but, not when it is deployed

    - by rogdawg
    When I deploy my web service, I get the following error: There is no build provider registered for the extension '.svc'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'. I found one thread (http://forums.asp.net/t/1228638.aspx) that suggested a solution but, I can not get it to work. If I make the changes to my web config file as suggested in the thread, I then get a configuration error. One odd thing is that, if I check the machine.config file on my machine, located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config, I don't see any of the config settings described in the thread. As a matter of fact, there is no mention of "compilation" or "buildProviders" at all. The on-line documents I have found regarding BuildProviderAppliesToAttribute have not been of any help. Thanks in advance for any advice you can give. Here is my entire config file listing: <?xml version="1.0"?>

    Read the article

  • How to document an existing small web site (web application), inside and out?

    - by Ricket
    We have a "web application" which has been developed over the past 7 months. The problem is, it was not really documented. The requirements consisted of a small bulleted list from the initial meeting 7 months ago (it's more of a "goals" statement than software requirements). It has collected a number of features which stemmed from small verbal or chat discussions. The developer is leaving very soon. He wrote the entire thing himself and he knows all of the quirks and underlying rules to each page, but nobody else really knows much more than the user interface side of it; which of course is the easy part, as it's made to be intuitive to the user. But if someone needs to repair or add a feature to it, the entire thing is a black box. The code has some minimal comments, and of course the good thing about web applications is that the address bar points you in the right direction towards fixing a problem or upgrading a page. But how should the developer go about documenting this web application? He is a bit lost as far as where to begin. As developers, how do you completely document your web applications for other developers, maintainers, and administrative-level users? What approach do you use, where do you start, do you have a template? An idea of magnitude: it uses PHP, MySQL and jQuery. It has about 20-30 main (frontend) files, along with about 15 included files and a couple folders of some assets. So overall it's a pretty small application. It interfaces with 7 MySQL tables, each one well-named, so I think the database end is pretty self-explanatory. There is a config.inc.php file with definitions of consts like the MySQL user details, some from/to emails, and URLs which PHP uses to insert into emails and pages (relative and absolute paths, basiecally). There is some AJAX via jQuery. Please comment if there is any other information that would help you help me and I will be glad to edit it in.

    Read the article

  • Filtering a Grid of Data in ASP.NET MVC

    This article is the fourth installment in an ongoing series on displaying a grid of data in an ASP.NET MVC application. The previous two articles in this series - Sorting a Grid of Data in ASP.NET MVC and Displaying a Paged Grid of Data in ASP.NET MVC - showed how to sort and page data in a grid. This article explores how to present a filtering interface to the user and then only show those records that conform to the filtering criteria. In particular, the demo we examine in this installment presents an interface with three filtering criteria: the category, minimum price, and whether to omit discontinued products. Using this interface the user can apply one or more of these criteria, allowing a variety of filtered displays. For example, the user could opt to view: all products in the Condiments category; those products in the Confections category that cost $50.00 or more; all products that cost $25.00 or more and are not discontinued; or any other such combination. Like with its predecessors, this article offers step-by-step instructions and includes a complete, working demo available for download at the end of the article. Read on to learn more! Read More >

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >