51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 3897|回复: 2
打印 上一主题 下一主题

OpenSTA 怎么post xml内容的body

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-1-12 16:31:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请哪位大侠说明一下怎么写下面这个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中,总是提示语法错误。该怎么写?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 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> 表示双引号。
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2010-3-15 16:49:08 | 只看该作者
谢谢分享
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-3 14:55 , Processed in 0.068752 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表