高手请进,关于webservice

softwarewl 2007-07-06 09:23:06
我想用java调用.net 的webservice 遇到问题如下:
Service.cs
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

[WebService(Namespace = "http://www.wl.com/SU")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
public Service () {

//如果使用设计的组件,请取消注释以下行
//InitializeComponent();
}
[System.Web.Services.Protocols.SoapRpcMethodAttribute(Action = "http://www.wl.com/Rpc", RequestNamespace = "http://www.wl.com/SU", ResponseNamespace = "http://www.wl.com/SU")]

[WebMethod]
public string HelloWorld(string ls_aa,string ip) {
string tt = "";
if (ls_aa == "" || ls_aa == null) tt = "哭哭哭哭";
return "Hello World" + ls_aa + ip + tt;
}

}

//声明:soaprpcmethod
[System.Web.Services.Protocols.SoapRpcMethodAttribute(Action = "http://www.wl.com/Rpc", RequestNamespace = "http://www.wl.com/SU", ResponseNamespace = "http://www.wl.com/SU")]


此时报错,服务所启的页面中:应用程序中的服务器错误。
要使其一致,请更改服务的实现方法以使用“rpc-literal”或“document-literal”SOAP 消息。您需要将显式的 <font class=value>Use=SoapBindingUse.Literal</font> 属性添加到所有服务和方法级别的特性中: SoapRpcService、SoapRpcMethod、SoapDocumentService 和 SoapDocumentMethod


在线等。。。。
...全文
168 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
onekey 2007-07-06
  • 打赏
  • 举报
回复
soap用soapextion:
http://blog.csdn.net/book_coolboy_cl/archive/2007/04/06/1554014.aspx
kuangyc 2007-07-06
  • 打赏
  • 举报
回复
帮顶
onekey 2007-07-06
  • 打赏
  • 举报
回复
[WebService(Namespace = "http://www.wl.com/SU")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

把这些去掉
zhnzzy 2007-07-06
  • 打赏
  • 举报
回复
没用过.java帮你顶

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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