require "savon"
@URL = "http://10.68.2.17/PacsService/PacsService.svc?wsdl"
client = Savon.client(wsdl: @URL)
puts client.operations
response = client.call(:get_patient_info, message: { id:'1' })
puts response
xml_result = response.to_s
puts xml_result
response、xml_result 输出都为
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><GetPatientInfoResponse xmlns="http://tempuri.org/"><GetPatientInfoResult>[{'12':1222},{'34':1234}]</GetPatientInfoResult></GetPatientInfoResponse></s:Body></s:Envelope>
如何获取 GetPatientInfoResult 节点的值