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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to access methods in one service contract with different bindings?

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :WCF


Here i explain my exact problem. I have one service contract.

 public interface IParcel
 ParcelList GetAllParcelData(string countyId, string year, string parcelId);
 ParcelList GetParcelDataByParcelId(string parcelId);
 [WebInvoke(UriTemplate = "/Search/", RequestFormat = WebMessageFormat.Json,
  ResponseFormat = WebMessageFormat.Json)]
 SearchParcelList GetSearchParcelDetails(SearchParcel parcelNumbers);

My requirement is, i have to make "GetAllParcelData" method access by using wsHttpBinding,  "GetParcelDataByParcelId" using some other binding like net.tcp.binding and "GetSearchParcelDetails" using webHttpBinding. This one i have to make restful method.

means the methods inside one service contact have to used different bindings to access.

finally, i need to know is this type secnario possible. if yes explained with example.

Thanks in advance.......

View Complete Post

More Related Resource Links

Allow Multiple Bindings for One Service Contract


OK. For the purpose of this post, I only have one service contract. The user needs to be able to authenticate using either a) Active Directory (basicHttpBinding), or b) Username/Password (customBinding). Configuring this seems to be pretty straight forward. I just created two services with the same contract. Here is my server side config in its entirety:

<?xml version="1.0" encoding="utf-8"?>
<!-- Services.Service.endpoint.endpoint.dns should be something other than "localhost"-->
<!-- behaviors.serviceBehaviors.serviceCredentials.serviceCertificate.findValue should match-->
<!-- Notes on setting up these services: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3557200&SiteID=1-->

Service Station: WCF Bindings In Depth


The WCF programming model makes it easy to configure services with a variety of wire formats and message protocols, thanks to binding.

Aaron Skonnard

MSDN Magazine July 2007

Service Station: Techniques for Contract-First Development


In my May 2005 column, I discussed contract-first development and appropriate times to use it (see Service Station: Contract-First Service Development). In this second part, I'm going to focus on some techniques for contract-first development within the ASMX framework.

Aaron Skonnard

MSDN Magazine June 2005

Service Station: Contract-First Service Development


In one of my previous columns on Service Orientation (SO), I introduced the concept of "contract-first" service development (see Service Station: SOA: More Integration, Less Renovation). Over the next two installments of this column, I'm going to cover the topic in depth.

Aaron Skonnard

MSDN Magazine May 2005

Access To Web Service !


Hello ,

I have an Web service,that is call with jquery .

now i neccessary limit access to it .

for Example if everybody type address or ... show an "Access denied" text ...

in fact only my site can call web service and client not allow to call it .

please help me , its very Necessary ...

thanks a lot

is there any impact of using static methods in Business Access layer in 3 tier applciation


is there any impact of using static methods in Business Access layer in 3 tier applciation,

Please suggest me what are the best practices and standards

WCF Needs? How to Communicate Multiple Contract via Single Service?

why it needs.   i have many business objects how could i serve to my web application via single service.   i have nearly 500 different business objects. how could contract implement into client web applicatoin.    

With Anonymous access disabled, is there any way to use an AJAX-enabled WCF Service?

I have a website where anonymous access is disabled but I want to user an ajax-enabled WCF service. Configuring the service's binding security to use "TransportCredentialOnly" with clientCredentialType="Windows" seems like the obvious thing to do; indeed, many posts in various places suggest this approach. Unfortunately, however, it doesn't work. I always get the error "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service." How can I configure the service to function correctly. I'm running IIS 7.5 with .Net framework 4.0. Thanks.

Access denied to Search Service Application

I just "upgraded" my installation of SharePoint 2010 Foundation with Search Server Express 2010.  During the installation, I was able to access and configure the Search Service Application. However, a day later, I cannot access the application management page: I get an access denied error.  I am the farm administrator, so supposedly I am supposed to have access to the management page.  I've also tried adding my login to the "Full Control" group of the Search Application; it gives me the same error.  It appears that the only account that can access the administration page is the service/system account.  Obviously this would not be ideal. I've tried looking around for logs to see if anything is amiss, but there appears to be nothing logged. What gives?  How do I fix it?

WCF Service Unable to Access Personal Certificate Store Unless Service Account is Logged In

I created a WCF service that has a method which makes a call to a SOAP web service over the internet. In order to make a call to the SOAP web service, it requires that an X.509 certificate be sent with the HttpWebRequest. The X.509 certificates are loaded in the Personal and Trusted Certificate store of the account which the service is running under. When the service account is logged into the server, everything works just fine. However, when the service account is not physically logged onto the server, it has problems loading up the X.509 certificate and fails authentication when trying to make the HttpWebRequest. I am new to WCF services so I don't even know where to start looking. Can anyone please help? Thanks in advance.

Search Server Express 2010 - Access Denied when attempting to manage Search Service Application or P

I first noticed this error with the Search Service Application when I was no longer able to use the search portal, but have since noticed the issue with the PowerPoint Service Application.  When I navigate in Central Administration to either the "Farm Search Administration" or the "Manage service applications" pages and attempt to manage the "Search Service Application", I get this error: Error: Access Denied  Current User You are currently signed in as:  WHEELERS\MyUserName   Sign in as a different user    I have tried removing the service application and re-adding it, changing the application pool to running under an existing application pool as the farm administrator, as another application pool with the same identity as the primary web application, and as another application pool running under the SP-SearchService identity. The big recent change with SharePoint, aside from fixing the previous issue where I was incorrectly using CNAMEs with Kerberos, was to switch the main web application to claims authentication. That site correctly works with claims based authentication and Kerberos.

separating service level data from business data in servcie contract

Hi I have read that service level data (like requestId, client name etc. required for tracing/auditing) should be separated from business data(required for actual business operation) ie. differencing "Message Header" from "message payload". When we say 'separation", does that mean service level data should not be defined/declared in my contract class. If so how clients will know what header info they have to pass? I can't enforce header info as part of my contract. i think http://blogs.microsoft.co.il/blogs/bursteg/archive/2006/04/23/141.aspx this is based on assumption that clients are aware what they have to pass in header. Regardssinghhome

Error while invoking wcf service and running its methods

Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or refreshing the service.    I am using a wcf service with some methods in it called by some layers wherein i am putting all my business logic.While invoking the service from wcftestclient  and when running few methods i am getting this error . I am getting output for some methods in the same service but for some other methods i am getting this error . I am using LINQ in the methods.    My solution has number of projects .For running the service ,i am right clicking on the project and viewing in the browser as i cannot build whole solution as i have few errors in some unit test projects.       As i am getting output for some methods ,this is definetly not about starting the service .  

Not able to access Class methods when deployed on a remote server?

I have a web service project. In the project I have a class named "Piper"In testing the web service in localhost mode in the VS IDE, I can access membersof the class, such as my method "Proceed" and property "Comber" The problem I am having is that when the web service is deployed to the serverin staging, or the deployment server, I am not able to access any methods of my class. Onlythe properties. This is very strange? As they are both public and I can access them when I run the project in local host in the IDE. Does anyone know what the problem might be?Here is a simplified example of my class. Public Class Piper Public Sub Proceed() End Sub Public Property Comber() As Boolean  Get   Return True  End Get  Set(ByVal value As Boolean)       _comber = value  End SetEnd Property End Class

Web service authentiation when mixed authentication methods are used

I am trying to pull data from the list.asmx web service from a console application. I am using clams based authentication, and whenever only integrated Windows Authentiation is checked everything works fine. Whenever I also check Enable Forms Based Authentication I start getting an Acccess is denied error when I try to connect to the service. I can login successfully using FBA so I don't think the problem is caused by the FBA configuration. Does anyone have any ideas to what might be causing this?

Need help: "Adding Parameterized Methods to the Data Access Layer"

Hi all, em all new in C# and .NET.I am following this tutorial: http://www.asp.net/data-access/tutorials/creating-a-data-access-layer-csAnd i am at step 3: Adding Parameterized Methods to the Data Access Layer - i have No problems in getting out all information from my database.But when i try to get a specific item by CategoryID i get a Error.This is what i type in my Query in the table adapter:SELECT     ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, DiscontinuedFROM         ProductsWHERE CategoryID = @CategoryIDHere is the error i get when i click finish:The wizard detected the following problems when configuring TableAdapter Query "FillByCategoryID":Details:             Generated SELECT statement.              Error in WHERE clause near '@'.              Unable to parse query text.Can anyone help me with this problem?Someone who knows what i am doing wrong?Thanks

web service access from javascript

Hi,I am new to webservice accessing from javascript.I call a webmethod from javascript which returns a string array. whith this array i bind a dropdown list at client. At dropdownList selectedIndexchanged event I found there is no item in DropDownList. Is there any way how to bind the DropDownList using webMethod so that on postback i can get the dropdowns item.
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