gpt4 book ai didi

dart - flutter 肥皂 : How to using SOAP in Flutter?

转载 作者:IT王子 更新时间:2023-10-29 07:13:20 27 4
gpt4 key购买 nike

如何在 Flutter 中使用 SOAP Api 调用?我试过休息电话工作正常。我需要在 flutter 中构建 SOAP 调用。请分享如何在flutter中调用SOAP

最佳答案

引用此链接成功调用 SOAP https://dartpad.dartlang.org/2561dd3579e45d1eb730

void functionCall() async {
var envelope = '''
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetAllCity xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>
''';

http.Response response = await http.post(
'http://www.i2isoftwares.com/SSKSService/sskss.asmx',
headers: {
"Content-Type": "text/xml; charset=utf-8",
"SOAPAction": "http://tempuri.org/GetAllCity",
"Host": "www.i2isoftwares.com"
//"Accept": "text/xml"
},
body: envelope);

var rawXmlResponse = response.body;

// Use the xml package's 'parse' method to parse the response.
xml.XmlDocument parsedXml = xml.parse(rawXmlResponse);

print("DATAResult=" + response.body);
}

关于dart - flutter 肥皂 : How to using SOAP in Flutter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52752469/

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