AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1112821
Accepted
w3ich3rt
w3ich3rt
Asked: 2022-10-12 06:56:14 +0800 CST2022-10-12 06:56:14 +0800 CST 2022-10-12 06:56:14 +0800 CST

ConfigMgr WebService API 调用

  • 772

目前,我尝试通过 api 将我的应用程序与ConfigMgr Webservice连接,但通过发送我的 SOAP API 请求,curl我总是收到 400 错误。

我们正在编写自己的应用程序来与 SCCM “对话”,并且因为我们不能使用 PowerShell(由于公司限制),我们正在尝试使用ConfigMgr Webservice。这里有没有人对这个小 API 有一些经验,并且可以指出我使用它的正确方向?

目前我试图得到这个端点GetCWVersion。

如果您需要更多信息,请询问!

windows sccm
  • 1 1 个回答
  • 21 Views

1 个回答

  • Voted
  1. Best Answer
    w3ich3rt
    2022-10-15T02:47:07+08:002022-10-15T02:47:07+08:00

    我通过使用 python 而不是在curl. 有了requests图书馆,这很简单。

    """Just an example for a soap request"""
    import requests
    
    host = "host"
    secret = "secret"
    filter = "filter"
    
    url = "https://" + host + "/ConfigMgrWebService/ConfigMgr.asmx"
    payload ="""<?xml version="1.0" encoding="utf-8"?>
                <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
                    <soap12:Body>
                        <GetCMDeviceCollections xmlns="http://www.scconfigmgr.com">
                        <secret>{secret}</secret>
                        <filter>{filter}</filter>
                        </GetCMDeviceCollections>
                    </soap12:Body>
                </soap12:Envelope>""".format(secret=secret, filter=filter)
    headers = {
         'Content-Type': 'application/soap+xml; charset=utf-8'
    }
        
    response = requests.request("POST", url, headers=headers, data=payload, verify = False)
    print(response.text)
    
    • 0

相关问题

  • 知道任何适用于 Windows 的快速可编写脚本的 ftp 客户端吗?[关闭]

  • 如果 Windows 服务崩溃,如何自动重新启动它?

  • 无法安排任务(访问被拒绝)

  • 物理机重启时自动重启虚拟机(VMWare)

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve