在会话SOAP UI Web服务检查 [英] Web Service check in SOAP UI with Session

查看:163
本文介绍了在会话SOAP UI Web服务检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有NET 3.5的一个简单的Web服务,其中有的HelloWorld()的方法如下

I have a simple web-service on .Net 3.5 in which there is a method of HelloWorld() as below

[WebMethod(EnableSession=true)]
public string HelloWorld() {
    if (Session["Count"] == null) { Session["Count"] = 1; }
    Session["Count"] = Convert.ToInt32(Session["Count"]) + 1;
    return "Hello World " + Session["Count"];
}

这工作在ASP.NET Web浏览器和IIS,并返回输出的Hello World 1,2,3,4,很快.... 取决于多少页打开或刷新。

which works in ASP.NET web-browser and IIS and returns output Hello World 1, 2, 3, 4 and soon.... depend on how much page open or refresh.

在根据一段时间的项目要求我使用SOAPUI工具(Web服务的测试)。结果
我在SOAPUI创建新项目,并插入服务的URL样
HTTP://www.myservices/service.asmx WSDL

After some time according to requirement of project i was used SOAPUI tool (for testing of web service).
I create new project in SOAPUI and insert the url of service like http://www.myservices/service.asmx?wsdl

在SOAPUI有同名的方法,但是当我打开每一次执行它会创建一个新的会话。意味着它的收益我的Hello World 1,1,1,1 在所有的时间,不能保持会话。

In SOAPUI there is a method with same name but when i execute it the open every time it creates a new session. means its returns me Hello World 1, 1, 1, 1 at all the time, not maintain Sessions.

不过,我需要保持服务的测试会话。结果
谢谢你。

However i need to maintain the session for the testing of service.
Thank you.

推荐答案

Wiktor的Zychla,谢谢您的帮助,我终于发现,我们如何在SOAP UI处理会话。

Wiktor Zychla, Thank you for your help finally i find that how do we handle sessions in SOAP UI.

我们需要测试用例添加请求,添加了HTTP测试申请。还要检查维护HTTP会话的选项。
编号:的http://beforedikshaforgets.blogspot.com/2011/08/soap-ui-creating-test-case.html

We need to Add Request in testCase, add HTTP Test Request. also check the option of Maintain HTTP session. Ref: http://beforedikshaforgets.blogspot.com/2011/08/soap-ui-creating-test-case.html

此外,根据我的理解没有在SOAPUI 4.0中的错误,所以我对SOAOUI 4.5改变我的服务,为维护会话

Furthermore according to my understanding there is a bug in SOAPUI 4.0 so i shift my service on SOAOUI 4.5 for maintaining session

这篇关于在会话SOAP UI Web服务检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆