On my local machine with the default ASP web server I am able to browse my web service's methods, which have with prompts and an invoke button.But when I deploy this same code to an IIS server and I browse the asmx page I just get a descritpion of the methods.
I had a post here [URL] that I need to expand on now. I have a few web pages that need to check for a certain role on each page request. I have a custom Membership Provider and a custom Role Provider (called CustomRoleProvider - very original - I know) that I am using to do this. When a user logs in, the CustomRoleProvider.GetRolesForUser() method is called automatically (by the urlAuthorizationModule). When this method gets called, I am currently adding a role to the roles string array that allows/permits the user from viewing the web pages of concern based on certain qualifications that are determined elsewhere in the code (i.e. the database is queried to see if the user has rights to visit certain pages).
This approach only gets me half way because the user's roles are only checked once at login. When I wrote my previous post, I thought the CustomRoleProvider was broken because it wasn't calling the IsUserInRole() method on each page request. According to Microsoft, "The IsUserInRole method is called by the IsUserInRole method of the Roles class to determine whether the current logged-on user is associated with a role from the data source for the configured ApplicationName." (that information comes from this page:
[URL] Reading that description I thought it was being called automatically on each page request. This is not correct. What I need to know how to do is to get a method in the CustomRoleProvider that returns a boolean to be called automatically on each page request so I can update the user's roles if they change while the user is logged into the web site. For example, if the user has rights to visit page A and then five minutes later his rights are revoked, he can't visit page A again unless he contacts an admin to reset his rights.
I am implementing web service into my web application, i added web reference to my application of required web methods from my asmx file.
i am able to create object of this weservice and able to see all the web methods available from the reference object. In debug mode(working environment), i could invoke and get result from the webmethod and working fine as expect. i created test page for testing this.
But, when i deploy same in my beta i am getting below error.(my both test page and asmx file available in my beta server where i deployed)
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 138.108.18.207:80
Description:
An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 138.108.18.207:80
I'm trying to invoke an Oracle BPEL web service from asp.net (vb) and having trouble getting it to work. This is the portion of my code in the Page_Prerender event:
[Code]....
The web service doesn't launch though.
I'm not a web service expert, so seeing if anyone else may know how to get this going. I don't need to track the web service - just need to launch it.
I was trying to overload two web methods by adding the MessagName descriptor.
[WebMethod(MessageName = "GetFiles")] public [Code]....
But I am getting the following Server Error
Server Error in '/Test.Service' Application.
Service 'TestService' does not conform to WS-I Basic Profile v1.1. Please examine each of the normative statement violations below. To turn off conformance check set the ConformanceClaims property on corresponding WebServiceBinding attribute to WsiClaims.None.R2304: Operation name overloading in a wsdl:portType is disallowed by the Profile. A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes. Note that this requirement applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.
- Operation 'GetFiles' on portType 'TestServiceSoap' from namespace 'http://www.Test.com'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Service 'TestService' does not conform to WS-I Basic Profile v1.1. Please examine each of the normative statement violations below. To turn off conformance check set the ConformanceClaims property on corresponding WebServiceBinding attribute to WsiClaims.None.R2304: Operation name overloading in a wsdl:portType is disallowed by the Profile. A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes. Note that this requirement applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.
- Operation 'GetnFiles' on portType 'TestServiceSoap' from namespace 'http://www.test.com'.
To make service conformant please make sure that all web methods belonging to the same binding have unique names.
I have an ASP.NET 3.5 web application that uses ASMX web services that are called synchronously. I want to see if I can call them asynchronously because some of the web methods take a long time to process and I'm concerned that this is affecting scalability.
I found this article that explains how to use Asychronous web methods, from 2002: http://msdn.microsoft.com/en-us/library/aa480516.aspx. It says:
For asynchronous requests, during reflection the ASMX handler looks for Web methods with a certain kind of signature that it recognizes as being asynchronous. In particular, it looks for a pair of methods that have the following rules:
There is a BeginXXX and EndXXX Web method where XXX is any string that represents the name of the method you want to expose. The BeginXXX function returns an IAsyncResult interface and takes as its last two input parameters an AsyncCallback, and an object respectively. The EndXXX function takes as its only parameter an IAsyncResult interface. Both must be flagged with the WebMethod attribute. When I create the reference to my web service, I don't see any BeginXXX and EndXXX methods. I only see a XXXAsynch method and the article doesn't mention that method. I've done further research and every other article I've found also mentions the BeginXXX and EndXXX web methods.
I am using GetMethods() method to get the list of all the available methods in WCF. But it returns everything, how can I only show the methods that I exposed to client.
[Code]....
How can I filter the methods only to WCF Servicecontracts?
given a url that references an asmx how would i go about displaying all of their method names? if assembly="http://.../something/something.asmx" and i was trying to display the method names of that service what should i do now that i have gotten myself this far? i cant seem to find a solution among the hundreds of examples ive looked at
public TestReflection(string assembly) { Assembly testAssembly = Assembly.LoadFrom(assembly);[code]....
What is the best way for authenticating web methods in a web service? Is it right having authentication for every web method and verify user name and password for each web method? Is there a way to authenticate just once not for every web method? something like using sessions and etc?
it may sound a bit newbish question.We have a web service that comunicates with the database and exposes web methods that enables the application to access the database. Each method does only one operation (Insert, Update or Delete). What I need to do is create a transaction that will be consisted of multiple calls to the database, meaning multiple calls of more then one web methods. Can I do that? (I read that if the web method does not throw exception - or ContextUtil.SetAbort() is not called - the transaction will be commited automatically when the web method finishes executing, which I don't want to happen because I want to call another web method in the same transaction, and then manually commit the transaction)
I have some WCF services that I want to return in different formats based on a querystring param. For example, [URL], [URL], [URL], etc... This would make it so that many different types of clients could consume the services whichever way was easiest for them, such as binary for a .NET client and json for an ajax or Flex client.
What I'm thinking is that I can have the WCF web methods return their .NET business objects and not worry about the output mode and then have a behavior that hooks in after returning from the web method which checks the querystring for this param and either:
1. Continues returning the business objects if the mode is dotnet.
2. Converts the business objects to xml if the mode is xml and returns a string of xml.
3. Converts the business objects to json if the mode is json and returns a string of json.
I have an ASMX Web Service set up to use the HTTP GET method. Simple methods which take basic String and Int parameters are working ok, and I can call MyService.asmx/MethodName?Param=Value and get a response back in XML.
However, when I have a method which has a nullable Int (i.e. int?), I get this error:
< Method Name > Web Service method name is not valid.
The error message is confusing, as the method does exist, just not in the GET scope. I presume this is because a nullable type is too complex to be passed via the URL, but I can't find any documentation or SO posts on this.
I appreciate that complex types like Lists or custom classes etc will not work using GET, but I would have assumed that a simple nullable int or nullable datetime could be handled natively, simply by detecting whether it was omitted from the URL. Guess it's not that simple!
which is better approach from performance point of view, is it better to use one web-service method to load data by passing Database Table name and keys or is it better to use separate method for each database table! knowing that i'm using .net asmx through ajax requests.it's obvious that one method is better from OO perspective since it have one function type 'data loading' but what about performance? does IIS affected by that or not? also is it better to make multi web-services 'asmx files' or just one!
public static class PageExtensions { public static int GetUserId(this Page targetPage) { var user = Membership.GetUser(targetPage.User.Identity.Name); return (int)user.ProviderUserKey; } }
Now in a page I need to use this method in a static WebMethod, so I have added another 'extension method' to PageExtensions:
public static int GetUserId() { return (int)Membership.GetUser(HttpContext.Current.User.Identity.Name).ProviderUserKey; }
and I call it as follows in my WebMethod: PageExtensions.GetUserId()
I am beginner in web applications development. I started one little project and host it on source forge "https://homoco.svn.sourceforge.net/svnroot/homoco". And I started implementing authentication in this application to learn how it works. From my experience people never use out of the box things so I want to implement this stuff alone (like in real world projects). So some questions:
1) Is there any reason to use membership out of the box? To use database table schema, stored procedures etc. that tool generate for developer. I think that this lower control over code and I decided to implement it my self. I don't know if I am right.
2) Is my approach in this demo project good or bad (if someone have time I like to do just a little code review)? I created database based on business rules. Not using database schema that membership provider require. Extend "MembershipProvider" class to satisfy my needs. Implement queries to database myself.
3) Now, this question is a little wired but I have to ask it. If we make custom Membership Provider and do sql queries alone, implement all MembershipProvider class methods ourselves, and in application use Membership.blabla() why is this approach different from not extending MembershipProvider class and putting all this methods in some unique class and call its methods then? I hope that someone understand what I ask here.
I am sorry for three questions, but I really trying to find the best way to implement this feature in my demo project like it is a real world application.