title: Web Service hosted by SAP and consumed by a .NET Application
body: <p>I'm trying to setup an SAP Web Service that would be consumed by a .NET application.  Thinking it was simple, I had set the Service up in SAP to use HTTP.  I right-click on the "Service References" in the .NET Project Tree, and choose "Add Service Reference...", Enter the WSDL URL locally hosted on our servers, and press Go, then select the endpoint, then press OK.</p>
  
  <p>I opened up the app.config file to find that it says <code>&lt;httpsTransport&gt;</code> instead of <code>&lt;httpTransport&gt;</code>, although I set it up to use HTTP.</p>
  
  <pre><code>&lt;system.serviceModel&gt;
        &lt;bindings&gt;
             &lt;customBinding&gt;
                 &lt;binding name="ZHR_RECRUITNEW1"&gt;
                      &lt;!--WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'urn:sap-com:document:sap:soap:functions:mc-style':--&gt;
                      &lt;!--    &lt;wsdl:binding name='ZHR_RECRUITNEW'&gt;    --&gt;
                      &lt;!--        &lt;wsaw:UsingAddressing xmlns:wsaw="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;..&lt;/wsaw:UsingAddressing&gt;    --&gt;
                      &lt;!--        &lt;saptrnbnd:OptimizedXMLTransfer xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/"&gt;..&lt;/saptrnbnd:OptimizedXMLTransfer&gt;    --&gt;
                      &lt;!--        &lt;sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/"&gt;..&lt;/sapattahnd:Enabled&gt;    --&gt;
                      &lt;textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
                          messageVersion="Soap11" writeEncoding="utf-8"&gt;
                          &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                              maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
                      &lt;/textMessageEncoding&gt;
                      &lt;httpsTransport manualAddressing="false" maxBufferPoolSize="524288"
                          maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
                          bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                          keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
                          realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
                          useDefaultWebProxy="true" requireClientCertificate="false" /&gt;
                  &lt;/binding&gt;
              &lt;/customBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address="http://&lt;host&gt;:8000/sap/bc/srt/rfc/sap/zhr_recruitnew/300/zhr_recruitnew/zhr_recruitnew"
                  binding="customBinding" bindingConfiguration="ZHR_RECRUITNEW1"
                  contract="ServiceReference2.ZHR_RECRUITNEW" name="ZHR_RECRUITNEW1" /&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>So, for it to work "properly", I have to rename that xml tag from httpsTransport to httpTransport and remove the attribute requireClientCertificate="false"</p>
  
  <p>So, I go into SAP to set up the Service to use HTTPS, and then go back to the .NET project and re-add that service, to get this error message:</p>
  
  <pre><code>Could not establish trust relationship for the SSL/TLS secure channel with authority '&lt;host&gt;:&lt;portnumber&gt;'.
  </code></pre>
  
  <p>I'm curious as to whether that comment "WsdlImporter encountered unrecognized policy assertions" in the config file has to do anything with that info being misread from SAP</p>