.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Correct Changes to WCF REST 4 APIKEY Sample for SSL Access

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :WCF
 
I am working with the wcfrestservicewithkey sample template for rest 4.  Taking the sample as is, its web.config is below.  What are the correct tweaks to this simplified config such that the rest service is available via an ssl connection? Thx! <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </modules> </system.webServer> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- This behavior enables API Key Verification --> <serviceAuthorization serviceAuthorizationManagerType="WCFRestServiceWithKey1.APIKeyAuthorization, WCFRestServiceWithKey1" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <standardEndpoints> <webHttpEndpoint> <!-- Configure the WCF REST service base address via the global.asax.cs file and the default endpoint


View Complete Post


More Related Resource Links

Looking for a simple Service and Console Client REST sample implementing BASIC authentication

  

Does anyone know of a C# code sample demonstrating WCF REST services and console test client with OperationContracts (GET and POST) implementing mutiple paramaters using BASIC authentication? Also, perhaps, using Fiddler as a test client as well? I have searched high and low for something like this, but have not had any success.


Sample: Creating Web Databases with Access 2010 and Access Services

  
Explore the code in this visual how-to article as you learn how to create an Access 2010 Web database and publish it to Access Services on SharePoint Server 2010.

Database Access Using SOAP and REST Web services

  
Hi Guys, Can anyone post the links regarding DATABASE ACCESS USING BOTH WEB SERVICES. How to query the database using the web service. Suppose i have SQL statement like " Select empID,empName,CName from employee,company where empID=CID;".  How to  send this sql query to database server using REST and SOAP web Services?  Thank You

Is there a way to contrain or rest the scope that a activity has access to?

  
What I want to do is build a sequence activity that A) has its own scope and B) does not let child activities gain access to scope outside of its own.Is this possible?

Access Database through WCF REST

  
 


hi,

i created a service like this

  [OperationContract (Name = "GetAllCustomer")]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate="/View/Data?format={fr}",
            Method="GET"
            )]
        Customer[] GetAllCustomer();


 public class Customer
    {
        [DataMember]
        public int CNo { get; set; }
        [DataMember]
        public string CName { get; set; }
      }


  and access my db in service.svc.cs

 List<Customer> lstEmp = new List<Customer>();

            

 String connString = ConfigurationManager.ConnectionStrings["connWebOrdering"].ConnectionString;
            SqlConnection sqlConn = new SqlConnection(connString);
            sqlConn.Open();

           SqlDataAdapter da = new SqlDataAdapter("Select [cid], [cname] from [CustomerDB].[dbo].[contact] ", sqlConn);
            DataSet ds = new DataSet();
       &

Android could not access REST service

  
 public bool CreateCustomer(StringBuilder strObj)
        {
//here i insert the data.. 
//i deserialize the incoming json format to my class object and insert into db
}


this method i can access using asp.net but not by using a android.. i have checked for the headers etc.. the response is OK in android while debugging but the data is not inserted..

what is the equivalent of stringbuilder in android??

in android i use

StringEntity se = new StringEntity(json.toString());

//and post the data to my service...

post.setEntity(se);

what is the equivalent of stringentity in C# and what can i do for this prob?


Android could not access REST service

  
  1. public bool CreateCustomer(StringBuilder strObj)   
  2.         {   
  3. //here i insert the data..    
  4. //i deserialize the incoming json format to my class object and insert into db   
  5. }  
  6. this method i can access using asp.net but not by using a android.. i have checked for the headers etc.. the response is OK in android while debugging but the data is not inserted..

    what is the equivalent of stringbuilder in android??

    in android i use

    StringEntity se = new StringEntity(json.toString());//and post the data to my service...

    post.setEntity(se);

    what is the equivalent of stringentity in C# and what can i do for this prob?


!< Ganesh >! Do not tell the world whom you are...Show it... !!

what is the correct format for rest URI

  
Hello All,

I am consuming WCF service in REST format using AJAX POST request but i get 405 error by the service



My contract are 

        [OperationContract]
        [WebInvoke(Method = "*", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped,
         UriTemplate = "/InsertBookMarks/{userId}/{name}/{address}/{location}")]
        string InsertBookMarks(string userId, string name, string address, string location);
Where Location is Longitude and latitude 



and when i call this uri using AJAX CAll with this paratmeter

url = "/GMService.svc/ajaxEndpoint/1/test/newyork/5.326,758.65";

            this.xmlHttp.open("POST", url, true);
            this.xmlHttp.setRequestHeader("Content-type", "application/json");
So this will return response 405 error code. What i debug and found there is mistakes in location pa

Sample: Adding Dynamic Maps to Contact Forms with REST Web Services in InfoPath 2010

  
Explore the code as you learn to Use the REST Web service data connection feature in InfoPath 2010 to add a dynamic map to a list form for contacts in SharePoint Server 2010.

Sample: Adding Dynamic Maps to Contact Forms with REST Web Services in InfoPath 2010

  
Explore the code as you learn to Use the REST Web service data connection feature in InfoPath 2010 to add a dynamic map to a list form for contacts in SharePoint Server 2010.

Using the Excel Services REST API to Access Excel Data in SharePoint Server 2010 (Visual How To)

  
Learn how to use the REST API to retrieve resources such as ranges, charts, tables, and PivotTables from workbooks stored on SharePoint Server 2010.

Video: Using the Excel Services REST API to Access Excel Data in SharePoint Server 2010 (Visual How

  
Watch a short video that shows how to programatically retrieve data from an Excel workbook.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

  
The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Abstract Factory Design Pattern (Sample in C# and VB .NET)

  
An abstract factory provides an interface for creating families of related objects without specifying their concrete classes. Sometimes one wants to construct an instance of one of a suite of classes, deciding between the classes at the time of instantiation. In order to avoid duplicating the decision making everywhere an instance is created, we need a mechanism for creating instances of related classes without necessarily knowing which will be instantiated.

Store and Display Images from MS Access Database Using C#

  
There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

ASP.Net Upload Image to MS Access Database

  
As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Does this look correct for saving a file/ new record to a database

  

So thank you for all your help so far, So I think i got this right,
but would like for you all to look it over to see if there is any
areas I might run into trouble with:

//using asp.net mvc 2
the table (sql server 2005, using entities framework)
"Pattern_Media"
table fields
"Pattern_Media_GUID  uniqueid 
"Pattern_GUID  uniqueid
"Media varbinary(max)  
"height int
"Width int
"Media_Type String (50)


the form:
<h2> Add Media to this pattern</h2>
<% Html.EnableClientValidation(); %>
<% Html.BeginForm("AddMedia", "Pattern", new { id= Model.Pattern_Guid} , FormMethod.Post, new {enctype = "multipart/form-data"}); %>
   
    <%: Html.Label("height") %>
    <%: Html.TextBox("height") %>

    <%: Html.Label("width") %>
    <%: Html.TextBox("width") %>

    <%: Html.Label("Media") %>
    <input type="file" id="Media" name="Media" />
   
    <input type="submit" name=

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend