sir , I am Developing a mobile application for My College using J2ME(Nokia S40). In my Application i want to connect to ASP.NET Webservice to access student Marks and Attendence.I tried it lot of Times and I refered lot of Examples in Google.But i am getting Errors . I need your Help.. Please provide some Support for this
My .NET WebService code is using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Data.SqlClient; [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService] public class Service : System.Web.Services.WebService { public Service () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string GetMarks(string Hallticketno) { SqlConnection cn = new SqlConnection("database=std;User Id=sa;Password=12345678;Server=."); cn.Open(); string sql="select * marks where htno="+"'"+Hallticketno+"'"; SqlCommand cmd = new SqlCommand(sql, cn); string res = ""; SqlDataReader dr=cmd.ExecuteReader(); while (dr.Read()) { res += dr[0].ToString()+","; res += dr[1].ToString(); } dr.Close(); cn.Close(); return res; } } and i configured this webservice under IIS and url is http://localhost/anurag/Service.asmx and it is woking very fine.... now i am trying to connect this webservice using J2ME Application(S40 series ) with the help of NETbeans and My Code is Service_Stub s=new Service_Stub(); s._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, "http://localhost/ravi/Service.asmx"); s._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE); try { getForm().append(s.GetMarks("098233101")); // s.helloWorld(); } catch(Exception ex) { getForm().append(ex.getMessage()); ex.printStackTrace(); } while i am executing this code i am getting Java.io.IOException:40-Error in HTTP Opearion Sir here i am connecting Local webservice not remote webservice. Please kindly give your Support to this. also provide some examples for this -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net
