当 XML 扩展就位时,如何在soapUI 中从 XSD 添加 SOAP 模板?
我需要制作大量 SOAP 测试用例来自动化应用程序的测试过程。
目前,该体系结构要求使用通用类型的对象来调用单个“通用”SOAP 方法。每个“实际”操作都由通用对象中的元素定义,并且需要扩展类型的对象用作输入。
当我使用soapUI创建请求模板时,我只获得通用对象元素,但我想为要使用的当前架构中定义的特定XSD类型添加空模板。
如果我使用xsi:type
,那么soapUI会正确地说我的标记对于架构无效(缺少必需的元素),但我无法设法获得准备填充< /em> XML 模板。
你能帮助我吗?
示例
genericRequest 由 sumReuqest (扩展 genericRequest)组成
<genericRequest>
<methodName>specificMethodName</methodName>
<authenticationID>ABCDEF</authenticationID>
</genericRequest>
,用于“求和”操作
<sumRequest>
<methodName>specificMethodName</methodName>
<authenticationID>ABCDEF</authenticationID>
<addend>5</addend>
<addend>3</addend>
</sumRequest>
我最终希望soapUI用空的 addend 项填充 SOAP 模板(当然我使用很多元素,而且它们也是结构化的!!)
I need to make a large number of SOAP test cases to automate the testing process of an application.
Currently, the architecture requires that a single "generic" SOAP method is invoked with an object of a generic type. Each "real" operation is defined by an element in the generic object and requires an object of an extended type to be used as input.
When I create the request template with soapUI, I only get the generic object elements, but I would like to add the empty template for a specific XSD type that is defined in my current schema to be used.
If I use xsi:type
then soapUI correctly says that my markup is not valid against the schema (missing required elements), but I can't manage to get a ready-to-fill XML template.
Can you help me?
Example
genericRequest is made of
<genericRequest>
<methodName>specificMethodName</methodName>
<authenticationID>ABCDEF</authenticationID>
</genericRequest>
sumReuqest (extending genericRequest) for a "sum" operation is made of
<sumRequest>
<methodName>specificMethodName</methodName>
<authenticationID>ABCDEF</authenticationID>
<addend>5</addend>
<addend>3</addend>
</sumRequest>
I would ultimately like soapUI to fill a SOAP template with empty addend item (of course I work with lots of elements, and they are structured too!!)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这种情况下,您需要在soaupUI中创建两个资源,一个用于通用请求,另一个用于操作请求,我知道现在为每个操作创建每个资源很痛苦,但是soapUI是这样开发的,或者如果您认为列出的任何参数:http://www.soapui.org/REST-Testing/understanding-rest-parameters.html 可以提供帮助,您可以将参数定义为上述之一。
您可以尝试在资源中使用 QUERY 或 MATRIX 样式参数。
In this case you need to create two resources in soaupUI one for generic request and other for operation request, I know right now its pain to create each resource for each operation, but soapUI is developed like that or if you think any of the parameters listed : http://www.soapui.org/REST-Testing/understanding-rest-parameters.html could help, you could define parameters as one of the above.
you could try using QUERY or MATRIX style parameters in your resource.