i have created webservice and have some error in this code so please correct the all syntax, i need your help please i have just 3hour for this task, so please solve this problem for me
here is my code please check and give me some error in library like javax please change to C# all library and give me some error in line 7, 8, 9, 10, 38, 39, 58 , & 68
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Collections;
using ServletException = javax.servlet.ServletException;
using HttpServletRequest = javax.servlet.http.HttpServletRequest;
using HttpServletResponse = javax.servlet.http.HttpServletResponse;
using mServlet = com.maaco.server.mServlet;
using System.Xml.XPath;
using System.Xml.Schema;
using System.Xml.Xsl;
using System.IO;
[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 virtual void service(HttpServletRequest req, HttpServletResponse res)
{
try
{
ArrayList wlogMsg = new ArrayList();
string wresponse = "OK";
try
{
Console.WriteLine("parser count " + XmlTransferParser.parserCount);
XmlTransferParser wrequestProcessor = new XmlTransferParser(wlogMsg);
wrequestProcessor.generateDecodedXmlPages(req.Reader);
wresponse = wrequestProcessor.ZipedAndEncryptedResponse;
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.Write(ex.StackTrace);
}
StreamWriter @out = new StreamWriter(res.OutputStream);
@out.WriteLine(wresponse);
@out.Flush();
@out.Close();
}
catch (Exception e)
{
try
{
StreamWriter @out = new StreamWriter(res.OutputStream);
e.printStackTrace(@out);
@out.Flush();
@out.Close();
}
catch (Exception ex)
{
}
}
finally
{
XmlTransferParser.parserCount--;
}
}
}
line 7 : using ServletException = javax.servlet.ServletException;
line 8: using HttpServletRequest = javax.servlet.http.HttpServletRequest;
line 9: using HttpServletResponse = javax.servlet.http.HttpServletResponse;
line 10: using mServlet = com.maaco.server.mServlet;
read the code and then create the webservices in C# asp.net
zubair258, if you're very, very lucky, your peers here at forums.asp.net
might read your code and create a c# version for you.
however, many of your peers here at forums.asp.net are more likely to help you if they see that you're actually making a reasonable effort to help yourself first.
B-) Please help me by completing my school survey about computer programmers on my website. Thank you!!! Gerry Lowry +1 705-429-7550 wasaga beach, ontario, canada
please you create for me i dont understand the java code, thats why i post that code in forum.asp.net, please help me , what says the java code and create the webservices for me please
You ask "how to" but you want someone else to do it for you? Java is not so different from C# it would do you a lot of could to work through it yourself and if not then pay a developer to do it for you. Just my opinion though.
but why make forum.asp.net ? for what purpose ? i am asking from developers, and why we make forums? because to solve the problem for developer, i think you are new in this forum, give me the answer, i know its same code, but you convert this code to C#?
zubair258
Member
112 Points
129 Posts
please any one help me to correct the error in this code, check the syntax
Nov 02, 2012 06:44 PM|LINK
i have created webservice and have some error in this code so please correct the all syntax, i need your help please i have just 3hour for this task, so please solve this problem for me
here is my code please check and give me some error in library like javax please change to C# all library and give me some error in line 7, 8, 9, 10, 38, 39, 58 , & 68
WebService.asmx page
behind code
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Collections; using ServletException = javax.servlet.ServletException; using HttpServletRequest = javax.servlet.http.HttpServletRequest; using HttpServletResponse = javax.servlet.http.HttpServletResponse; using mServlet = com.maaco.server.mServlet; using System.Xml.XPath; using System.Xml.Schema; using System.Xml.Xsl; using System.IO; [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 virtual void service(HttpServletRequest req, HttpServletResponse res) { try { ArrayList wlogMsg = new ArrayList(); string wresponse = "OK"; try { Console.WriteLine("parser count " + XmlTransferParser.parserCount); XmlTransferParser wrequestProcessor = new XmlTransferParser(wlogMsg); wrequestProcessor.generateDecodedXmlPages(req.Reader); wresponse = wrequestProcessor.ZipedAndEncryptedResponse; } catch (Exception ex) { Console.WriteLine(ex.ToString()); Console.Write(ex.StackTrace); } StreamWriter @out = new StreamWriter(res.OutputStream); @out.WriteLine(wresponse); @out.Flush(); @out.Close(); } catch (Exception e) { try { StreamWriter @out = new StreamWriter(res.OutputStream); e.printStackTrace(@out); @out.Flush(); @out.Close(); } catch (Exception ex) { } } finally { XmlTransferParser.parserCount--; } } }ignatandrei
All-Star
134913 Points
21619 Posts
Moderator
MVP
Re: please any one help me to correct the error in this code, check the syntax
Nov 03, 2012 02:35 PM|LINK
What's line 7?
zubair258
Member
112 Points
129 Posts
Re: please any one help me to correct the error in this code, check the syntax
Nov 05, 2012 05:58 PM|LINK
line 7 : using ServletException = javax.servlet.ServletException;
line 8: using HttpServletRequest = javax.servlet.http.HttpServletRequest;
line 9: using HttpServletResponse = javax.servlet.http.HttpServletResponse;
line 10: using mServlet = com.maaco.server.mServlet;
RameshRajend...
Star
7983 Points
2099 Posts
Re: please any one help me to correct the error in this code, check the syntax
Nov 05, 2012 06:04 PM|LINK
Hai
http://stackoverflow.com/questions/8045272/javax-servlet-servletexception-java-lang-noclassdeffounderror-javax-servlet-js
https://jazz.net/forum/questions/82460/receiving-error-500-javaxservletservletexception-content-manager-has-not-been-started-when-trying-to-complete-installation-setup-of-insight-111-rc2
Thank u
Paul Linton
Star
13405 Points
2532 Posts
Re: please any one help me to correct the error in this code, check the syntax
Nov 05, 2012 07:16 PM|LINK
zubair258
Member
112 Points
129 Posts
Re: please any one help me to correct the error in this code, check the syntax
Nov 06, 2012 12:31 PM|LINK
this is java webservices code and please convert to C# webservices code, just change for me , i think you understand my probelm, and please do for me
here is a code below ,
<div>import java.io.FileOutputStream; import java.io.PrintWriter; import java.net.HttpURLConnection; import java.util.Enumeration; import java.util.Properties; import java.util.Vector; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.maaco.server.mServlet; public class ProcessTransferRequest extends mServlet { public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException { try { //PrintWriter wlog = new PrintWriter(new FileOutputStream("C:/temp/xmlLog.txt")); Vector wlogMsg = new Vector(); String wresponse = "OK"; try { System.out.println("parser count "+XmlTransferParser.parserCount); XmlTransferParser wrequestProcessor = new XmlTransferParser( new Properties(), wlogMsg); wrequestProcessor.generateDecodedXmlPages(req.getReader()); //if (wrequestProcessor.isTransactionOK()) { wresponse = wrequestProcessor.getZipedAndEncryptedResponse(); /*} else { res.setStatus(HttpURLConnection.HTTP_BAD_REQUEST); }*/ } catch (Throwable ex) { //ex.printStackTrace(wlog); ex.printStackTrace(); } /* Enumeration wenum = wlogMsg.elements(); if (wenum != null) { while (wenum.hasMoreElements()) { wlog.println((String) wenum.nextElement()); } } wlog.close(); // send response back */ PrintWriter out = new PrintWriter(res.getOutputStream()); out.println(wresponse); out.flush(); out.close(); } catch (Throwable e) { try { PrintWriter out = new PrintWriter(res.getOutputStream()); e.printStackTrace(out); out.flush(); out.close(); } catch (Exception ex) { } } finally { XmlTransferParser.parserCount--; } } } }</div>gerrylowry
All-Star
20513 Points
5712 Posts
Re: how to create webservices in C# about java code
Nov 08, 2012 01:54 PM|LINK
@ zubair258
zubair258, if you're very, very lucky, your peers here at forums.asp.net might read your code and create a c# version for you.
however, many of your peers here at forums.asp.net are more likely to help you if they see that you're actually making a reasonable effort to help yourself first.
http://lmgtfy.com/?q=convert+java+to+c%23
g.
zubair258
Member
112 Points
129 Posts
Re: how to create webservices in C# about java code
Nov 08, 2012 02:11 PM|LINK
please you create for me i dont understand the java code, thats why i post that code in forum.asp.net, please help me , what says the java code and create the webservices for me please
thanks sir
The_Cthulhu_...
Member
7 Points
6 Posts
Re: how to create webservices in C# about java code
Nov 08, 2012 02:23 PM|LINK
You ask "how to" but you want someone else to do it for you? Java is not so different from C# it would do you a lot of could to work through it yourself and if not then pay a developer to do it for you. Just my opinion though.
zubair258
Member
112 Points
129 Posts
Re: how to create webservices in C# about java code
Nov 08, 2012 02:36 PM|LINK
but why make forum.asp.net ? for what purpose ? i am asking from developers, and why we make forums? because to solve the problem for developer, i think you are new in this forum, give me the answer, i know its same code, but you convert this code to C#?