前言
最近接到一个接口需求,外围系统提供了一个Webservice,SAP生成代理类失败,但是使用SoapUI测试的时候,接口正常并成功返回了消息>.<
最后发现是由于SAP不支持解析这种类型的Webservice,只能在SAP中直接Post Webservice,完成接口对接。
具体步骤如下:
1.先使用SoapUI,解析Webservice,查看相关类的报文
报文如下:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soa="http://soa.poba.com">
<soapenv:Header/>
<soapenv:Body>
<soa:GK_getServiceByCode soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<authorizationCode xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">?</authorizationCode>
<serviceCode xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">?</serviceCode>
<datajson xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">?</datajson>
</soa:GK_getServiceByCode>
</soapenv:Body>
</soapenv:Envelope>
2.解析报文、拼装
我们需要在程序里,对比1中解析的报文,进行拼装
3.对地址进行Post
如下代码:
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(IV_URL)
*" VALUE(IT_FIELDS) TYPE TIHTTPNVP OPTIONAL
*" VALUE(IV_CONTENT_TYPE) OPTIONAL
*" VALUE(IV_DATA) OPTIONAL
*" EXPORTING
*" REFERENCE(EV_RESPONSE)
*" REFERENCE(EV_RESPONSE_X)
*" REFERENCE(EV_MTYPE)
*" REFERENCE(EV_MESSAGE)
*"----------------------------------------------------------------------
DATA:
lo_http_client TYPE REF TO if_http_client,
lv_host TYPE string,
lv_port TYPE string,
lv_uri TYPE string,
lv_content_type TYPE string,
lv_data TYPE string.
CLEAR: ev_response, ev_response_x, ev_mtype, ev_message.
* URL地址
lv_uri = iv_url.
IF lv_uri IS INITIAL.
ev_mtype = 'E'.
ev_message = 'Http请求地址不能为空'.
RETURN.
ENDIF.
* 解析请求的主机地址和端口
CLEAR: lv_host, lv_port.
CALL FUNCTION 'SWLWP_URI_PARSE'
EXPORTING
uri = lv_uri
IMPORTING
host = lv_host
port = lv_port
EXCEPTIONS
uri_no_path = 1
OTHERS = 2.
IF sy-subrc <> 0.
ev_mtype = 'E'.
ev_message = '解析Http请求地址错误'.
RETURN.
ENDIF.
* 创建Http实例
CLEAR: lo_http_client.
CALL METHOD cl_http_client=>create
EXPORTING
host = lv_host
service = lv_port
IMPORTING
client = lo_http_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
ev_mtype = 'E'.
ev_message = '创建Http请求失败'.
RETURN.
ENDIF.
* 设置请求的URL地址
CALL METHOD cl_http_utility=>set_request_uri
EXPORTING
request = lo_http_client->request
uri = lv_uri.
* 设置Post方法
CALL METHOD lo_http_client->request->set_method
EXPORTING
method = if_http_entity=>co_request_method_post.
* 设置请求内容类型
IF iv_content_type IS NOT INITIAL.
lv_content_type = iv_content_type.
CALL METHOD lo_http_client->request->set_content_type
EXPORTING
content_type = lv_content_type.
ENDIF.
* 设置字段
lo_http_client->request->set_header_fields( fields = it_fields ).
* 设置请求内容
IF iv_data IS NOT INITIAL.
lv_data = iv_data.
CALL METHOD lo_http_client->request->set_cdata
EXPORTING
data = lv_data.
ENDIF.
* 发送Http请求
CALL METHOD lo_http_client->send
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2.
IF sy-subrc <> 0.
ev_mtype = 'E'.
ev_message = '发送Http请求失败'.
RETURN.
ENDIF.
* 接收返回消息
CALL METHOD lo_http_client->receive
EXCEPTIONS
http_communication_failure = 1
http_invalid_state = 2
http_processing_failed = 3.
IF sy-subrc <> 0.
ev_mtype = 'E'.
ev_message = '获取Http返回失败'.
RETURN.
ENDIF.
ev_mtype = 'S'.
ev_message = 'Http请求成功'.
* 返回正文
IF ev_response IS SUPPLIED.
DATA(lv_response) = lo_http_client->response->get_cdata( ).
ev_response = lv_response.
ENDIF.
IF ev_response_x IS SUPPLIED.
DATA(lv_response_x) = lo_http_client->response->get_data( ).
ev_response_x = lv_response_x.
ENDIF.
4.使用正则表达式返回解析结果
lv_regex = '<GK_getServiceByCodeReturn.*>(.*)</GK_getServiceByCodeReturn>'.
FIND REGEX lv_regex IN lv_response SUBMATCHES lv_data.
返回结果由于是Json格式,在SAP解析中会存在一些乱码,需要在SAP中转换:)
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" REFERENCE(IV_ESCAPED)
*" EXPORTING
*" REFERENCE(EV_UNESCAPED)
*"----------------------------------------------------------------------
DEFINE unescape_amp.
* &1: &. . .
* &2: Integer of the unicode symbol
* &.. within the
CONCATENATE '*' &1 '*' INTO l_pattern. "#EC NOTEXT
IF ev_unescaped CP l_pattern.
TRY.
l_replace = cl_abap_conv_in_ce=>uccpi( &2 ).
CATCH cx_root.
l_replace = '#'. "#EC NOTEXT
ENDTRY.
REPLACE ALL OCCURRENCES OF &1 IN ev_unescaped WITH l_replace.
ENDIF.
END-OF-DEFINITION. "#EC NOTEXT
DEFINE unescape_hex.
END-OF-DEFINITION.
* Replace all "<>&
ev_unescaped = iv_escaped.
CHECK ev_unescaped CA '&' AND ev_unescaped CA ';'. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
* Unescape the essential thing
REPLACE ALL OCCURRENCES OF '"' IN ev_unescaped WITH '"'. "#EC NOTEXT
REPLACE ALL OCCURRENCES OF '<' IN ev_unescaped WITH '<'. "#EC NOTEXT
REPLACE ALL OCCURRENCES OF '>' IN ev_unescaped WITH '>'. "#EC NOTEXT
REPLACE ALL OCCURRENCES OF '&' IN ev_unescaped WITH '&'. "#EC NOTEXT
REPLACE ALL OCCURRENCES OF '€' IN ev_unescaped WITH '€'. "#EC *
REPLACE ALL OCCURRENCES OF '†' IN ev_unescaped WITH '#'. "#EC *
REPLACE ALL OCCURRENCES OF '‡' IN ev_unescaped WITH '#'. "#EC *
DATA:
l_pattern TYPE string,
l_replace TYPE string.
* Escape the &#number;
IF ev_unescaped CS '&#x'. "#EC NOTEXT
DATA:
l_start TYPE i,
l_i TYPE i,
l_length TYPE i,
l_content TYPE string,
l_xstring TYPE xstring.
l_start = 1.
DO.
SEARCH ev_unescaped FOR '&#x' IN CHARACTER MODE STARTING AT l_start. "#EC NOTEXT
IF sy-subrc = 0.
l_start = l_start + sy-fdpos.
SEARCH ev_unescaped FOR ';' IN CHARACTER MODE STARTING AT l_start. "#EC NOTEXT
IF sy-subrc = 0.
SUBTRACT 1 FROM l_start.
l_length = sy-fdpos + 1.
l_pattern = ev_unescaped+l_start(l_length).
ADD 3 TO l_start.
l_length = sy-fdpos - 3.
l_content = ev_unescaped+l_start(l_length).
IF l_content CO ' 0123456789ABCDEF'. "#EC NOTEXT
l_xstring = l_content.
MOVE l_xstring TO l_i.
TRY.
l_replace = cl_abap_conv_in_ce=>uccpi( l_i ).
CATCH cx_root.
l_replace = '#'.
ENDTRY.
REPLACE ALL OCCURRENCES OF l_pattern IN ev_unescaped WITH l_replace.
SUBTRACT 2 FROM l_start.
ENDIF.
ELSE.
EXIT.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
* Escape the &#number;
IF ev_unescaped CS '&#'. "#EC NOTEXT
l_start = 1.
DO.
SEARCH ev_unescaped FOR '&#' IN CHARACTER MODE STARTING AT l_start. "#EC NOTEXT
IF sy-subrc = 0.
l_start = l_start + sy-fdpos.
SEARCH ev_unescaped FOR ';' IN CHARACTER MODE STARTING AT l_start. "#EC NOTEXT
IF sy-subrc = 0.
SUBTRACT 1 FROM l_start.
l_length = sy-fdpos + 1.
l_pattern = ev_unescaped+l_start(l_length).
ADD 2 TO l_start.
l_length = sy-fdpos - 2.
l_content = ev_unescaped+l_start(l_length).
IF l_content CO ' 0123456789'. "#EC NOTEXT
l_i = l_content.
TRY.
l_replace = cl_abap_conv_in_ce=>uccpi( l_i ).
CATCH cx_root.
l_replace = '#'.
ENDTRY.
REPLACE ALL OCCURRENCES OF l_pattern IN ev_unescaped WITH l_replace.
ENDIF.
ELSE.
EXIT.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
ENDIF.
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp ' ' 160. "#EC NOTEXT
unescape_amp '¡' 161. "#EC NOTEXT
unescape_amp '¢' 162. "#EC NOTEXT
unescape_amp '£' 163. "#EC NOTEXT
unescape_amp '¤' 164. "#EC NOTEXT
unescape_amp '¥' 165. "#EC NOTEXT
unescape_amp '¦' 166. "#EC NOTEXT
unescape_amp '§' 167. "#EC NOTEXT
unescape_amp '¨' 168. "#EC NOTEXT
unescape_amp '©' 169. "#EC NOTEXT
unescape_amp 'ª' 170. "#EC NOTEXT
unescape_amp '«' 171. "#EC NOTEXT
unescape_amp '¬' 172. "#EC NOTEXT
unescape_amp '­' 173. "#EC NOTEXT
unescape_amp '®' 174. "#EC NOTEXT
unescape_amp '¯' 175. "#EC NOTEXT
unescape_amp '°' 176. "#EC NOTEXT
unescape_amp '±' 177. "#EC NOTEXT
unescape_amp '²' 178. "#EC NOTEXT
unescape_amp '³' 179. "#EC NOTEXT
unescape_amp '´' 180. "#EC NOTEXT
unescape_amp 'µ' 181. "#EC NOTEXT
unescape_amp '¶' 182. "#EC NOTEXT
unescape_amp '·' 183. "#EC NOTEXT
unescape_amp '¸' 184. "#EC NOTEXT
unescape_amp '¹' 185. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'º' 186. "#EC NOTEXT
unescape_amp '»' 187. "#EC NOTEXT
unescape_amp '¼' 188. "#EC NOTEXT
unescape_amp '½' 189. "#EC NOTEXT
unescape_amp '¾' 190. "#EC NOTEXT
unescape_amp '¿' 191. "#EC NOTEXT
unescape_amp 'À' 192. "#EC NOTEXT
unescape_amp 'Á' 193. "#EC NOTEXT
unescape_amp 'Â' 194. "#EC NOTEXT
unescape_amp 'Ã' 195. "#EC NOTEXT
unescape_amp 'Ä' 196. "#EC NOTEXT
unescape_amp 'Å' 197. "#EC NOTEXT
unescape_amp 'Æ' 198. "#EC NOTEXT
unescape_amp 'Ç' 199. "#EC NOTEXT
unescape_amp 'È' 200. "#EC NOTEXT
unescape_amp 'É' 201. "#EC NOTEXT
unescape_amp 'Ê' 202. "#EC NOTEXT
unescape_amp 'Ë' 203. "#EC NOTEXT
unescape_amp 'Ì' 204. "#EC NOTEXT
unescape_amp 'Í' 205. "#EC NOTEXT
unescape_amp 'Î' 206. "#EC NOTEXT
unescape_amp 'Ï' 207. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'Ð' 208. "#EC NOTEXT
unescape_amp 'Ñ' 209. "#EC NOTEXT
unescape_amp 'Ò' 210. "#EC NOTEXT
unescape_amp 'Ó' 211. "#EC NOTEXT
unescape_amp 'Ô' 212. "#EC NOTEXT
unescape_amp 'Õ' 213. "#EC NOTEXT
unescape_amp 'Ö' 214. "#EC NOTEXT
unescape_amp '×' 215. "#EC NOTEXT
unescape_amp 'Ø' 216. "#EC NOTEXT
unescape_amp 'Ù' 217. "#EC NOTEXT
unescape_amp 'Ú' 218. "#EC NOTEXT
unescape_amp 'Û' 219. "#EC NOTEXT
unescape_amp 'Ü' 220. "#EC NOTEXT
unescape_amp 'Ý' 221. "#EC NOTEXT
unescape_amp 'Þ' 222. "#EC NOTEXT
unescape_amp 'ß' 223. "#EC NOTEXT
unescape_amp 'à' 224. "#EC NOTEXT
unescape_amp 'á' 225. "#EC NOTEXT
unescape_amp 'â' 226. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'ã' 227. "#EC NOTEXT
unescape_amp 'ä' 228. "#EC NOTEXT
unescape_amp 'å' 229. "#EC NOTEXT
unescape_amp 'æ' 230. "#EC NOTEXT
unescape_amp 'ç' 231. "#EC NOTEXT
unescape_amp 'è' 232. "#EC NOTEXT
unescape_amp 'é' 233. "#EC NOTEXT
unescape_amp 'ê' 234. "#EC NOTEXT
unescape_amp 'ë' 235. "#EC NOTEXT
unescape_amp 'ì' 236. "#EC NOTEXT
unescape_amp 'í' 237. "#EC NOTEXT
unescape_amp 'î' 238. "#EC NOTEXT
unescape_amp 'ï' 239. "#EC NOTEXT
unescape_amp 'ð' 240. "#EC NOTEXT
unescape_amp 'ñ' 241. "#EC NOTEXT
unescape_amp 'ò' 242. "#EC NOTEXT
unescape_amp 'ó' 243. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'ô' 244. "#EC NOTEXT
unescape_amp 'õ' 245. "#EC NOTEXT
unescape_amp 'ö' 246. "#EC NOTEXT
unescape_amp '÷' 247. "#EC NOTEXT
unescape_amp 'ø' 248. "#EC NOTEXT
unescape_amp 'ù' 249. "#EC NOTEXT
unescape_amp 'ú' 250. "#EC NOTEXT
unescape_amp 'û' 251. "#EC NOTEXT
unescape_amp 'ü' 252. "#EC NOTEXT
unescape_amp 'ý' 253. "#EC NOTEXT
unescape_amp 'þ' 254. "#EC NOTEXT
unescape_amp 'ÿ' 255. "#EC NOTEXT
unescape_amp 'ƒ' 402. "#EC NOTEXT
unescape_amp 'Α' 913. "#EC NOTEXT
unescape_amp 'Β' 914. "#EC NOTEXT
unescape_amp 'Γ' 915. "#EC NOTEXT
unescape_amp 'Δ' 916. "#EC NOTEXT
unescape_amp 'Ε' 917. "#EC NOTEXT
unescape_amp 'Ζ' 918. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'Η' 919. "#EC NOTEXT
unescape_amp 'Θ' 920. "#EC NOTEXT
unescape_amp 'Ι' 921. "#EC NOTEXT
unescape_amp 'Κ' 922. "#EC NOTEXT
unescape_amp 'Λ' 923. "#EC NOTEXT
unescape_amp 'Μ' 924. "#EC NOTEXT
unescape_amp 'Ν' 925. "#EC NOTEXT
unescape_amp 'Ξ' 926. "#EC NOTEXT
unescape_amp 'Ο' 927. "#EC NOTEXT
unescape_amp 'Π' 928. "#EC NOTEXT
unescape_amp 'Ρ' 929. "#EC NOTEXT
unescape_amp 'Σ' 931. "#EC NOTEXT
unescape_amp 'Τ' 932. "#EC NOTEXT
unescape_amp 'Υ' 933. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'Φ' 934. "#EC NOTEXT
unescape_amp 'Χ' 935. "#EC NOTEXT
unescape_amp 'Ψ' 936. "#EC NOTEXT
unescape_amp 'Ω' 937. "#EC NOTEXT
unescape_amp 'α' 945. "#EC NOTEXT
unescape_amp 'β' 946. "#EC NOTEXT
unescape_amp 'γ' 947. "#EC NOTEXT
unescape_amp 'δ' 948. "#EC NOTEXT
unescape_amp 'ε' 949. "#EC NOTEXT
unescape_amp 'ζ' 950. "#EC NOTEXT
unescape_amp 'η' 951. "#EC NOTEXT
unescape_amp 'θ' 952. "#EC NOTEXT
unescape_amp 'ι' 953. "#EC NOTEXT
unescape_amp 'κ' 954. "#EC NOTEXT
unescape_amp 'λ' 955. "#EC NOTEXT
unescape_amp 'μ' 956. "#EC NOTEXT
unescape_amp 'ν' 957. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'ξ' 958. "#EC NOTEXT
unescape_amp 'ο' 959. "#EC NOTEXT
unescape_amp 'π' 960. "#EC NOTEXT
unescape_amp 'ρ' 961. "#EC NOTEXT
unescape_amp 'ς' 962. "#EC NOTEXT
unescape_amp 'σ' 963. "#EC NOTEXT
unescape_amp 'τ' 964. "#EC NOTEXT
unescape_amp 'υ' 965. "#EC NOTEXT
unescape_amp 'φ' 966. "#EC NOTEXT
unescape_amp 'χ' 967. "#EC NOTEXT
unescape_amp 'ψ' 968. "#EC NOTEXT
unescape_amp 'ω' 969. "#EC NOTEXT
unescape_amp 'ϑ' 977. "#EC NOTEXT
unescape_amp 'ϒ' 978. "#EC NOTEXT
unescape_amp 'ϖ' 982. "#EC NOTEXT
unescape_amp '•' 8226. "#EC NOTEXT
unescape_amp '…' 8230. "#EC NOTEXT
unescape_amp '′' 8242. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp '″' 8243. "#EC NOTEXT
unescape_amp '‾' 8254. "#EC NOTEXT
unescape_amp '⁄' 8260. "#EC NOTEXT
unescape_amp '℘' 8472. "#EC NOTEXT
unescape_amp 'ℑ' 8465. "#EC NOTEXT
unescape_amp 'ℜ' 8476. "#EC NOTEXT
unescape_amp '™' 8482. "#EC NOTEXT
unescape_amp 'ℵ' 8501. "#EC NOTEXT
unescape_amp '←' 8592. "#EC NOTEXT
unescape_amp '↑' 8593. "#EC NOTEXT
unescape_amp '→' 8594. "#EC NOTEXT
unescape_amp '↓' 8595. "#EC NOTEXT
unescape_amp '↔' 8596. "#EC NOTEXT
unescape_amp '↵' 8629. "#EC NOTEXT
unescape_amp '⇐' 8656. "#EC NOTEXT
unescape_amp '⇑' 8657. "#EC NOTEXT
unescape_amp '⇒' 8658. "#EC NOTEXT
unescape_amp '⇓' 8659. "#EC NOTEXT
unescape_amp '⇔' 8660. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp '∀' 8704. "#EC NOTEXT
unescape_amp '∂' 8706. "#EC NOTEXT
unescape_amp '∃' 8707. "#EC NOTEXT
unescape_amp '∅' 8709. "#EC NOTEXT
unescape_amp '∇' 8711. "#EC NOTEXT
unescape_amp '∈' 8712. "#EC NOTEXT
unescape_amp '∉' 8713. "#EC NOTEXT
unescape_amp '∋' 8715. "#EC NOTEXT
unescape_amp '∏' 8719. "#EC NOTEXT
unescape_amp '∑' 8721. "#EC NOTEXT
unescape_amp '−' 8722. "#EC NOTEXT
unescape_amp '∗' 8727. "#EC NOTEXT
unescape_amp '√' 8730. "#EC NOTEXT
unescape_amp '∝' 8733. "#EC NOTEXT
unescape_amp '∞' 8734. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp '∠' 8736. "#EC NOTEXT
unescape_amp '∧' 8743. "#EC NOTEXT
unescape_amp '∨' 8744. "#EC NOTEXT
unescape_amp '∩' 8745. "#EC NOTEXT
unescape_amp '∪' 8746. "#EC NOTEXT
unescape_amp '∫' 8747. "#EC NOTEXT
unescape_amp '∴' 8756. "#EC NOTEXT
unescape_amp '∼' 8764. "#EC NOTEXT
unescape_amp '≅' 8773. "#EC NOTEXT
unescape_amp '≈' 8776. "#EC NOTEXT
unescape_amp '≠' 8800. "#EC NOTEXT
unescape_amp '≡' 8801. "#EC NOTEXT
unescape_amp '≤' 8804. "#EC NOTEXT
unescape_amp '≥' 8805. "#EC NOTEXT
unescape_amp '⊂' 8834. "#EC NOTEXT
unescape_amp '⊃' 8835. "#EC NOTEXT
unescape_amp '⊄' 8836. "#EC NOTEXT
unescape_amp '⊆' 8838. "#EC NOTEXT
unescape_amp '⊇' 8839. "#EC NOTEXT
unescape_amp '⊕' 8853. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp '⊗' 8855. "#EC NOTEXT
unescape_amp '⊥' 8869. "#EC NOTEXT
unescape_amp '⋅' 8901. "#EC NOTEXT
unescape_amp '⌈' 8968. "#EC NOTEXT
unescape_amp '⌉' 8969. "#EC NOTEXT
unescape_amp '⌊' 8970. "#EC NOTEXT
unescape_amp '⌋' 8971. "#EC NOTEXT
unescape_amp '⟨' 9001. "#EC NOTEXT
unescape_amp '⟩' 9002. "#EC NOTEXT
unescape_amp '◊' 9674. "#EC NOTEXT
unescape_amp '♠' 9824. "#EC NOTEXT
unescape_amp '♣' 9827. "#EC NOTEXT
unescape_amp '♥' 9829. "#EC NOTEXT
unescape_amp '♦' 9830. "#EC NOTEXT
unescape_amp '"' 34. "#EC NOTEXT
unescape_amp '&' 38. "#EC NOTEXT
unescape_amp '<' 60. "#EC NOTEXT
unescape_amp '>' 62. "#EC NOTEXT
unescape_amp 'Œ' 338. "#EC NOTEXT
unescape_amp 'œ' 339. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp 'Š' 352. "#EC NOTEXT
unescape_amp 'š' 353. "#EC NOTEXT
unescape_amp 'Ÿ' 376. "#EC NOTEXT
unescape_amp 'ˆ' 710. "#EC NOTEXT
unescape_amp '˜' 732. "#EC NOTEXT
unescape_amp ' ' 8194. "#EC NOTEXT
unescape_amp ' ' 8195. "#EC NOTEXT
unescape_amp ' ' 8201. "#EC NOTEXT
unescape_amp '‌' 8204. "#EC NOTEXT
unescape_amp '‍' 8205. "#EC NOTEXT
unescape_amp '‎' 8206. "#EC NOTEXT
unescape_amp '‏' 8207. "#EC NOTEXT
unescape_amp '–' 8211. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
unescape_amp '—' 8212. "#EC NOTEXT
unescape_amp '‘' 8216. "#EC NOTEXT
unescape_amp '’' 8217. "#EC NOTEXT
unescape_amp '‚' 8218. "#EC NOTEXT
unescape_amp '“' 8220. "#EC NOTEXT
unescape_amp '”' 8221. "#EC NOTEXT
unescape_amp '„' 8222. "#EC NOTEXT
unescape_amp '†' 8224. "#EC NOTEXT
unescape_amp '‡' 8225. "#EC NOTEXT
unescape_amp '‰' 8240. "#EC NOTEXT
unescape_amp '‹' 8249. "#EC NOTEXT
unescape_amp '›' 8250. "#EC NOTEXT
unescape_amp '€' 8364. "#EC NOTEXT
CHECK ev_unescaped CP '*&*;*'. "#EC NOTEXT
总结
通过解析得到返回结果,之后再进行后续处理即可。