WCF / ASMX :: Expose Certain Methods To Specific Clients?

Apr 9, 2010

I have a WCF service with two operations GetLoan and GetBalance

I want GetBalance to be exposed to all the clients but GetBalance tobe exposed to specific clients

How can this be done?

View 4 Replies


Similar Messages:

WCF / ASMX :: Expose A Method To The Silverlight Client?

Nov 22, 2010

I'm having trouble exposing a method to a silverlight client from a WCF service although I can expose properties.

My WCF service has a LoadDeal method which returns a Deal object

public Deal LoadDeal(int dealerId)
{
Deal d = new Deal();
d.LoadDeal(dealerId);
return d;

[Code]....

This works fine and the Refernce property can be accessed from the silverlight client.

But when I try to expose a method such as the CancelEdit method below, I can't find a way to expose this method to the silverlight client:

public void CancelEdit()
{
//Add logic to cancel changes here.
}

I've tried adding the DataMember annotation but the compiler complains. I've re-compiled without an annotation and then updated the service reference but nothing seems to be working.

View 1 Replies

WCF / ASMX :: Standardizing Interfaces To External Clients To Consume Wcf Services

Jul 9, 2010

I have a build a new 3 tier application (Web,Application,Data tier). The application tier (middle tier) will host wcf web services. I build my service classes, define bindings , contracts etc which does the core business logic, data access and updates.

Now I have around 50 external clients who would want services from my application tier. But my problem is client A might send a flat file request, client B might sends a comma separated file request, client C might be a soap request. The requests further may be either real time or batch. My services may have to send data back to the caller either in a flat file.., xml or a soap response or other formats. The response might also be either batch or real time.

1)Is there a way to standardize the interface for all these 50 clients accessing my WCF services ?

2) If an external client sends a flat file via FTP (intended to serve as input to my service), how do I get this flat file data to hit my service. (Assuming that the legacy system is not service based and hence the external client just sends a file and is not aware of any services of the new system)

View 1 Replies

Security :: Allow Clients To Login To Website And Connect To Specific Server Based On Login

Jul 5, 2010

We have created a windows application which is distributed amongst our clients. The application uses SQL Server 2008 as the back end and each client uses their own database on their own server. The databases are all exactly the same but each clients data is specific only to them.

We would like to offer our clients the ability to log-in to our website which would then login to their own database so that when they are out in the field they can perform similar tasks to what they can do with the windows app.Each of the clients databases has a user table containing their login details, permissions etc.

Our server is running on IIS and has SQL Server 2008 installed but it only contains our data and nothing of the clients.How should we go about this?

What I mean is do we need to make each client have an additional login to our main server which would then hold each clients individual connection strings etc which would then be used to connect to there specific database and then they would need to login again?? Seems like a nightmare for the user.

View 13 Replies

MVC :: Calling Action Methods Based On Specific Button Click?

Jun 29, 2010

In the create aspx page i have 2 buttons. One for creating the new customer and another one for searching the customer based on the customer last name. Now the issue is when i try to search the customer based on the last name the page is calling the create action method only, not the search action method. how to call a spicific action method from the buttons. I know it can be done using ajax post back but what i am looking at is to achive this in the normal post back itself.

View 3 Replies

WCF / ASMX :: Overloading Web Methods

Jan 6, 2011

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.

Source Error:

[Code]....
Stack Trace:
[Code]....

View 3 Replies

WCF / ASMX :: Use Asynchonous Web Methods?

Dec 23, 2010

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.

View 4 Replies

Asmx Not Allowing To Invoke Ws Methods?

Apr 1, 2011

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.

The web server is running windows 7 and IIS 6.

View 3 Replies

WCF / ASMX :: How To Get The List Of Methods Programatically

Nov 11, 2010

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?

View 3 Replies

Use Reflection In C# To List The Methods Of An .asmx?

Jul 8, 2010

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]....

View 6 Replies

AJAX :: Use Web Methods Without Using .asmx Files?

Feb 2, 2010

[WebMethod(EnableSession = true)]

View 5 Replies

WCF / ASMX :: Allow Web Methods To Be Call From Javascript

Jan 8, 2011

i have created a simple WCF webserivce and it is running at http://localhost:2699/WCFServiceClient/myService.svc

with method

[Code]....

i have tested it from a wcftestclient it is working fine.

but when i try to call this method from jquery, it doesn't response.

my jquery code

$.ajax({ type: "POST", url: "http://localhost:2699/WCFServiceClient/myService.svc/GetData", data: { 'value': 5 }, contentType: "application/json; charset=utf-8", dataType: "text/xml; charset=utf-8",
success: function (msg) { alert$(msg.d); }, error: function (e) { alert("Unavailable"); } }); }

View 1 Replies

WCF / ASMX :: Run Multiple Methods Within A Transaction?

Sep 24, 2010

I need to run 5 different WCF methods but within a transaction. Is this possible in WCF? How can I do this in WCf, if it's possible?

The WCF methods will be called from the web service client, which could be an ASP.Net app or Winfoms app.

View 1 Replies

WCF / ASMX :: Authenticate Web Methods In A Web Service?

Apr 1, 2011

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?

View 2 Replies

WCF / ASMX :: Multiple Web Methods In One Transaction?

Aug 20, 2010

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)

View 2 Replies

WCF / ASMX :: Returning Web Methods As Different Formats Based On Querystring?

Mar 23, 2010

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.

View 2 Replies

WCF / ASMX :: How To Validate Soap Request Before Reaching Web Methods

Jun 28, 2010

There is a web service exposed by Company A - cmpA, which is consumed be CmpB.

Requirement is:When request comes from comB, before reaching Web Method of cmpA, it should be validated by XML SCHEMA (.xsd).

How do I achive this,

View 1 Replies

C# - Methods With Nullable Types Not Working In ASMX Web Service Using GET

Mar 14, 2011

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!

View 1 Replies

Best Practice: General Asmx Data Loading Web-method Or Multi Web-methods

Apr 3, 2011

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!

View 3 Replies

How To Suppress Error Messages When Access Non-existent Web Methods On A .asmx Web Service

Dec 15, 2010

We have a customer who are using HP Web Inspect to test for vulnerabilities in our software.

The web inspect tool is complaining about about error messages being returned when a request such as the following is made [URL].

The ASP.Net framework returns a page with the following text content and a 500 status code.

System.IndexOutOfRangeException: Index was outside the bounds of the array.

[code]....

but the error seems not be an unhandled error and so neither 500 page is shown.

View 1 Replies

Using Extension Methods In Static Methods On Extended Classes?

Aug 16, 2010

I have an extension method as follows:

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()

View 1 Replies

Web Forms :: How To Change This Methods In To Use Dictionary Or Extension Methods

Jul 23, 2010

public class CacheHelper { /// <summary> /// Removes object with the specified key. /// </summary> /// <param name="key">The key.</param> [code]....

I have this methods for caching..I need to change this methods to use in aDictionary<string,object>

How do I need to change this code Because I am new to asp.net I am still learning..

View 12 Replies

WCF / ASMX :: Best Way To "ensure" That A Web Service Is Only Called From AJAX On A Specific ASPX Page?

Oct 26, 2010

I have an ASPX page which hosts a Custom Control. That custom control needs to call an ASMX web service. I would use a PageMethod, if the fact that I'm calling from within a Custom Control didn't preclude that. I'm looking for some guidance on the most effective way to try and lock down the ASMX call such that it will only succeed for my users calling it from my ASPX page - and not for anyone trying to call it from elsewhere. I've seen various ideas around session variables and so on.

View 5 Replies

Expose WebHttpBinding EndPoint In Framework 4.0?

Oct 2, 2010

I'm trying to expose a webHttpBinding EndPoint using Framework 4.0.

<endpoint address="web" binding="webHttpBinding" contract="MyContract"/>

However, when browsing using WFC Test Client, I see nothing. If I change my Framework target to 3.5, it works fine.

Is there something different in 4.0 to get this to work?

View 2 Replies

How To Get Classes To Expose The Same Shared / Static Method

Mar 4, 2010

I have a base class with several derived classes. I want all of my derived classes to have the same Public Shared (static) method with their own implementation. How do I do this?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved