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

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

NetMsmqBinding sees my contract as TwoWay when it is not

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :WCF

I getting an exception:Service cannot be started. System.InvalidOperationException: Contract requires TwoWay (either request-reply or duplex), but Binding 'NetMsmqBinding' doesn't support it or isn't configured properly to support it. My OperationContract states IsOneWay = true.  Below are my contracts and configuration.

[WCF::ServiceContract(SessionMode = WCF::SessionMode.NotAllowed)]
    public partial interface IJobSaleOrderQueue
        [WCF::OperationContract(IsOneWay = true)]
        void SubmitJobSaleOrderQueue(ProductionPlanSvc.WCF.MessageContracts.SubmitJobSaleOrderQueueRequest request);


<service name="ProductionPlanSvc.WCF.ServiceImplementation.JobSaleOrderQueueService" behaviorConfiguration="Default">
            <add baseAddress="net.msmq://localhost/private/JobSaleOrderTransQueue"/>


View Complete Post

More Related Resource Links

An endpoint configuration section for contract 'xxx' could not be loaded because more than one end



I'm trying to test calling a webservice, I've found several free ones on http://webserviceshare.com, but none of them work for me.  Some of them give example calling code in C# which I've translated to VB.NET, they're typically just two to four lines, I don't think I've translated them incorrectly.

On that I've tried is US Zip Validator.  I added a Service Reference to http://www.webservicemart.com/uszip.asmx?WSDL, called ZipService.

I then call it like so:

            Dim myZipService As ZipService.USZipSoapClient = New ZipService.USZipSoapClient()
            Dim myCity As String = myZipService.ValidateZip("27707")

I get the following error on the first line of code:

"An endpoint configuration section for contract 'ZipService.USZipSoap' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name."

A page with information on this web service (including C# source code) is at:


Could not find default endpoint element that references contract 'CurrencyProxy.CurrencyServiceSoap



I created 2 projects in my solution:

  1. Classic asp.net web service (asmx)
  2. Class library project which references service
  3. web site project which references class library project
  4. Windows app project which references service.

Both projects were created in 3.5 framework and in Visual Studio 2008 Beta 2.

I added web service reference to Class library project. When it asked for namespace I typed "CurrencyProxy". Projects build ok, but when I run web app, Class library throws an error: Could not find default endpoint element that references contract 'CurrencyProxy.CurrencyServiceSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

I believe it has something to do with app.config in Class library project. Here is part from app.config:

<binding name="CurrencyServiceSoap" closeTimeout=

Contract-First Web Services: Schema-based Development with Windows Communication Foundation


Schema- first contract-first modeling of Web Services gives you the ability to model your contracts with an XML-centric mindset. This process keeps you focused on universally acceptable types and the hierarchical data structures that can be represented in XML.

Christian Weyer, Buddhike de Silva

MSDN Magazine October 2009

Class To Contract: Enrich Your XML Serialization With Schema Providers In The .NET Framework


The Microsoft .NET Framework 1.x provided minimal options for mapping classes to schemas and serializing objects to XML documents, making this sort of mapping quite a challenge. The .NET Framework 2.0 changes all this with Schema providers and the IXmlSerializable interface.

Keith Pijanowski

MSDN Magazine June 2006

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

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.    

Duplex contract between web client and server?

Hi, Can duplex contract be implemented between web client and server using http as a transport?   Thanks jagaurg

data contract code generation for large/complex schema (HR-XML/OAGIS) - is there an alternative?

Hello, and thank you for reading.I am implementing a Service based on a predefined specification (HR-XML 3.0). As such, I am starting with the schema, and working my way back to code. There are a number of large Schema documents (which import yet more Schema documents) related to my implementation, provided by this specification.I am able to generate code using xsd.exe, by supplying the "main" and "supporting" xsd files as arguments. But there are several issues, and I am wondering if this is the right approach.- there are litterally hundreds of classes - the code file is half a meg in size- duplicate classes (ex. Type, Type1 - which both represent the same type)- there are classes declared as inheriting from a base class, but that base class is not generated/definedI understand that there are limitations to the types of Schema supported by svcutil.exe/xsd.exe when targeting the DataContractSerializer and even XmlSerializer. My question is two-fold:1. Are code generation "issues" fairly common when dealing with larger, modular xsd files? Has anyone had success with generating data contracts from OAGIS or HR-XML schema?2. Given the above issues, are there better approaches to this task, avoiding generating code and working with concrete objects? Does it make better sence to read and compose a SOAP message directly, while sti

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

SvcUtil-generated code or shared interface/data contract assembly?

If you control both service and client is there any benefit in using svcutil.exe to generate client proxies? Or is it better to share interface/data contract assembly between client and service?

How can i do TwoWay Binding between listbox and datatable

I've bound my listbox to a datatable using the following code: Me.TasksListBox.DataContext = dt The datatemplate in the listbox is a collection of controls like textboxes and comboboxes, each of which is bound to a column in the datatable. The data loads fine in the listbox. As the users modify the data in the listbox by modifying combo boxes , textboxes of items in the listbox , i want the changes to propogate to datatable dt so i can save the values in the database. I am unable to figure out how this can be done. Thanks  

TwoWay Binding Datagrid To WCF Service?

Hello, i tried to bind a DataGrid in TwoWay Mode to a WCF Service. The Data get displayed but changes in DataGrid dont affect the Database, from which the WCF Service is getting the data.   I hope someone can help me... Thank you.     My Szenario: I have a WCF Service which offers exactly one Function which return a custom class. The custom class inherits from INotifyPropertyChanged and has only one DataMember, an ObservableList with my DB Entitys. //Service.svc.cs static testdatenEntities _context = null; private static testdatenEntities Get_context() { if (_context == null) { _context = new testdatenEntities(); } return _context; } public customData GetDataFromADO() { var _context = Get_context(); var result = (from lief in _context.LIEF_INFO.AsQueryable() orderby lief.LNR select lief).Skip(50).Take(50); ObservableCollection<LIEF_INFO> _ocol = new ObservableCollection<LIEF_INFO>(result); customData customdata = new customData() { List = _ocol }; return customdata; } //IService.cs [DataContract] public class customData : INotifyPropertyChanged { ObservableCollection<LIEF_INFO> _ocol = new ObservableCollection<LIEF_INFO>(); [DataMember] public ObservableCollection<LIEF_INFO> List {

Query Correlation faliure using custom Request/Reply Message Contract classes.

Hi,I have a service which is correlated by a Guid query. When I'm using designer created Message Content/Parameters feature for message definition, everithing working lika a charm. But If I define custom [MessageContract] Request/Reply classes (where request class has Guid SvcUID property for correlation), and choose'em as Message Content in the designer with proper CorrelatesOn definition of course, I have got a service exception about correlation query faliure. Have you folks tried to apply your custom [MessageContract] classes for correlated communication?

Single class with service and callback contract

Can a single class implement service and callback contract. Thanks-= JL =-

WCF Fault Contract for Collection

In WCF passing collection of order detail to get price and stock in Request. I expecting response as each items Price and Stock if any item is not available, Fault contract message should appear for that Item only. Remaining Items should get results (Price and Stock). Please suggest me to achieve this senario?   Thanks in Advance, Senthil.

Two different services, same callback contract

I have two different service using the same callback contract.  Is that permitted?  I am getting weird behavoior.  When a client subscribes to the two callbacks, the messages seem to come back to the wrong callback.Batman
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