internal static void ExportWsdlEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext endpointContext,
                                                string wsdlTransportUri, EndpointAddress address, AddressingVersion addressingVersion)
        {
            if (exporter == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
            }

            if (endpointContext == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");
            }

            // Set SoapBinding Transport URI
#pragma warning suppress 56506 // [....], these properties cannot be null in this context
            BindingElementCollection bindingElements = endpointContext.Endpoint.Binding.CreateBindingElements();
            if (wsdlTransportUri != null)
            {
                WsdlNS.SoapBinding soapBinding = SoapHelper.GetOrCreateSoapBinding(endpointContext, exporter);

                if (soapBinding != null)
                {
                    soapBinding.Transport = wsdlTransportUri;
                }
            }

            if (endpointContext.WsdlPort != null)
            {
                WsdlExporter.WSAddressingHelper.AddAddressToWsdlPort(endpointContext.WsdlPort, address, addressingVersion);
            }
        }
Ejemplo n.º 2
0
 internal static void ExportWsdlEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext endpointContext, string wsdlTransportUri, AddressingVersion addressingVersion)
 {
     if (exporter == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
     }
     if (endpointContext == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");
     }
     endpointContext.Endpoint.Binding.CreateBindingElements();
     if (wsdlTransportUri != null)
     {
         SoapBinding orCreateSoapBinding = SoapHelper.GetOrCreateSoapBinding(endpointContext, exporter);
         if (orCreateSoapBinding != null)
         {
             orCreateSoapBinding.Transport = wsdlTransportUri;
         }
     }
     if (endpointContext.WsdlPort != null)
     {
         WsdlExporter.WSAddressingHelper.AddAddressToWsdlPort(endpointContext.WsdlPort, endpointContext.Endpoint.Address, addressingVersion);
     }
 }