gpt4 book ai didi

ios - 如何使用数组参数在 iOS 中创建 soap 请求?

转载 作者:行者123 更新时间:2023-11-29 03:20:36 25 4
gpt4 key购买 nike

我是使用网络服务开发 IOS 的新手。谁能帮助我了解如何在 SOAP Web 服务中使用数组参数创建请求。在 PHP 中,我可以通过这样做来创建请求:

$params = array(
"authuserid" => "454",
"authpassword" => "");
$result = $client->call("EC_LOGON",$params);

请帮助我,我很难找到一个很好的例子,说明如何在 Objective C 编程中应用该代码。

最佳答案

带参数的 SOAP 消息应如下所示,

NSString *soapMessage = [NSString stringWithFormat:
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<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/\">\n"
"<soap:Body>\n"
"<TestSoap xmlns=\"http://testsoap.com/\">\n"
"<parameterOne>%@</parameterOne >\n"
"<parameterTwo>%@</parameterTwo >\n"
"</TestSoap >\n"
"</soap:Body>\n"
"</soap:Envelope>\n", valueOne, valueTwo];

关于ios - 如何使用数组参数在 iOS 中创建 soap 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21156737/

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