20 Ağustos 2021 Cuma

GetQueryString

  public static string GetQueryString(this object obj)
        {
            var properties = from p in obj.GetType().GetProperties()
                             where p.GetValue(obj, null) != null
                             select p.Name + "=" + HttpUtility.UrlEncode(p.GetValue(obj, null).ToString());

            return String.Join("&", properties.ToArray());
        }

6 Mayıs 2021 Perşembe

Sap WSDL Basic Auth

  private static Z_PPGEN_HMLOG_PLAKAClient MyBasicConfiguredService()
        {
            BasicHttpBinding basicHttpBinding = new BasicHttpBinding();
            basicHttpBinding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;//mandatory
            basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;//mandatory

            EndpointAddress endpoint = new EndpointAddress(Url);

            var client = new Z_PPGEN_HMLOG_PLAKAClient(basicHttpBinding, endpoint);

            client.ClientCredentials.UserName.UserName = UserName;
            client.ClientCredentials.UserName.Password = Password;

            return client;
        }

.net 6 mapget kullanımı

 app.UseEndpoints(endpoints => {     endpoints.MapGet("/", async context =>     {         var response = JsonConvert.Seriali...