WCF / ASMX :: Writing A .NET REST Wrapper?
Oct 5, 2010
I am a REST web service newbie, does visual studio, .NET, or some other nifty microsoft tool provide any easy way to auto generate classes to consume a REST web service? With REST services is there even a service definition like there is with SOAP (WSDL) beyond the printed documentation? There is a new service that I'd like to consume but they only wrote wrappers for PHP, Pearl, Ruby, and Java and have more or less said you are on your own with .NET. I could write it myself but I'd like to cut corners and save time wherever possible.
View 1 Replies
Similar Messages:
Nov 8, 2010
I wrote a webmethod (Called SearchData()) in which the method makes a httpwebrequest to another url and gets the data in xmldocument. After getting the xmlDocument ,it is returned to SearchData method invoker. When i invoke the from browser it works fine. But When another application in java tries to consume this webmethod SearchData(), it is getting the error
<wsdl:part name="Body"/>
and each part should be type defined. The WSDL file is not well formatted. it doesn't have Type defined at each element. How to fix this.or Is there any other Better way to provide the end user the xml(ie from httpwebrequest result in webmethod ) with a soap wrapper ie with a well defined wsdl. My code :
[Code]....
View 1 Replies
Sep 23, 2010
tried so many different things but havent got past this seemingly trivial problem. I created a WCF service application from visual studio 2010 WCF templates. it generated the IService.cs and Service1.svc files and generated the web.config
i created a website in IIS 7 on windows 2008, and pointed it to the app folder. when i go to [URL] via web browser, i get a message indicating service is running and suggests using svcutil etc etc., but when i go to [URL] the web browser says 400 bad request. this is without changing anything from what VS generated. the operation contract looks like
[Code]....
Update: forgot to mention i even tried decorating the operation with WebGet attribute with UriTemplate parameter, without luck.
View 4 Replies
Jan 18, 2011
can Pass object in Rest Service Uri
View 1 Replies
Oct 26, 2010
[Code]....
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?
View 2 Replies
Oct 1, 2010
My code below
BtnClick
YahooSample();
public void YahooSample()
{
HttpWebRequest request = WebRequest.Create("http://developer.yahoo.com/yui/") as HttpWebRequest;
[Code]....
View 1 Replies
Mar 30, 2010
How may I post arbitrary data to a REST WCF webservice? I mean, wihout use contracts.
Because my data is dynamic and I cannot have contracts, I want to get ride of the serialization overhead.
How should I declare my service and method?
View 1 Replies
Apr 12, 2010
Is it possible to create REST based web service using asmx?
View 1 Replies
Sep 2, 2010
I have looked at nearly every single WCF Rest PUT/POST issues on SO here and have still been unable to determine why I am unable to PUT or POST to my web service but am able to call a test GetTime method via GET. This particular service exchanges custom credential information (username, password and some other information) for a token. This token information is encrypted and added to the header of subsequent requests to other web services so that username/passwords don't have to be passed around everywhere. All web service calls are still treated as stateless, but require this auth header information rather username/passwords to access secured service operations.
[Code]....
I have also checked in IIS 7 the handler mappings for *.svc and checked that 'all verbs' are enabled.
View 1 Replies
Jul 6, 2010
I've been wondering how i go about writing a MembershipProvider that authenticates using a WCF Provider. At the moment i have a wcf service that will authenticate a username and password.
I can write my own Membership provider that will authenticate using WCF calls, thats no problem. What i want is to have the WCF as the actually provider.
Meaning in the web.config file i just put the WCF service as the MembershipProvider. Or is this not possible or not the way this is to be done.
View 1 Replies
Mar 3, 2011
I have run into the issue on DataSet.WriteXml method. Apparently, if any row in a column in the DataSet has a null value, the entire column/rows will not write out in the xml file using the method DataSet.WriteXml. So, as terrible as that bug is, I need to send the data another way. Does anyone have any thoughts?
View 4 Replies
Mar 30, 2010
I want to implement a custom authentication in my application using the basic authentication schema. I've configured it in the Web.config and enabled the basic authentication in the IIS, but when I try to open the service in the browser... appears a login dialog... what do I have to put ther? Besides, I want to control the authentication, I mean, I want to check whom is allowed in my custom list... where is it looking now?
When I use the WebRequest class, I'm getting a "401 - Unauthorized":
req = WebRequest.Create("http://localhost/RESTfulService/Service1.svc/Test");
req.Credentials = CredentialCache.DefaultNetworkCredentials;
WebResponse res = req.GetResponse();
What do I have to do for implement a custom basic authentication? (I cannot use membership providers).
I've set up in the Web.config:
[code]....
View 1 Replies
May 25, 2010
We are developing SOA based application using .NET 3.5 and WCF & WPF.
One common issue we are facing is mapping between WCF enum and WPF enums. We had to do mapping between WCF enums to WPF enums. Following is sample code
Switch(WCFServiceObject.Status)
{
Case WCFServiceStatus.Married[code]....
You can see that we have to do mapping WPF and WCF enums. Is there any easiest way to achieve this mapping without writing tedious switch statements? One way of doing this is using Dictionary, but apart from this, is there any good way? We have lots of enums for which have to do mappings.
View 1 Replies
Feb 6, 2011
How to write a webservice to call the proxy server through IIS webserver?
View 2 Replies
Feb 8, 2010
I need to call a Rest service but would like to do so without having to redirect. Here is my dilemma. The Rest service we are trying to integrate offers the option to sign up for a subscription but does not allow us to upgrade an existing subscription. So if a user wants to upgrade an existing subscription we have to first cancel and then have the user sign up for a brand new subscription. I don't know how I can make this so it flows nicely in my code. I ideally I would like to do something like this
User decides to upgrade
Click upgrade button
Existing account is being cancelled, if cancellation was successful
New account is being created
How can I do this with a Rest service? Here is a sample URI/URL
https://someservice.com?
Action=CancelSubscriptionAndRefund
&AWSAccessKeyId=AKIAIIFXJCFIHITREP4Q
&CallerReference=CallerReference07
&CancelReason=MyWish
&RefundAmount.CurrencyCode=USD
&RefundAmount.Value=1
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Signature=1uFUSSFvau1zadnSzKRS5ZchuLMn9p5M3ifaHGHie7M%3D
&SubscriptionId=17d62772-c53e-4bdb-9667-65d7b7841cfc
&Timestamp=2009-10-06T08%3A05%3A13.296Z
&Version=2008-09-
Could anybody give me some ideas how to make this work in an elegant manner. We thought we could keep the old subscription and then just sign the user up for a new subscription for the difference of the money. For example the first subscription would be 2.95 and the second one would be 2.00 which would amount to a subscription of 4.95. I think it is not elegant and the user would see 2 charges on the credit card, weird, I think. Since I don't know much about Rest maybe there is a way that this can be solved.
View 1 Replies
Oct 15, 2010
I have developed an rest enable wcf service by using the following link
[URL]
Now I want to know is there any difference between rest enabled wcf service (or restful web service) & rest web service ? If there is any difference then what is that ? If there is difference the can you provide me any link (which represents steps visually as in above link) through which I can develop rest web service ?
View 2 Replies
Mar 17, 2010
Today we have a windows application that, using an OCX, creates a web page (visible by a WebBrowser control in a small .NET WinForm application) and communicates through COM to the main application/client. (not relevant but this is Pascal)
I'm currently responsible to re create this application in a web environment so we can have the same functionality shared through Web as the user can see the same in a Web Browser.
The Windows application has almost 4 years on it and I need to re create everything from scratch, and all the bugs/features find in the future in the Windows Application I have to re create them again in the Web...
is there any way I can create a Wrapper, even using 3rd party commercial objects, to:
Communicate with the COM Object Can expose the content of the OCX (this in my most confortable language, ASP.NET C#, but other are welcome) I was thinking out loud, can this be accomplish with a Java Applet? Silverlight 4?
View 1 Replies
Feb 8, 2011
I'm trying to create a SessionManager class which I can use to manage sessions in my MVC applications. For that I'm thinking the best way of doing so is by creating a wrapper class for HttpContext which would then allow me to access HttpContext.Current.Session.
To be honest, I'm not really sure about the whole thing, I just feel it's the logical way of doing so. I also want to create an ISessionManager and ISession interfaces, and then implement them according to my application's needs. For my current project, and for now, I need a InProc session management, but I might need to store session data in MSSQL Server when we decide to expand and use a web farm or a garden. That's why I'm trying to build a sort of an extensible framework right from the start.
Final note, I will be using Microsoft Unity to inject the concrete SessionManager of choice. I believe that's a good way to maintain a certain level of abstraction.
View 1 Replies
Oct 15, 2010
creating dataset wrapper in c# with sample code..
View 3 Replies
Nov 24, 2010
I have a third party dll and i need to add some more functionalities (methods, constants etc..) so create a wrapper class. I have no idea about wrapper classes. what is the purpose of this and how to create in .NET for this 3rd party dll.
View 6 Replies
Jul 15, 2010
I have this CollapsiblePanelExtender (below) the problem is that in firefox it gives a horizontal scroll bar under the control which has to expand.
[Code]....
Below is the generated HTML
[Code]....
If I remove the "overflow-y:hidden" from the generated div then the scroll bar goes away, which is what I want....
View 3 Replies
Aug 13, 2010
I've seen how to Fake the SessionState object in MVC using Scott Hanselmans MvcMockHelpers, but I'm dealing with a separate problem.What I like to do is create a wrapper around the Session object to make objects a little more accessible and strongly typed rather than using keys all over. Here is basically what it does:
public class SessionVars{ public SessionVars() {} public string CheckoutEmail { get { return Session[checkoutEmailKey] as string; } set { Session[checkoutEmailKey] = value; } }}
So that I can just do this in my controllers and views:
SessionVars s = new SessionVars();s.CheckoutEmail = "test@tester.com";
Now the problem comes in when I want to write unit tests, this class is tightly coupled with the HttpSessionState. What I can't figure out is what is the right class to accept/pass so that I can pass in a FakeHttpSession into the SessionVars class. I've tried so many things with this, and this (below) will compile, but it can't cast the HttpSessionState into the IDictionary. I've tried ICollection, HttpSessionStateBase.
public class SessionVars{ public SessionVars() : this(HttpContext.Current.Session) { } public SessionVars(ICollection session) { Session = (IDictionary<string, object>)session; } public IDictionary<string, object> Session { get; [code]...
I'm missing something big here. I feel like this is possible and that I should even be that far off.Furthermore, I'm confused as to whether I should use the IHttpSessionState, HttpSessionStateBase or the HttpSessionStateWrapper. What is the abstract type that I'd use for the session object inside my SessionVars class? What is the type that I pass into the constructor?
View 3 Replies
Mar 8, 2011
I am just trying to figure something out. At work we have alot of data access code Ex:
[Code]....
Pretty standard stuff really, but I was at a training course recently where the Developers insisted on wrapping code, that seemed nothing more than expose exactly the same functionality.
I was interested in your thoughts as to whether this was a good idea. So the above would inherit from a DbHelper class with some thing like:
[Code]....
These would just expose the same but maybe a bit more generic i.e. using DbCommand as opposed to SqlCommand.
View 1 Replies
Sep 25, 2010
Anybody seen any c# code examples for using Google site search to send a request to the Google search api and return the results in xml?
View 1 Replies
Mar 4, 2010
Not sure if I'm posting in the right place so please forgive meI have an ASP.NET C# application that connects to either a SQL Server or MySQL database depending on some value that is set in my project config. The issue I'm trying to avoid is handling the connections and queries separately. Ideally I would want to use a DB Wrapper class that can handle both SQL Server and MySQL.
View 8 Replies