,因爲我從你的問題理解你不需要完整的soap框架來調用和處理響應。在這種情況下,您應該使用簡單的xml解析器並構建您自己的soap xml調用。
我會建議你用用的CocoaPods和集成AEXML到您的項目
這很簡單XML SOAP格式,使通話
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<m:Trans xmlns:m="http://www.w3schools.com/transaction/" soap:mustUnderstand="1">234</m:Trans>
</soap:Header>
<soap:Body>
<m:GetStockPrice>
<m:StockName>AAPL</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
,它怎麼會與AEXML
構建它
let soapRequest = AEXMLDocument()
let attributes = ["xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance", "xmlns:xsd" : "http://www.w3.org/2001/XMLSchema"]
let envelope = soapRequest.addChild(name: "soap:Envelope", attributes: attributes)
let header = envelope.addChild(name: "soap:Header")
let body = envelope.addChild(name: "soap:Body")
header.addChild(name: "m:Trans", value: "234", attributes: ["xmlns:m" : "http://www.w3schools.com/transaction/", "soap:mustUnderstand" : "1"])
let getStockPrice = body.addChild(name: "m:GetStockPrice")
getStockPrice.addChild(name: "m:StockName", value: "AAPL")
println(soapRequest.xmlString)
之後比準備你的肥皂電話可以使用任何網絡庫
如果有任何在線方法來檢查肥皂Api的,請參閱它們。像Rest Api的我使用POSTMAN,RestClient等 – Sam
到目前爲止,你做了什麼沒有工作? – Andrej
@Ali謝謝你的迴應。我成功實施了它。每次我管理的肥皂請求都會被修改。此後按照下面的說明點擊。謝謝 !! – Sam