Consuming Webservice : Client application : C#
up vote
2
down vote
favorite
Error:
"System.ServiceModel.FaultException: InvalidSecurity : error in
processing the WS-Security security header" ...
Could anyone help on this issue
public void CallServiceMNB()
{
ServiceReference1.SOAPCLIENT objMNB = new ServiceReference1.SOAPCLIENT();
ServiceReference1.SOAPCLIENTinput input = new ServiceReference1.SOAPCLIENTinput();
string Username = "xxx";
string Password = "xxxx";
objMNB.ClientCredentials.UserName.UserName = Username;
objMNB.ClientCredentials.UserName.Password = Password;
input.p_FROM_DATE = "01-01-2018";
input.p_JE_CATEGORY = "xxxx";
input.p_GROUP_ID = "";
input.p_JE_SOURCE = "YYYYYY";
input.p_LEDGER_NAME = "YYYYY";
input.p_TO_DATE = "31-12-2018";
try
{
objMNB.Open();
objMNB.GetGLDetails(input);
objMNB.Close();
}
catch (Exception Ex)
{
this.richTextBox1.Text = Ex.ToString();
objMNB.Close();
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="YYYYYY">
<!-- WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'http://gl.ws.apps.oracle.xxdof/': -->
<!-- <wsdl:binding name='YYYYYY'> -->
<!-- <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">..</sp:SupportingTokens> -->
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://XXXXX"
binding="customBinding" bindingConfiguration="YYYYYY"
contract="ServiceReference1.SOAPCLIENT" name="SOAPCLIENT" />
</client>
</system.serviceModel>
</configuration>
c# wcf soap ws-security
New contributor
|
show 2 more comments
up vote
2
down vote
favorite
Error:
"System.ServiceModel.FaultException: InvalidSecurity : error in
processing the WS-Security security header" ...
Could anyone help on this issue
public void CallServiceMNB()
{
ServiceReference1.SOAPCLIENT objMNB = new ServiceReference1.SOAPCLIENT();
ServiceReference1.SOAPCLIENTinput input = new ServiceReference1.SOAPCLIENTinput();
string Username = "xxx";
string Password = "xxxx";
objMNB.ClientCredentials.UserName.UserName = Username;
objMNB.ClientCredentials.UserName.Password = Password;
input.p_FROM_DATE = "01-01-2018";
input.p_JE_CATEGORY = "xxxx";
input.p_GROUP_ID = "";
input.p_JE_SOURCE = "YYYYYY";
input.p_LEDGER_NAME = "YYYYY";
input.p_TO_DATE = "31-12-2018";
try
{
objMNB.Open();
objMNB.GetGLDetails(input);
objMNB.Close();
}
catch (Exception Ex)
{
this.richTextBox1.Text = Ex.ToString();
objMNB.Close();
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="YYYYYY">
<!-- WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'http://gl.ws.apps.oracle.xxdof/': -->
<!-- <wsdl:binding name='YYYYYY'> -->
<!-- <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">..</sp:SupportingTokens> -->
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://XXXXX"
binding="customBinding" bindingConfiguration="YYYYYY"
contract="ServiceReference1.SOAPCLIENT" name="SOAPCLIENT" />
</client>
</system.serviceModel>
</configuration>
c# wcf soap ws-security
New contributor
yes Mr. Holterman... I provided the above-mentioned code and correct username and password!! I got the result in using SOAPUI(smartbear). In C# facing the security issue. Is any reference need to be added ??? kindly help
– Somu M
Nov 4 at 10:03
You are getting closer to an answerable question. It seems to be WCF, you should add that tag.
– Henk Holterman
Nov 4 at 10:19
The complete exception text might help. And post the WCF configurations. The C# part looks OK but most WCF happens in app.config .
– Henk Holterman
Nov 4 at 10:22
No Mr.Holterman. I am not using WCF just using a website to consume SOAP Webservice.
– Somu M
Nov 4 at 10:55
I see a lot of WCF though... And "WsdlImporter encountered unrecognized policy assertions" might be the start of your problems.
– Henk Holterman
Nov 4 at 11:05
|
show 2 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Error:
"System.ServiceModel.FaultException: InvalidSecurity : error in
processing the WS-Security security header" ...
Could anyone help on this issue
public void CallServiceMNB()
{
ServiceReference1.SOAPCLIENT objMNB = new ServiceReference1.SOAPCLIENT();
ServiceReference1.SOAPCLIENTinput input = new ServiceReference1.SOAPCLIENTinput();
string Username = "xxx";
string Password = "xxxx";
objMNB.ClientCredentials.UserName.UserName = Username;
objMNB.ClientCredentials.UserName.Password = Password;
input.p_FROM_DATE = "01-01-2018";
input.p_JE_CATEGORY = "xxxx";
input.p_GROUP_ID = "";
input.p_JE_SOURCE = "YYYYYY";
input.p_LEDGER_NAME = "YYYYY";
input.p_TO_DATE = "31-12-2018";
try
{
objMNB.Open();
objMNB.GetGLDetails(input);
objMNB.Close();
}
catch (Exception Ex)
{
this.richTextBox1.Text = Ex.ToString();
objMNB.Close();
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="YYYYYY">
<!-- WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'http://gl.ws.apps.oracle.xxdof/': -->
<!-- <wsdl:binding name='YYYYYY'> -->
<!-- <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">..</sp:SupportingTokens> -->
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://XXXXX"
binding="customBinding" bindingConfiguration="YYYYYY"
contract="ServiceReference1.SOAPCLIENT" name="SOAPCLIENT" />
</client>
</system.serviceModel>
</configuration>
c# wcf soap ws-security
New contributor
Error:
"System.ServiceModel.FaultException: InvalidSecurity : error in
processing the WS-Security security header" ...
Could anyone help on this issue
public void CallServiceMNB()
{
ServiceReference1.SOAPCLIENT objMNB = new ServiceReference1.SOAPCLIENT();
ServiceReference1.SOAPCLIENTinput input = new ServiceReference1.SOAPCLIENTinput();
string Username = "xxx";
string Password = "xxxx";
objMNB.ClientCredentials.UserName.UserName = Username;
objMNB.ClientCredentials.UserName.Password = Password;
input.p_FROM_DATE = "01-01-2018";
input.p_JE_CATEGORY = "xxxx";
input.p_GROUP_ID = "";
input.p_JE_SOURCE = "YYYYYY";
input.p_LEDGER_NAME = "YYYYY";
input.p_TO_DATE = "31-12-2018";
try
{
objMNB.Open();
objMNB.GetGLDetails(input);
objMNB.Close();
}
catch (Exception Ex)
{
this.richTextBox1.Text = Ex.ToString();
objMNB.Close();
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="YYYYYY">
<!-- WsdlImporter encountered unrecognized policy assertions in ServiceDescription 'http://gl.ws.apps.oracle.xxdof/': -->
<!-- <wsdl:binding name='YYYYYY'> -->
<!-- <sp:SupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">..</sp:SupportingTokens> -->
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://XXXXX"
binding="customBinding" bindingConfiguration="YYYYYY"
contract="ServiceReference1.SOAPCLIENT" name="SOAPCLIENT" />
</client>
</system.serviceModel>
</configuration>
c# wcf soap ws-security
c# wcf soap ws-security
New contributor
New contributor
edited Nov 4 at 10:59
Henk Holterman
206k22222393
206k22222393
New contributor
asked Nov 4 at 9:13
Somu M
92
92
New contributor
New contributor
yes Mr. Holterman... I provided the above-mentioned code and correct username and password!! I got the result in using SOAPUI(smartbear). In C# facing the security issue. Is any reference need to be added ??? kindly help
– Somu M
Nov 4 at 10:03
You are getting closer to an answerable question. It seems to be WCF, you should add that tag.
– Henk Holterman
Nov 4 at 10:19
The complete exception text might help. And post the WCF configurations. The C# part looks OK but most WCF happens in app.config .
– Henk Holterman
Nov 4 at 10:22
No Mr.Holterman. I am not using WCF just using a website to consume SOAP Webservice.
– Somu M
Nov 4 at 10:55
I see a lot of WCF though... And "WsdlImporter encountered unrecognized policy assertions" might be the start of your problems.
– Henk Holterman
Nov 4 at 11:05
|
show 2 more comments
yes Mr. Holterman... I provided the above-mentioned code and correct username and password!! I got the result in using SOAPUI(smartbear). In C# facing the security issue. Is any reference need to be added ??? kindly help
– Somu M
Nov 4 at 10:03
You are getting closer to an answerable question. It seems to be WCF, you should add that tag.
– Henk Holterman
Nov 4 at 10:19
The complete exception text might help. And post the WCF configurations. The C# part looks OK but most WCF happens in app.config .
– Henk Holterman
Nov 4 at 10:22
No Mr.Holterman. I am not using WCF just using a website to consume SOAP Webservice.
– Somu M
Nov 4 at 10:55
I see a lot of WCF though... And "WsdlImporter encountered unrecognized policy assertions" might be the start of your problems.
– Henk Holterman
Nov 4 at 11:05
yes Mr. Holterman... I provided the above-mentioned code and correct username and password!! I got the result in using SOAPUI(smartbear). In C# facing the security issue. Is any reference need to be added ??? kindly help
– Somu M
Nov 4 at 10:03
yes Mr. Holterman... I provided the above-mentioned code and correct username and password!! I got the result in using SOAPUI(smartbear). In C# facing the security issue. Is any reference need to be added ??? kindly help
– Somu M
Nov 4 at 10:03
You are getting closer to an answerable question. It seems to be WCF, you should add that tag.
– Henk Holterman
Nov 4 at 10:19
You are getting closer to an answerable question. It seems to be WCF, you should add that tag.
– Henk Holterman
Nov 4 at 10:19
The complete exception text might help. And post the WCF configurations. The C# part looks OK but most WCF happens in app.config .
– Henk Holterman
Nov 4 at 10:22
The complete exception text might help. And post the WCF configurations. The C# part looks OK but most WCF happens in app.config .
– Henk Holterman
Nov 4 at 10:22
No Mr.Holterman. I am not using WCF just using a website to consume SOAP Webservice.
– Somu M
Nov 4 at 10:55
No Mr.Holterman. I am not using WCF just using a website to consume SOAP Webservice.
– Somu M
Nov 4 at 10:55
I see a lot of WCF though... And "WsdlImporter encountered unrecognized policy assertions" might be the start of your problems.
– Henk Holterman
Nov 4 at 11:05
I see a lot of WCF though... And "WsdlImporter encountered unrecognized policy assertions" might be the start of your problems.
– Henk Holterman
Nov 4 at 11:05
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
The client credential depends on your SecurityBindingElement created in the Custom Binding hosting on the server.
https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.securitybindingelement?view=netframework-4.7.2
You should add token to the security header in accordance with the authentication security mode of the Custom binding.
For the BasicHttpBinding, you need not to provide the credential by default, while we need to provide Windows account in Wshttpbinding by default.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/programming-wcf-security
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The client credential depends on your SecurityBindingElement created in the Custom Binding hosting on the server.
https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.securitybindingelement?view=netframework-4.7.2
You should add token to the security header in accordance with the authentication security mode of the Custom binding.
For the BasicHttpBinding, you need not to provide the credential by default, while we need to provide Windows account in Wshttpbinding by default.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/programming-wcf-security
add a comment |
up vote
1
down vote
The client credential depends on your SecurityBindingElement created in the Custom Binding hosting on the server.
https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.securitybindingelement?view=netframework-4.7.2
You should add token to the security header in accordance with the authentication security mode of the Custom binding.
For the BasicHttpBinding, you need not to provide the credential by default, while we need to provide Windows account in Wshttpbinding by default.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/programming-wcf-security
add a comment |
up vote
1
down vote
up vote
1
down vote
The client credential depends on your SecurityBindingElement created in the Custom Binding hosting on the server.
https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.securitybindingelement?view=netframework-4.7.2
You should add token to the security header in accordance with the authentication security mode of the Custom binding.
For the BasicHttpBinding, you need not to provide the credential by default, while we need to provide Windows account in Wshttpbinding by default.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/programming-wcf-security
The client credential depends on your SecurityBindingElement created in the Custom Binding hosting on the server.
https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.securitybindingelement?view=netframework-4.7.2
You should add token to the security header in accordance with the authentication security mode of the Custom binding.
For the BasicHttpBinding, you need not to provide the credential by default, while we need to provide Windows account in Wshttpbinding by default.
https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/programming-wcf-security
answered 2 days ago
Abraham Qian
3566
3566
add a comment |
add a comment |
Somu M is a new contributor. Be nice, and check out our Code of Conduct.
Somu M is a new contributor. Be nice, and check out our Code of Conduct.
Somu M is a new contributor. Be nice, and check out our Code of Conduct.
Somu M is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53139255%2fconsuming-webservice-client-application-c-sharp%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
yes Mr. Holterman... I provided the above-mentioned code and correct username and password!! I got the result in using SOAPUI(smartbear). In C# facing the security issue. Is any reference need to be added ??? kindly help
– Somu M
Nov 4 at 10:03
You are getting closer to an answerable question. It seems to be WCF, you should add that tag.
– Henk Holterman
Nov 4 at 10:19
The complete exception text might help. And post the WCF configurations. The C# part looks OK but most WCF happens in app.config .
– Henk Holterman
Nov 4 at 10:22
No Mr.Holterman. I am not using WCF just using a website to consume SOAP Webservice.
– Somu M
Nov 4 at 10:55
I see a lot of WCF though... And "WsdlImporter encountered unrecognized policy assertions" might be the start of your problems.
– Henk Holterman
Nov 4 at 11:05