小编Soh*_*aib的帖子

如何将SOAP UI响应中的特定值用于新的SOAP UI请求

从下面的SOAP UI响应;

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"         xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <ns0:HelpDesk_Submit_ServiceResponse xmlns:ns0="urn:HPD_IncidentInterface_Create_WS">
     <ns0:Incident_Number>**INC000000000274**</ns0:Incident_Number>
  </ns0:HelpDesk_Submit_ServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
Run Code Online (Sandbox Code Playgroud)

我想取出INC000000000274,然后将其提供给新的SOAP UI请求中的特定位置,如下所示;

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:HPD_IncidentInterface_WS">
<soapenv:Header>
  <urn:AuthenticationInfo>
     <urn:userName></urn:userName>
     <urn:password></urn:password>
     <!--Optional:-->
     <urn:authentication></urn:authentication>
     <!--Optional:-->
     <urn:locale></urn:locale>
     <!--Optional:-->
     <urn:timeZone></urn:timeZone>
  </urn:AuthenticationInfo>
</soapenv:Header>
<soapenv:Body>
  <urn:HelpDesk_Query_Service>
     <urn:Incident_Number>**INC000000000274**</urn:Incident_Number>
  </urn:HelpDesk_Query_Service>
Run Code Online (Sandbox Code Playgroud)

我该怎么做?我正在使用SOAP UI免费版.我想要取出然后输入的值每次都会与响应不同.

soapui

5
推荐指数
1
解决办法
2万
查看次数

如何在Python中的字典中附加列表?

嘿大家这个代码工作正常只需要处理一件事.它会根据密钥覆盖多个条目.我需要避免覆盖并保存所有这些条目.你可以帮帮我吗?

#!/usr/bin/python

import sys
import fileinput

#trys to create dictionary from african country list
dic = {}

for line in sys.stdin:
    lst = line.split('|')
    links = lst[4].split()
    new=links[0] + ' ' + links[len(links)-1]
    dic[new]=lst[4] # WARNING: overwrites multiple entriess at the moment! :)

for newline in fileinput.input('somefile.txt'):
    asn = newline.split()
    new = asn[0] + ' ' + asn[1]
    if new in dic:
            print "found from " + asn[0] + " to " + asn[1]
            print dic[new]
Run Code Online (Sandbox Code Playgroud)

注意:Sys.stdin采用以下格式的字符串; 1.0.0.0/24|US | 15882.182.221 …

python

2
推荐指数
1
解决办法
1000
查看次数

标签 统计

python ×1

soapui ×1