一、参数没有子节点的方式
<?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> <methodName xmlns="http://WebXml.com.cn/"> <paramName>xxx</paramName> </methodName > </soap:Body> </soap:Envelope>
二、参数有子节点嵌套的方式,直接嵌套 postMan会报错,两种解决办法
第一种,将< > 使用转义字符代替
<?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> <methodName xmlns="http://WebXml.com.cn/"> <paramName> <DATASETS> <DATASET> <SORT_DATE>2022-11-25</SORT_DATE> <RECEIVE_TIME>2022-11-25 23:23:23</RECEIVE_TIME> </DATASET> </DATASETS> </paramName> <paramName>xxxx</paramName> </methodName > </soap:Body> </soap: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> <methodName xmlns="http://WebXml.com.cn/"> <paramName> <DATASETS>
<DATASET> <SORT_DATE>2022-11-25</SORT_DATE> <SORTLINE_CODE>001</SORTLINE_CODE> <SORTLINE_DESC>1号分拣线</SORTLINE_DESC> <BATCH_NO>SP0420221125001</BATCH_NO> <QTY_PRODCUT_TOT>20</QTY_PRODCUT_TOT>
</DATASET> </DATASETS> </paramName> <paramName>34340</paramName> </methodName> </soap:Body> </soap:Envelope>
第二种 加上
<![CDATA[]>><?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> <transSortProcess xmlns="http://WebXml.com.cn/"> <sortProcessObject> <![CDATA[ <REQUEST> <HEADER>Bearer</HEADER> <PARAM> <DATASETS> <SORT_DATE>2022-11-25</SORT_DATE> <SORTLINE_CODE>001</SORTLINE_CODE> <SORTLINE_DESC>1号分拣线</SORTLINE_DESC> <BATCH_NO>SP0420221125001</BATCH_NO> <QTY_PRODCUT_TOT>20</QTY_PRODCUT_TOT> </DATASETS> </PARAM> </REQUEST> ]]> </sortProcessObject> <opType>34340</opType> </transSortProcess> </soap:Body> </soap:Envelope>
标签:11,25,gt,postMan,参数传递,lt,2022,webService From: https://www.cnblogs.com/GOOGnine/p/16925208.html