怪!在 ASP.NET 中调用Web Service的一个很怪的问题,请高手指教!(高分)

bin_bin 2003-08-03 06:36:59
我做了一个Web Service,然后在ASP.NET页面中调用,
try
Dim upload As New localhost.QTServices()
upload.WriteArticle(ArticleTitle, ArticleContent, AreaID, _
StyleID, writer, PictureID, BgID, 0)
Catch ex2 As Exception
Throw New AppException(ex2.ToString)
End Try


程序能经过try里的程序,但执行完后又进入了catch 抛出异常,实际上更本就没有执行.
出错提示如下:
----------------------------------------------------
System.Threading.ThreadAbortException: 线程正被中止。
at System.Threading.Thread.AbortInternal()
at System.Threading.Thread.Abort(Object stateInfo)
at System.Web.HttpResponse.End()
at System.Web.HttpResponse.Redirect(String url, Boolean endResponse)
at System.Web.HttpResponse.Redirect(String url)
at QingTeng.Upload.ImageButton1_Click(Object sender, ImageClickEventArgs e) in G:\inetpub\wwwroot\School_Web\Web\QingTeng\Upload\Upload.aspx.vb:line 198</pre>




请高手执教!
...全文
43 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cyp503 2003-08-06
  • 打赏
  • 举报
回复
WriteArticle

方法有问题,请采用逐步跟踪

lyrixliu 2003-08-06
  • 打赏
  • 举报
回复
应该是WriteArticle方法有问题。调用web service好像是异步的
infofox 2003-08-05
  • 打赏
  • 举报
回复
看不出
ETstudio 2003-08-05
  • 打赏
  • 举报
回复
看看是不是最后一句错了
liubiqu 2003-08-04
  • 打赏
  • 举报
回复
看来你的调试经骓不够
下面这句出错。
upload.WriteArticle(ArticleTitle, ArticleContent, AreaID, _
StyleID, writer, PictureID, BgID, 0)

正如楼上那位同志说的那样,
bin_bin 2003-08-03
  • 打赏
  • 举报
回复
TRY 里的全部都执行的,执行完再进入CATCH的,好奇怪!
panyee 2003-08-03
  • 打赏
  • 举报
回复
在catch前面再加随便加一句
Dim str As String = "hello"

看跟踪时是否会运行它?

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧