none
How to access Matadata as WSDL file for MEX endpoint for TcpNet binding with HttpGetEnabled=false RRS feed

  • Question

  • Hi WCF expert,

    I have set mex endpoint to tcpnet binding and set base address to net.tcp as below.

      <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8090/" />
                  </baseAddresses>
            </host>

     <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />

    I have seen several information on how to get wsdl for tcpnet but all are when httpGetEnabled=true. Can I get WSDL file if httpGetEnabled=false using uri like below one, if yes how.

    net.tcp://localhost/OneWay/OneWayOperation.svc/mex 

    Thanks,Mamta

    baseAddresses>

                <

    addbaseAddress="http://localhost:8090/"/>

    baseAddresses>

            </

    host>

    Tuesday, March 31, 2015 12:14 PM

Answers

  • Hi,

    For this situation, you could try to create a mexNetTcpBinding endpoint, set the contract on it to IMetadataExchange, and enable "serviceMetadata" in the service behavior:

    <services>
       <service
        name="MyService"
        behaviorConfiguration="myBehavior">
        <host>
         <baseAddresses>
          <add baseAddress="net.tcp://localhost:9000/MyService"/>
         </baseAddresses>
        </host>
        <endpoint
         name="netTcp"
         address=""
         binding="netTcpBinding"
         bindingConfiguration="secure"
         contract="IIMyService">
        </endpoint>
        <endpoint
         name="mexNetTcp"
         address="net.tcp://localhost:9001/CommMgr/mex"
         binding="mexTcpBinding"
         contract="IMetadataExchange">
        </endpoint>
       </service>
      </services>
      <behaviors>
       <serviceBehaviors>
        <behavior name="myBehavior">
         <serviceMetadata />
        </behavior>
       </serviceBehaviors>
      </behaviors>
    Regards


    Wednesday, April 1, 2015 10:19 AM
    Moderator