设置IIS快速时区 [英] Set IIS express time zone
问题描述
大家好,
我通过提供的URL(第三方)访问我的解决方案中的WCF服务。
使用WS Http Binding保护服务,具有用户名,使用soap请求进行密码认证。
我在我的解决方案中添加了一个服务引用,并将用户名和密码传递给服务对象。
Hi All,
I am accessing a WCF service in my solution from URL provided(Third party).
The service is secured with WS Http Binding, having an user name ,password authentication with soap request.
I have added a service reference in my solution and passed a user name and password to service object.
ServiceReferenceAdmin client = new ServiceReferenceAdmin("WSHttpBinding_IAdmin");
client.ClientCredentials.UserName.UserName = "one";
client.ClientCredentials.UserName.Password = "two";
client.callServMethod("test");
当我调用服务方法时,使用服务方法创建连接 - >使用fiddler获取请求和响应 - >并且开始了解 -
在soap请求中,时间戳作为本地系统时间戳,采用GMT格式。
服务器时区(我托管的服务所在地)是太平洋时区(UTC -08:00)。
因此,身份验证失败并拒绝服务方法调用。
尝试以下不同方式:
1)将系统时区更改为太平洋时区(UTC -8:00)
2)
When I am calling service method, connection is created with service method-->Used a fiddler to get request and response --> and came to know --
In soap request timestap is going as a local system timestamp which is in GMT format.
And server time zone(where service i hosted) is Pacific time zone (UTC -08:00).
Because of this the authentication is failing and rejecting service method call.
Tried following different ways :
1) Changed system time zone to Pacific time zone (UTC -8:00)
2)
using(new OperationContextScope(client.InnerChannel))
{
OperationContext.Current.OutgoingMessageHeaders.Add(new SecurityHeader("UsernameToken", "one", "two"));
string str = "acp";
}
public class SecurityHeader : MessageHeader
{
private readonly UsernameToken _usernameToken;
public SecurityHeader(string id, string username, string password)
{
_usernameToken = new UsernameToken(id, username, password);
}
public override string Name
{
get { return "Security"; }
}
public override string Namespace
{
get { return "namespace"; }
}
protected override void OnWriteHeaderContents(XmlDictionaryWriter writer, MessageVersion messageVersion)
{
XmlSerializer serializer = new XmlSerializer(typeof(UsernameToken));
serializer.Serialize(writer, _usernameToken);
}
}
完成所有这些设置后,SOAP请求不会从GMT更改为太平洋时区。
如何更改soap请求的时间戳?
有什么方法可以在IIS中设置时区吗?
提前感谢您的回复。
请让我知道您的反馈和建议
After all this settings SOAP request is not changing from GMT to Pacific timezone.
How to make change in timestamp of soap request?
Is there any way I can set time Zone in IIS ?
Thank you in advance for your response.
Please let me know your feedback and suggestions
推荐答案
- 将系统时区更改为所需时区
- 重启系统以影响更改
- 它会将时区重置为新的
- Change System time zone to required time zone
- restart system to affect changes
- it will reset timezone to new
这篇关于设置IIS快速时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!