gpt4 book ai didi

linux - 从 bash 脚本发布 SOAP 信封

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:25:07 25 4
gpt4 key购买 nike

我如何通过 bash 脚本发布以下 SOAP 信封。

在 PHP 中,我会使用 cURL 发帖,但不知道如何转换为 bash?

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<n:Request xmlns:n="http://www.****.com/iprs/soap" env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" env:mustUnderstand="true">UserMod</n:Request>
</env:Header>
<env:Body>
<n:RequestUserMod xmlns:n="http://www.****.com/iprs/soap">
<n:UserID>****</n:UserID>
<n:UserData >
<n:SystemName>****</n:SystemName>
<n:AdminState>enabled</n:AdminState>
<n:CategoryTypeID>****</n:CategoryTypeID>
<n:Permissions>****</n:Permissions>
<n:BillingProgID>****</n:BillingProgID>
<n:DefaultGroupID>****</n:DefaultGroupID>
<n:PrimarySiteID>****</n:PrimarySiteID>
<n:SecondarySiteID>****</n:SecondarySiteID>
<n:ContactInfo></n:ContactInfo>
<n:Password>****</n:Password>
</n:UserData>
</n:RequestUserMod>
</env:Body>
</env:Envelope>

如果可能我也想检测响应,应该是:

HTTP/1.1 200 OK
Content-Type:application/soap+xml; charset="utf-8"
Content-Length:509

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Header>
<n:Response xmlns:n="http://www.*****.com/iprs/soap" env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" env:mustUnderstand="true">UserMod</n:Response>
</env:Header>
<env:Body>
<n:ResponseUserMod xmlns:n="http://www.*****.com/iprs/soap">
<n:StatusReport>
<n:Code>ok</n:Code>
<n:SubCode>0</n:SubCode>
</n:StatusReport>
</n:ResponseUserMod>
</env:Body>
</env:Envelope>

最佳答案

大概是这样?

curl --data - --request "POST" "http://www.somesite.com" <<EOF

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header>
<n:Request xmlns:n="http://www.****.com/iprs/soap" env:role="http://www.w3.org/2003/05/soap-envelope/role/ultimateReceiver" env:mustUnderstand="true">UserMod</n:Request>
</env:Header>
<env:Body>
<n:RequestUserMod xmlns:n="http://www.****.com/iprs/soap">
<n:UserID>****</n:UserID>
<n:UserData >
<n:SystemName>****</n:SystemName>
<n:AdminState>enabled</n:AdminState>
<n:CategoryTypeID>****</n:CategoryTypeID>
<n:Permissions>****</n:Permissions>
<n:BillingProgID>****</n:BillingProgID>
<n:DefaultGroupID>****</n:DefaultGroupID>
<n:PrimarySiteID>****</n:PrimarySiteID>
<n:SecondarySiteID>****</n:SecondarySiteID>
<n:ContactInfo></n:ContactInfo>
<n:Password>****</n:Password>
</n:UserData>
</n:RequestUserMod>
</env:Body>
</env:Envelope>

EOF

关于linux - 从 bash 脚本发布 SOAP 信封,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14198986/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com