java调用c# 写的webservices问题
c# 写的webservices如下:
/// <summary>
/// WebServiceIPDA Ver 2.1
/// </summary>
[WebService(Namespace = "http://qqbbxpddddd.xicp.net/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
// [System.Web.Script.Services.ScriptService]
public class WebServiceIPDA : System.Web.Services.WebService
{
/// <summary>
/// 数据库连接字符串
/// </summary>
private string _ConnectionStr;
/// <summary>
/// 数据库连接对象
/// </summary>
private MMS.Public.DbAccLibry.DbAccess DataBaseSrvConn;
/// <summary>
/// 构造函数
/// </summary>
public WebServiceIPDA()
{
//MMS.Public.DbAccLibry.Config cfg = new MMS.Public.DbAccLibry.Config();
//cfg.ConfigType = MMS.Public.DbAccLibry.ConfigFileType.AppConfig;
//string sysConfigFile="web.config";
_ConnectionStr = "Server=localhost;Database=jcSystemData;User ID=sa;Password=newman2007;Connect Timeout=50;Pooling=True;Min Pool Size=1;Max Pool Size=100;Persist Security Info=False;Asynchronous Processing=true;Integrated Security=false;";
//_ConnectionStr=System.Configuration.ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
//_ConnectionStr=cfg.GetConfigValue(sysConfigFile, "connectionString").ToString();
DataBaseSrvConn = new MMS.Public.DbAccLibry.DbAccess();
DataBaseSrvConn.DatabaseInint(MMS.Public.DbAccLibry.DataBaseType.MsSqlServer, _ConnectionStr);
}
/// <summary>
/// 业务员登录
/// </summary>
/// <param name="aUserID">业务员编号</param>
/// <param name="aPWD">业务密码</param>
/// <returns>成功返回:'T',失败返回'F'</returns>
[WebMethod]
public string Login(string aUserID, string aPWD)
{
string result = "T";
try
{
IDataParameter[] parms = new SqlParameter[] { new SqlParameter("@v_UserID", aUserID), new SqlParameter("@v_PWD", aPWD) };
DataSet dsLogin = DataBaseSrvConn.ExecuteDataSet(CommandType.StoredProcedure, "jcp_CheckBusLogin", parms);
if (!(dsLogin.Tables[0] != null && dsLogin.Tables[0].Rows[0]["Result"].ToString().Trim() == "T"))
{
result = "F";
}
}
catch
{
result = "F";
}
return result;
}
}
c#调用方法:
IPADWebservicesTest.ServiceReference1.WebServiceIPDASoapClient my = new IPADWebservicesTest.ServiceReference1.WebServiceIPDASoapClient();
string flag = my.Login("00001", "9:;<=>");
能正常调用并返回
Java调用如下:
String ss=client.login("00001","9:;<=>");
System.out.Printin(ss);
[解决办法]
http://topic.csdn.net/u/20120528/18/52e20ef4-82dd-47c4-8e36-e2342e52cd5a.html