简体   繁体   中英

WCF Service Generated WSDL

I have an WCF service createt with visual Studio. The generated WSDL has a part I don't want, but I don't know where it comes from.

-<wsdl:service name="AdfsService">
-<wsdl:port name="CustomBinding_IAdfsService" binding="tns:CustomBinding_IAdfsService">

<soap12:address location="https://localhost/AdCustomerService/AdfsService.svc"/>


-<wsa10:EndpointReference>

<wsa10:Address>https://localhost/AdCustomerService/AdfsService.svc</wsa10:Address>

</wsa10:EndpointReference>

</wsdl:port>

</wsdl:service>

What I need to remove is:

-<wsa10:EndpointReference>

<wsa10:Address>https://localhost/AdCustomerService/AdfsService.svc</wsa10:Address>

</wsa10:EndpointReference>

Here is my Webconfig:

    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>


      <customBinding>
        <binding name="CustomTransportSecurity">
          <transactionFlow />
          <textMessageEncoding />
          <httpsTransport />
        </binding>
      </customBinding>      
    </bindings>    


    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https"/>
    </protocolMapping> 

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false"/>

    <services>
      <service name="webservices.portalx.AdfsService">
        <endpoint address="" contract="webservices.portalx.IAdfsService" 
                  bindingNamespace="webservices.portalx" binding="customBinding"
                  bindingConfiguration ="CustomTransportSecurity"/>
        <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpsBinding"/>
      </service>
    </services>

  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="ApplicationInsightsWebTracking"/>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"
        preCondition="managedHandler"/>
    </modules>

    <directoryBrowse enabled="true"/>
    <validation validateIntegratedModeConfiguration="false"/>    
  </system.webServer>

Can anyone point me into a direction to look for? I Tryed googleing it but dindn't find any helpful links.

That is because of your custom configuration, from what I have tested as I was very interested suppose I defined and Endpoint like this:

<endpoint address="" binding="customBinding" bindingConfiguration="x" contract="interfaceContract">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>

Then define the custom binding as following:

<customBinding>
    <binding name="x"  openTimeout="00:00:10" >
      <binaryMessageEncoding/>
      <httpsTransport/>
    </binding>
  </customBinding>

You will see something like this after service hosted:

    <wsa10:EndpointReference>
      <wsa10:Address>https://localhost:2061/PCM/Exam.svc</wsa10:Address>
      <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
      <Dns>localhost</Dns>
      </Identity>
    </wsa10:EndpointReference>

in the other side when I defined my endpoint service like this without custom binding:

 <endpoint address="" binding="basicHttpBinding" contract="MARCO.SOA.PCMServiceLib.IExamService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>

basic binding like:

<basicHttpBinding>
    <binding allowCookies="true" openTimeout="00:00:10" maxReceivedMessageSize="2000000000" >
      <readerQuotas maxDepth="32" maxArrayLength="2000000000" maxStringContentLength="2000000000" />
      <security mode="None" />
    </binding>
  </basicHttpBinding>

there is no EndPointReference in wsdl . I think there is EndPointRefrence for another protocol like net.tcp and net.pipe in wsdl by default when you have defined EndPoint like:

<endpoint address="" binding="netTcpBinding" contract="interfaceContract">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="" binding="netNamedPipeBinding" contract="interfaceContract" />

hope this will give you the clue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM