51tester 发表于 2010-1-12 16:31:48

OpenSTA 怎么post xml内容的body

请哪位大侠说明一下怎么写下面这个body,非常感谢!
'====下面是body的内容====

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.webmethods.com/test" xmlns:types="http://www.webmethods.com/test" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><tns:HATest xmlns:tns="http://www.webmethods.com/test"/></soap:Body></soap:Envelope>

'===End======

PRIMARY POST URI "http://172.31.113.180:5000/soap/rpc HTTP/1.0" ON 1 &
                HEADER DEFAULT_HEADERS &
                ,WITH {"Accept: */*", &       
                        "Accept-Language: zh-cn", &
                        "Content-Type: text/xml; charset=ISO-8859-1", &
                        "Content-Length: 473", &
                        "Authorization: Basic QWRtaW5pc3RyYXRvcjptYW5hZ2U="+strAuthBlob, &
                        "Connection: Keep-Alive", &
                        "Pragma: no-cache"}               &
                ,BODY "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.webmethods.com/test" xmlns:types="http://www.webmethods.com/test" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><tns:HATest xmlns:tns="http://www.webmethods.com/test"/></soap:Body></soap:Envelope>"

直接这样放在body中,总是提示语法错误。该怎么写?

51tester 发表于 2010-1-13 16:38:09

回复 1# 的帖子

没人响应,自己回答吧。

主要是不知道SCL语法对特殊字符怎么处理,所以导致错误。正确的写法:

,BODY "<soap:Envelope xmlns:soap=~<22>http://schemas.xmlsoap.org/soap/envelope/~<22>" &
                " xmlns:xsi=~<22>http://www.w3.org/2001/XMLSchema-instance~<22>" &
                " xmlns:xsd=~<22>http://www.w3.org/2001/XMLSchema~<22>" &
                " xmlns:tns=~<22>http://www.webmethods.com/test~<22>" &
                " xmlns:types=~<22>http://www.webmethods.com/test~<22>" &
                " xmlns:soapenc=~<22>http://schemas.xmlsoap.org/soap/encoding/~<22>>" &
                "<soap:Body soap:encodingStyle=~<22>http://schemas.xmlsoap.org/soap/encoding/~<22>>" &
                "<tns:HATest xmlns:tns=~<22>http://www.webmethods.com/test~<22>/>" &
                "</soap:Body></soap:Envelope>"

~<22> 表示双引号。

rulu005 发表于 2010-3-15 16:49:08

谢谢分享
页: [1]
查看完整版本: OpenSTA 怎么post xml内容的body