Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6140097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:04:27+00:00 2026-05-23T18:04:27+00:00

I created WCF service application there are no errors until I run WcfTestClient .

  • 0

I created WCF service application there are no errors until I run WcfTestClient. It requires IMetadataExchange to be configured.

How to configure IMetadataExchange or avoid of its usage?

Error:

————————— Microsoft WCF Test Client
————————— The contract ‘IMetadataExchange’ in client configuration does not match the name in service contract, or there is
no valid method in this contract. To recover, please manually correct
client configuration.

Or restore to default configuration.

Or check “Always regenerate config when launching services” in the
Tools -> Options menu, then refresh the service.

App.config

<system.serviceModel>
    <services>
      <service name="WcfCrmService.PermitTypesService">
        <endpoint address="" binding="wsHttpBinding" contract="WcfCrmService.IPermitTypesService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="WcfCrmService.IPermitTypesService" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfCrmService/Mex/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- To receive exception details in faults for debugging purposes, 
          set the value below to true.  Set to false before deployment 
          to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

PermitTypes

using System;
using System.Runtime.Serialization;

namespace WcfCrmService
{
    namespace TestService
    {
        [DataContract]
        public class PermitTypes
        {
            [DataMember]
            public Guid PermitTypesId;

            [DataMember]
            public String PermitName;

            [DataMember]
            public String PermitForm;

            [DataMember]
            public String PermitView;
        }
    }
}

IPermitTypesService

using System.Collections.Generic;
using System.ServiceModel;
using WcfCrmService.TestService;

namespace WcfCrmService
{
    [ServiceContract]
    public interface IPermitTypesService
    {
        [OperationContract]
        void SubmitPermitTypes(PermitTypes permit);

        [OperationContract]
        List<PermitTypes> GetPermitTypes();

        [OperationContract]
        void DeletePermitTypes(string id);
    }
}

PermitTypesService

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.ServiceModel;
using System.ServiceModel.Description;
using Microsoft.Crm.Sdk.SWSE;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using WcfCrmService.TestService;
namespace WcfCrmService
{
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
    public class PermitTypesService : IPermitTypesService
    {
        public void SubmitPermitTypes(PermitTypes permit)
        {
            // Create records
        }
        public List<PermitTypes> GetPermitTypes()
        {
            // return Results
        }
        public void DeletePermitTypes(string id)
        {
            // Remove items
        }
    }
}

Service XML

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <s:Header>
    <a:Action s:mustUnderstand="1" u:Id="_2">http://tempuri.org/IPermitTypesService/GetPermitTypesResponse</a:Action>
    <a:RelatesTo u:Id="_3">urn:uuid:6f8c2229-da22-4ea1-b0df-e760bf51af6d</a:RelatesTo>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <u:Timestamp u:Id="uuid-090f17e6-f7a7-4e9c-8881-d19571706129-17">
        <u:Created>2011-07-15T10:35:14.132Z</u:Created>
        <u:Expires>2011-07-15T10:40:14.132Z</u:Expires>
      </u:Timestamp>
      <c:DerivedKeyToken u:Id="uuid-090f17e6-f7a7-4e9c-8881-d19571706129-7" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc">
        <o:SecurityTokenReference>
          <o:Reference URI="urn:uuid:1716f576-883e-475c-9b56-4accac413b66" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" />
        </o:SecurityTokenReference>
        <c:Offset>0</c:Offset>
        <c:Length>24</c:Length>
        <c:Nonce>GAplsFZPK8LsfnWQDwrTkQ==</c:Nonce>
      </c:DerivedKeyToken>
      <c:DerivedKeyToken u:Id="uuid-090f17e6-f7a7-4e9c-8881-d19571706129-8" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc">
        <o:SecurityTokenReference>
          <o:Reference URI="urn:uuid:1716f576-883e-475c-9b56-4accac413b66" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct" />
        </o:SecurityTokenReference>
        <c:Nonce>xwL0WRp3kTTqjzEwwFnA3A==</c:Nonce>
      </c:DerivedKeyToken>
      <e:ReferenceList xmlns:e="http://www.w3.org/2001/04/xmlenc#">
        <e:DataReference URI="#_1" />
        <e:DataReference URI="#_4" />
      </e:ReferenceList>
      <e:EncryptedData Id="_4" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
        <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
        <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
          <o:SecurityTokenReference>
            <o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/dk" URI="#uuid-090f17e6-f7a7-4e9c-8881-d19571706129-8" />
          </o:SecurityTokenReference>
        </KeyInfo>
        <e:CipherData>
          <e:CipherValue>CIPHERDATAK</e:CipherValue>
        </e:CipherData>
      </e:EncryptedData>
    </o:Security>
  </s:Header>
  <s:Body u:Id="_0">
    <GetPermitTypesResponse xmlns="http://tempuri.org/">
      <GetPermitTypesResult xmlns:a="http://schemas.datacontract.org/2004/07/WcfCrmService.TestService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
        <a:PermitTypes>
          <a:PermitForm>TESTPERMIT_FORM</a:PermitForm>
          <a:PermitName>TESTPERMIT_NAME</a:PermitName>
          <a:PermitTypesId>d81a9ccd-bbae-e011-9b4f-bcaec545c264</a:PermitTypesId>
          <a:PermitView>TESTPERMIT_VIEW</a:PermitView>
        </a:PermitTypes>
        <a:PermitTypes>
          <a:PermitForm>BcisCertificate</a:PermitForm>
          <a:PermitName>Сертификат соответствия БЦИС</a:PermitName>
          <a:PermitTypesId>167ac5ea-51a9-e011-9c96-bcaec545c264</a:PermitTypesId>
          <a:PermitView>BcisCertificateView</a:PermitView>
        </a:PermitTypes>
        <a:PermitTypes>
          <a:PermitForm>DLOReferenceForm</a:PermitForm>
          <a:PermitName>Справка ДЛО</a:PermitName>
          <a:PermitTypesId>16579d03-52a9-e011-9c96-bcaec545c264</a:PermitTypesId>
          <a:PermitView>DLOReferenceView</a:PermitView>
        </a:PermitTypes>
      </GetPermitTypesResult>
    </GetPermitTypesResponse>
  </s:Body>
</s:Envelope>

Sultan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:04:27+00:00Added an answer on May 23, 2026 at 6:04 pm

    This here in your configuration is definitely wrong:

    <endpoint address="mex" binding="mexHttpBinding" contract="WcfCrmService.IPermitTypesService" />
    

    A MEX endpoint for metadata exchange must have the WCF built-in contract IMetadataExchange and not your own service contract.

    Try using this:

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    

    Does this work now?? The WCF Test Client would use the MEX endpoint to learn about your service – if you had a wrong service contract in there, the Test Client certainly wouldn’t work….

    Update: your choice of a base address also is a bit strange:

    <baseAddresses>
       <add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfCrmService/Mex/" />
    </baseAddresses>
    

    This mean: your actual service is reachable at:

    http://localhost:8732/Design_Time_Addresses/WcfCrmService/Mex/
    

    while your MEX endpoint is reached at:

    http://localhost:8732/Design_Time_Addresses/WcfCrmService/Mex/mex/
    

    I would recommend using a better/more meaningful base address for the service and just add mex to the end of the MEX endpoint:

    <baseAddresses>
       <add baseAddress="http://localhost:8732/Services/WcfCrmService/" />
    </baseAddresses>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created just the most basic WCF Service Application to do some prototyping, but
I just created a new WCF Service Application project in VS2010 (Premium), and it
I have a WCF service hosted at IIS7 web application. It's created by a
Created .NET WCF service, tested it - works. Generated schemas from Data and service
I created a wcf service based on ServiceHostFactory, and i'm hosting it in IIS6.
I created a WCF service that uses TagLib# ( http://developer.novell.com/wiki/index.php/TagLib_Sharp ) which relies on
I created a WCF service (.NET 3.5) that grabs data from a db and
I've created a WCF service and when I browse to the endpoint I get
I’ve just created a WCF service/client and it all works fine when running on
I have created a WCF service for uploading images , which accepts System.IO.Stream as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.