.Net 4.0 WCF Service failing when passing parameters

I am trying to test a WCF service using the basichttpbinding endpoint from the WCF test client. I can test methods that I don't pass parameters to with no issue, but when I need to pass a parameter I get the following error:

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.

An error occurred while executing the command definition. See the inner exception for details.

Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at IErouter.GetClientSearch(String surname, String forename, String street, String postcode) at ErouterClient.GetClientSearch(String surname, String forename, String street, String postcode)

Due to the fact I can make calls to parameterless methods this error makes no sense to me.

public interface IErouter
    #region Client Search

    SelectClientSearch_Result[] GetClientSearch(
        string surname, string forename, string street, string postcode);


    #region Changes

    ChangeForBlackBerry[] GetClientChanges(string blackberryPin);

    bool AcceptChange(int changeId, string blackberryPin);

    bool AcknowledgeChange(int changeId, string blackberryPin);

    ChangeForBlackBerry[] GetManagerChangesForShiftType(string blackberryPin, 
        string date, int shiftTypeId);

    ClientDetailChangeViewModel GetClientDetailChange(int changeId);


    #region Client Details

    ClientDetailViewModel GetClientDetails(int clientId);

    SelectUserLevel_Result GetUserLevel(string blackberryPin);


    #region Useful Contacts

    SelectAdminCentreTelNo_Result[] GetAdminCentreTelNos();

    string GetDutyEmail();

    SelectDutyManager_Result[] GetDutyManagerTelNos();

    string GetGhaHandyTelNo();

    SelectHospitalNos_Result[] GetHospitalTelNos();

    string GetICTTelNo();

    string GetMAHMobileTelNo();

    SelectMyManagerNo_Result[] GetMyManagerTelNo(string blackberryPin);

    string GetNHSDirectTelNo();

    string GetOOHEmail();

    string GetOOHTelNo();

    string GetOperationsEmail();

    string GetOperationsTelNo();

    string GetOtherHandyPersonTelNo();

    SelectSWTelNos_Result[] GetSWTelNo();


    #region Gaurdian 24 Visit Monitoring

    string StartVisitMonitoring(int clientId, int activityDuration, 
        string activityText, string blackberryPin);

    string StopVisitMonitoring(int clientId, string activityId, 
        string blackberryPin);



It could be serialization error - check if you have [DataContract] or [Serializable] at your return class SelectClientSearch_Result.

It may be worth trying to add the following to the web.config:

        <add prefix="http://host:port"/>

If that doesn't work, you could try adding the above and removing the elements: <host></host> (idea from the last link I've linked)

Just adding the following to the web.config may help.

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />    

The sites I've read are:


One mentioned the WCF service behaving exactly like an ASMX service which is why I thought it may be relevant.


May be worth a quick read? http://support.microsoft.com/kb/958478

Need Your Help

How to subset xts object based upon condition

r xts

I have a xts object, now I would like to select all index rows except for a certain period.

Getting Nullpointer at MyAdapter.getView,how to fix?

android textview android-adapter null-pointer

I am trying to add images in navigation drawer, i placed it in the drawable folder with 48*48 size, my string array the string array is in string.xml,

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.