0
我在肥皂请求中发送数据数组时遇到问题。如何通过ios中的soap请求发送数据数组?
使用下面的代码,我可以得到低于响应。
SOAP消息requets:
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/\" xmlns=\"http://xmlns.oracle.com/Enterprise/Tools/services/TEST_SRVC\">\n"
"<soap:Body>\n"
"<TEST_SRVC_OP/>\n"
"<OPRID>%@</OPRID>\n"
"<PWD>%@</PWD>\n"
"<REQUEST_ID>%@</REQUEST_ID>\n"
"<PORT_CD>%@</PORT_CD>\n"
"<SIZE_CD>%@</SIZE_CD>\n"
"</soap:Body>\n"
"</soap:Envelope>\n",strUserName,strPassword,strRequestID,strSize] ;
生成的SOAP消息:
<?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/" xmlns="http://xmlns.oracle.com/Enterprise/Tools/services/TEST_SRVC">
<soap:Body>
<TEST_SRVC_OP/>
<OPRID> username </OPRID>
<PWD> passowrd </PWD>
<REQUEST_ID> R123 </REQUEST_ID>
<PORT_CD> TEST1 </PORT_CD>
<SIZE_CD>40</SIZE_CD>
</soap:Body>
</soap:Envelope>
但是,我需要生成这样的SOAP消息。
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://xmlns.oracle.com/Enterprise/Tools/services/TEST_SRVC" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<TEST_SRVC_OP />
<OPRID>username</OPRID>
<PWD>passowrd</PWD>
<REQUEST_ID>R123</REQUEST_ID>
<Detailrow>
<PORT_CD>TEST1</PORT_CD>
<SIZE_CD>40</SIZE_CD>
</Detailrow>
<Detailrow>
<PORT_CD>TEST2</PORT_CD>
<SIZE_CD>60</SIZE_CD>
</Detailrow>
</soap:Body>
</soap:Envelope>