Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WS Security in .NetCore 2.0 #2605

Closed
Giolla opened this issue Feb 26, 2018 · 7 comments
Closed

WS Security in .NetCore 2.0 #2605

Giolla opened this issue Feb 26, 2018 · 7 comments
Milestone

Comments

@Giolla
Copy link

@Giolla Giolla commented Feb 26, 2018

Hi, i'm trying to implement following in .NetCore

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://siebel.com/CustomUI">
   <soapenv:Header> 
      <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"> 
         <wsse:UsernameToken xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility"> 
         <wsse:Username>XXXXXX</wsse:Username> 
         <wsse:Password Type="wsse:PasswordText">XXXXXX</wsse:Password> 
         </wsse:UsernameToken> 
      </wsse:Security> 
      <soapenv:Header/>

Above Xml works in SoapUI with no problem.

Endpoint address:

if ((endpointConfiguration == EndpointConfiguration.Some_Query))
 {
 return new System.ServiceModel.EndpointAddress("https://..someUrl../?
 SWEExtCmd=Execute&SWEExtSource=SecureWebService");
 }

Calling Client:

private QueryClient GetClient()
 {
 var uri = string.Format("https://..someUrl../?SWEExtCmd=Execute&UserName=
 {0}&Password={1}", userName, password);
 var client = new QueryClient(QueryClient.EndpointConfiguration.Some_Query, uri);

 client.ClientCredentials.UserName.UserName = getUserName;
 client.ClientCredentials.UserName.Password = getPassword;
 return client;
 }

When i imported WSDL with Microsoft WCF Web Service Reference Provider, endpoint configuration was defaulted to :

if ((endpointConfiguration == EndpointConfiguration.Some_Query))
 {
  System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
  result.Security.Transport.ClientCredentialType = 
  System.ServiceModel.HttpClientCredentialType.Basic;
  result.MaxBufferSize = int.MaxValue;
  result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
  result.MaxReceivedMessageSize = int.MaxValue;
  result.AllowCookies = true;
  result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
  return result;  
 }

Question: Should i be using BasicHttpBinding or BasicHttpsBinding? i tried both but i'm getting an error.

I'm getting

An error occurred while trying to process your request. This error indicates a problem with the configuration of this server and should be reported to the webmaster (along with any errors listed below). We apologize for the inconvenience.

no matter what i try

@zhenlan
Copy link
Member

@zhenlan zhenlan commented Mar 5, 2018

@Giolla WS security is not supported by WCF on .NET Core.

@zhenlan zhenlan added this to the S132 milestone Mar 5, 2018
@Lxiamail
Copy link
Member

@Lxiamail Lxiamail commented Mar 16, 2018

Please let us know if you have any additional idea.

@Lxiamail Lxiamail closed this Mar 16, 2018
@seamys
Copy link

@seamys seamys commented Jul 1, 2018

@zhenlan @Lxiamail
Is there has other solution?

@zhenlan
Copy link
Member

@zhenlan zhenlan commented Jul 2, 2018

@seamys Sorry for lacking of details. The issue was closed as it's mostly part of issue #31, which does not have a solution at this point. You can find more details in the discussion of #31.

@Srinivas289
Copy link

@Srinivas289 Srinivas289 commented Aug 14, 2019

@zhenlan Is there any solution ? I am in the same boat now.

@Srinivas289
Copy link

@Srinivas289 Srinivas289 commented Aug 14, 2019

@Giolla did you find any alternative solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants