I have a web service that I am calling by digitally signing the message with
WSE 2.0 SP2. It runs fine on my PC. I uploaded the WS to our server, and if
I call that from my PC that also works fine.
The problem comes in when I try to call the WS from another machine besides
mine or the host server. When I do that, I get "An error was discovered
processing the <Security> header"...
Is there something else I need to install on other machines to get my WSE
security working? I installed the WSE 2.0 runtime files, that didn't help.
Any ideas?
Here is the client code that calls the web service:
public CateringWS.DataServWse GetProxy()
{
CateringWS.DataServWse proxy = new CateringWS.DataServWse();
proxy.Url = "http://my_ip_address_here/CateringWS/DataServ.asmx";
// Get the SoapContext for the SOAP request that is being made to the
Web service
SoapContext reqCtx = proxy.RequestSoapContext;
// Add the UsernameToken to the WS-Security SOAP header
/* Help File Excerpt: The password is never sent in any form in the
SOAP message,
* but WSE does use the password to sign the SOAP message.
* A recipient would then need to provide a password to WSE
* during the signature validation stage. */
UsernameToken tok = new UsernameToken("mike", "amanda1",
PasswordOption.SendNone);
// set the TimeToLive to 2 minutes, to prevent anyone else from
replaying it
reqCtx.Security.Timestamp.TtlInSeconds = 120;
// Digitally sign the SOAP request by using a user name and password.
reqCtx.Security.Tokens.Add(tok);
reqCtx.Security.Elements.Add(new MessageSignature(tok));
// reqCtx.Security.Elements.Add(new EncryptedData(tok));
return proxy;
}
public ChartOfAccountsInfo[] GetChartOfAccounts()
{
CateringWS.DataServWse proxy = GetProxy();
try
{
return proxy.GetChartOfAccounts();
}
catch (Exception ex)
{
throw new ApplicationException(ex.Message);
}
}
TIA,
Mike Rodriguez
--
To understand recursion, we must first understand recursion. 3 5762
Michael,
Are you sure that you are signing the message? The code here just adds
some authentication, but I see nothing that loads a digital certificate (is
that what the MessageCertificate does?).
Also, if you have a certificate loaded in a store on the machine that is
doing the signing (your dev machine), then you have to make sure that
certificate is installed on the other machine that you installed the proxy
on.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Michael Rodriguez" <mike__at__compeat_dot_com> wrote in message
news:C5**********************************@microsof t.com... I have a web service that I am calling by digitally signing the message with WSE 2.0 SP2. It runs fine on my PC. I uploaded the WS to our server, and if I call that from my PC that also works fine.
The problem comes in when I try to call the WS from another machine besides mine or the host server. When I do that, I get "An error was discovered processing the <Security> header"...
Is there something else I need to install on other machines to get my WSE security working? I installed the WSE 2.0 runtime files, that didn't help. Any ideas?
Here is the client code that calls the web service:
public CateringWS.DataServWse GetProxy() { CateringWS.DataServWse proxy = new CateringWS.DataServWse(); proxy.Url = "http://my_ip_address_here/CateringWS/DataServ.asmx";
// Get the SoapContext for the SOAP request that is being made to the Web service SoapContext reqCtx = proxy.RequestSoapContext;
// Add the UsernameToken to the WS-Security SOAP header /* Help File Excerpt: The password is never sent in any form in the SOAP message, * but WSE does use the password to sign the SOAP message. * A recipient would then need to provide a password to WSE * during the signature validation stage. */ UsernameToken tok = new UsernameToken("mike", "amanda1", PasswordOption.SendNone);
// set the TimeToLive to 2 minutes, to prevent anyone else from replaying it reqCtx.Security.Timestamp.TtlInSeconds = 120;
// Digitally sign the SOAP request by using a user name and password. reqCtx.Security.Tokens.Add(tok); reqCtx.Security.Elements.Add(new MessageSignature(tok)); // reqCtx.Security.Elements.Add(new EncryptedData(tok));
return proxy; }
public ChartOfAccountsInfo[] GetChartOfAccounts() { CateringWS.DataServWse proxy = GetProxy(); try { return proxy.GetChartOfAccounts(); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
TIA,
Mike Rodriguez
-- To understand recursion, we must first understand recursion.
Nicholas,
Thanks for the quick response. I figured out what is was. I enabled
tracing in the web.config so I could see the SOAP responses. When I looked
at those, I saw the problem was a timeout error. I had set the TimeToLive to
2 minutes, and the computer I was sending the request from was 10 minutes
behind the Web server! All I had to do was sync the time and then it worked
fine.
Thanks,
Mike Rodriguez
"Nicholas Paldino [.NET/C# MVP]" wrote: Michael,
Are you sure that you are signing the message? The code here just adds some authentication, but I see nothing that loads a digital certificate (is that what the MessageCertificate does?).
Also, if you have a certificate loaded in a store on the machine that is doing the signing (your dev machine), then you have to make sure that certificate is installed on the other machine that you installed the proxy on.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Michael Rodriguez" <mike__at__compeat_dot_com> wrote in message news:C5**********************************@microsof t.com...I have a web service that I am calling by digitally signing the message with WSE 2.0 SP2. It runs fine on my PC. I uploaded the WS to our server, and if I call that from my PC that also works fine.
The problem comes in when I try to call the WS from another machine besides mine or the host server. When I do that, I get "An error was discovered processing the <Security> header"...
Is there something else I need to install on other machines to get my WSE security working? I installed the WSE 2.0 runtime files, that didn't help. Any ideas?
Here is the client code that calls the web service:
public CateringWS.DataServWse GetProxy() { CateringWS.DataServWse proxy = new CateringWS.DataServWse(); proxy.Url = "http://my_ip_address_here/CateringWS/DataServ.asmx";
// Get the SoapContext for the SOAP request that is being made to the Web service SoapContext reqCtx = proxy.RequestSoapContext;
// Add the UsernameToken to the WS-Security SOAP header /* Help File Excerpt: The password is never sent in any form in the SOAP message, * but WSE does use the password to sign the SOAP message. * A recipient would then need to provide a password to WSE * during the signature validation stage. */ UsernameToken tok = new UsernameToken("mike", "amanda1", PasswordOption.SendNone);
// set the TimeToLive to 2 minutes, to prevent anyone else from replaying it reqCtx.Security.Timestamp.TtlInSeconds = 120;
// Digitally sign the SOAP request by using a user name and password. reqCtx.Security.Tokens.Add(tok); reqCtx.Security.Elements.Add(new MessageSignature(tok)); // reqCtx.Security.Elements.Add(new EncryptedData(tok));
return proxy; }
public ChartOfAccountsInfo[] GetChartOfAccounts() { CateringWS.DataServWse proxy = GetProxy(); try { return proxy.GetChartOfAccounts(); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
TIA,
Mike Rodriguez
-- To understand recursion, we must first understand recursion.
The one problem you still have is signing the message with the user token.
This is *not secure in the least. That password would be cracked in a few
seconds off the wire - *even if you use SendNone. Hacker just does the
dictionary attack on the signature. UsernameTokens should only be sent if
they are encrypted first - either inside an SSL session or using a
SecurityContextToken. If you use a SCT, then you don't need to send the UT
anyway. So I would use only SCTs and require on the server each message is
at *least signed with an *authenticated SCT (or a token derived from an
authenticated SCT).
See:
http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!303.entry
http://spaces.msn.com/members/staceyw/Blog/cns!1pnsZpX0fPvDxLKC6rAAhLsQ!268.entry http://msdn.microsoft.com/webservice...rnametoken.asp
--
William Stacey, MVP http://mvp.support.microsoft.com
"Michael Rodriguez" <mike__at__compeat_dot_com> wrote in message
news:67**********************************@microsof t.com... Nicholas,
Thanks for the quick response. I figured out what is was. I enabled tracing in the web.config so I could see the SOAP responses. When I
looked at those, I saw the problem was a timeout error. I had set the TimeToLive
to 2 minutes, and the computer I was sending the request from was 10 minutes behind the Web server! All I had to do was sync the time and then it
worked fine.
Thanks,
Mike Rodriguez
"Nicholas Paldino [.NET/C# MVP]" wrote:
Michael,
Are you sure that you are signing the message? The code here just
adds some authentication, but I see nothing that loads a digital certificate
(is that what the MessageCertificate does?).
Also, if you have a certificate loaded in a store on the machine
that is doing the signing (your dev machine), then you have to make sure that certificate is installed on the other machine that you installed the
proxy on.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Michael Rodriguez" <mike__at__compeat_dot_com> wrote in message news:C5**********************************@microsof t.com...I have a web service that I am calling by digitally signing the message with WSE 2.0 SP2. It runs fine on my PC. I uploaded the WS to our server,
and if I call that from my PC that also works fine.
The problem comes in when I try to call the WS from another machine besides mine or the host server. When I do that, I get "An error was
discovered processing the <Security> header"...
Is there something else I need to install on other machines to get my
WSE security working? I installed the WSE 2.0 runtime files, that didn't help. Any ideas?
Here is the client code that calls the web service:
public CateringWS.DataServWse GetProxy() { CateringWS.DataServWse proxy = new CateringWS.DataServWse(); proxy.Url = "http://my_ip_address_here/CateringWS/DataServ.asmx";
// Get the SoapContext for the SOAP request that is being made to
the Web service SoapContext reqCtx = proxy.RequestSoapContext;
// Add the UsernameToken to the WS-Security SOAP header /* Help File Excerpt: The password is never sent in any form in
the SOAP message, * but WSE does use the password to sign the SOAP message. * A recipient would then need to provide a password to WSE * during the signature validation stage. */ UsernameToken tok = new UsernameToken("mike", "amanda1", PasswordOption.SendNone);
// set the TimeToLive to 2 minutes, to prevent anyone else from replaying it reqCtx.Security.Timestamp.TtlInSeconds = 120;
// Digitally sign the SOAP request by using a user name and
password. reqCtx.Security.Tokens.Add(tok); reqCtx.Security.Elements.Add(new MessageSignature(tok)); // reqCtx.Security.Elements.Add(new EncryptedData(tok));
return proxy; }
public ChartOfAccountsInfo[] GetChartOfAccounts() { CateringWS.DataServWse proxy = GetProxy(); try { return proxy.GetChartOfAccounts(); } catch (Exception ex) { throw new ApplicationException(ex.Message); } }
TIA,
Mike Rodriguez
-- To understand recursion, we must first understand recursion. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: grahamd |
last post by:
Who are the appropriate people to report security problems to
in respect of a module included with the Python distribution?
I don't feel it appropriate to be reporting it on general mailing
lists.
|
by: Alistair |
last post by:
hello again oh knowledgable ones
Today I took the plunge (more like a hell-hole dive) and upgraded to windows
XP Pro..
and as I expected things are slightly different...
what I didn't...
|
by: craig |
last post by:
I am working on my first .NET development project that involves custom
role-based security per the project requirements. This lead to a general
design issue this week that really caused us some...
|
by: A.M. |
last post by:
Hi at all,
how can I do to insert into a HTML page a file .txt stored in the same
directory of the server where is the html file that must display the text
file.txt?
Thank you very much
P.Pietro
|
by: Mike MacSween |
last post by:
S**t for brains strikes again!
Why did I do that? When I met the clients and at some point they vaguely
asked whether eventually would it be possible to have some people who could
read the data...
| |
by: Chua Wen Ching |
last post by:
Hi there,
I had applied this security permissions in my class library based on fxcop
standards.
Before namespace:
using System.Runtime.InteropServices;
using System.Security.Permissions;
|
by: Earl Teigrob |
last post by:
Background:
When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
|
by: Norsoft |
last post by:
I have a .Net 1.1 application which is downloaded into an aspx page. It is a
dll which inherits from System.Windows.Forms.UserControl. It works fine on a
PC with only the 1.1 Framework. However,...
|
by: Jay C. |
last post by:
Jay
3 Jan. 11:38 Optionen anzeigen
Newsgroups: microsoft.public.dotnet.framework.webservices.enhancements
Von: "Jay" <p.brunm...@nusurf.at> - Nachrichten dieses Autors suchen
Datum: 3 Jan...
|
by: =?Utf-8?B?TWFuanJlZSBHYXJn?= |
last post by:
Hi,
I created a web service and hosted it in Windows Services. It is working
fine. Now I am trying to implement the X509 certificates for message layer
security. But it is throwing the following...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |