- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 Powershell SOAP 在 ServiceNow 中创建票证。我有有效的 XML,并且已使用 SoapUI 工具使用基本身份验证成功对其进行了测试。但是当我尝试通过 Powershell 将相同的 XML 发布到 ServiceNow 时,出现错误。我不确定这是否是 auth header 的问题(SoapUI 和 PS 中的相同信用)或其他问题,因为我从帖子中收到 500 错误,这听起来与 auth 无关。
使用 PS v4。长期 powershell 用户。第一次与 ServiceNow 进行 SOAP 和脚本交互。他们的 wiki 没有 powershell 示例:(
谢谢
$uri = "https://fubar.service-now.com/u_smarts_notification.do?SOAP"
$username = 'looseLips'
$password = 'sinkShips'
$xml = [xml]@"
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://www.service-now.com/u_smarts_notification">
<soapenv:Header/>
<soapenv:Body>
<u:insert>
<u_assignment_group>Some Group</u_assignment_group>
<u_impact>4</u_impact>
<u_urgency>3</u_urgency>
<u_op_tier_1>Malfunction</u_op_tier_1>
<u_op_tier_2>Error</u_op_tier_2>
<u_op_tier_3>Break Fix</u_op_tier_3>
<u_short_description>Subject</u_short_description>
<u_work_notes>Body</u_work_notes>
</u:insert>
</soapenv:Body>
</soapenv:Envelope>
"@
$header = @{"Authorization" = "Basic "+[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($username+":"+$password))}
$post = Invoke-WebRequest -Uri $uri -Headers $header -Method Post -Body $xml
Invoke-WebRequest : The remote server returned an error: (500) Internal Server
Error.
At R:\ps1\serviceNowINC.ps1:30 char:9
+ $post = Invoke-WebRequest -Uri $uri -Headers $header -Method Post -Body $xml
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt
pWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeWebRequestCommand
最佳答案
尝试设置内容类型,例如
$post = Invoke-WebRequest -Uri $uri -Headers $header -Method Post -Body $xml -ContentType "application/xml"
关于适用于 ServiceNow 的 Powershell SOAP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24050819/
我是 Servicenow 的新手,正在研究 ServiceNow 的功能。我试图了解我们如何在 ServiceNow 中实现标准开发最佳实践。 版本控制 CI/CD 源代码集成与代码审查 到目前为止
有没有一种方法可以对返回表的单个列的ServiceNow REST API执行REST调用?我只想在服务器表中查询服务器的名称,而没有整个记录包含返回的50多个字段。 最佳答案 最新的REST Tab
我看到更新集中未捕获对计划脚本执行的任何更新。 捕获更改的标准是什么? 我们可以手动配置要在更新集中捕获和不捕获的项目列表吗? 最佳答案 具有 update_synch 属性的表设置为 true 会在
我有一个需要在事件更新之前运行的业务规则。问题是这个脚本需要从“脚本包含”中触发一个很慢的函数。我希望这个调用是异步的,以便可以加载表单。 有没有办法做到这一点? 最佳答案 我假设您已经知道 asyn
我是 ServiceNow 的新手并遵循了本教程 Workflow for Servicenow Incidents为批准请求创建一个简单的工作流。 我在开发人员实例的工作室中采取的步骤: 创建了一个
在ServiceNow中,我在业务登录-脚本操作中编写了脚本。添加和删除时我得到 sysId,但重命名附件时我无法获得 sys_id。 sendnotification(); function s
我正在尝试在 ServiceNow 中创建一个小部件,根据用户的位置和职业显示与用户相关的所有知识文章。在某些情况下,应该返回多篇 KA 文章,而我想动态创建一个表来列出所有适用的文章。下面是我的服务
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
当比较两个日期时,如何获得两个日期对象之间的天数差异? (例如 - 2017-07-31 和 2017-07-28 --> 这应该返回 3 天)。 UNIX 时间戳将不起作用,因为它对我的情况不准确
我正在尝试编写一个包含编码查询的查询,但我不确定我的语法是否正确(99.9% 是完全错误的)。我希望此查询循环遍历所有可用的知识文章,并根据工作系列和位置为用户提供正确的文章。第一步是获取用户的工作系
我正在 ServiceNow 平台中编写验证脚本。我需要验证记录制作者和服务目录项的表单数据。如何在服务器端正确验证表单数据而不被客户端脚本调用?我已经有一个目录客户端脚本,可以在脚本包含中调用服务器
我正在 ServiceNow 中创建一个前端门户,它需要使用 g:evaluate 来调用来自不同表的变量。 例如: var gr = new GlideRecord('sys_user'); gr
我们公司使用 ServiceNow 来跟踪用户报告的事件。为了关注调用解决情况,我们的服务台会查看积压工作图表以关注趋势。待办事项图表是使用此处提供的相同代码生成的: http://wiki.serv
我正在尝试实现一个查询表并检查某些条件的脚本。如果为真,那么它将插入一个事件。 我不确定哪里出了问题,我猜是 while 循环。 我是 servicenow 中的脚本新手,如果有人可以提供帮助。代码如
在ServiceNow ,我在 SOAP 请求中最多只能获得 250 记录。如何获取所有记录? Web Reference Url = https://*****.service-now.com/rm
我用 C# 创建了一个聊天机器人,它配置为 Luis,并在提出问题时给出某种答复。但我想使用这个聊天机器人在 Servicenow 中创建事件。聊天机器人会询问一些问题,例如“问题是什么?”或“简短描
我有一个客户端脚本,它执行 GlideRecord 查询来检查是否已存在同名记录。 如果找到匹配的记录,我们需要停止提交表单。 我们在 CMS 门户上运行良好。 但是,新的 Service Porta
我目前在赫尔辛基发布 无法理解标签标签内的美元符号和花括号的用途 ${Location} 天气小部件的完整html: ${Location} ${Go}
我需要在页面加载时将占位符添加到服务门户下目录项中的文本字段,我尝试使用 jquery 和 Angular/Document 在目录客户端脚本中尝试,但没有成功,并发现它不支持任何其他替代解决方案?
我在用python编写一个报告工具,它可以从servicennow的json web服务中获取数据。我们的servicenow实例使用普通用户id/pw身份验证和sha-1认证。我的问题是,我无法使用
我是一名优秀的程序员,十分优秀!