|
IWAB0379E Unable to open http://localhost:8080/WebServiceProject/CalculatorPort?WSDL.
IWAB0135E An unexpected error has occurred.
WSDLException
WSDLException: faultCode=OTHER_ERROR: http://localhost:8080/WebServiceProject/CalculatorPort?WSDL
Does anyone know what this means?
|
|
|
|
|
|
hi everybody
(SORRY FOR MY BAD ENGLISH)
i want to send something from mobile application wrote in J2ME to web server wrote in JSP with JAVA Servlet
my question is how to get the string sent from J2ME to Web Server
the code for J2ME is
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
public class midle extends MIDlet implements CommandListener {
private static String defalutUrl="http://localhost:8080/DeleteWebApplication/RomaServlet";
private Display myDisplay=null;
private Form mainScreen;
private TextField requestField;
private Form resultScreen;
private StringItem resultField;
Command sendCommand = new Command("SEND", Command.OK, 1);
Command backCommand = new Command("BACK", Command.OK, 1);
public midle() {
myDisplay=Display.getDisplay(this);
mainScreen=new Form("ROMA4EVER");
requestField=new TextField("enter a string please", "", 100, TextField.ANY);
mainScreen.append(requestField);
mainScreen.addCommand(sendCommand);
mainScreen.setCommandListener(this);
}
public void commandAction(Command c, Displayable d) {
if(c==sendCommand){
String requestString= requestField.getString();
String resultString= sendPostRequest(requestString);
resultScreen=new Form("Azzuri");
resultField=new StringItem(null,resultString);
resultScreen.append(resultField);
resultScreen.addCommand(backCommand);
resultScreen.setCommandListener(this);
myDisplay.setCurrent(resultScreen);
}else{
if(c==backCommand){
requestField.setString("SOMETHING GOOD");
myDisplay.setCurrent(mainScreen);
}else{
}
}
}
public String sendPostRequest(String requestString){
HttpConnection hc=null;
DataInputStream dis=null;
DataOutputStream dos=null;
StringBuffer messagebuffer=new StringBuffer();
try {
hc=(HttpConnection)Connector.open(defalutUrl,Connector.READ_WRITE);
hc.setRequestMethod(HttpConnection.POST);
dos=hc.openDataOutputStream();
byte[] requst_budy=requestString.getBytes();
for(int i=0;i<requst_budy.length;i++){
dos.writeByte(requst_budy[i]);
}
dos.flush();
dos.close();
dis=new DataInputStream(hc.openInputStream());
int ch;
long len=hc.getLength();
if(len!=-1){
for(int i=0;i<len;i++)
if((ch=dis.read())!=-1){
messagebuffer.append((char)ch);
}else{
while((ch=dis.read())!=-1){
messagebuffer.append((char)ch);
}
}
}
dis.close();
} catch (IOException ioe) {
messagebuffer.append("ERROR!");
}finally{
try {
if(hc!=null)
hc.close();
} catch (Exception e) {
}
try {
if(dis!=null)
dis.close();
} catch (Exception e) {
}
try {
if(dos!=null)
dos.close();
} catch (Exception e) {
}
return messagebuffer.toString();
}
}
protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
protected void startApp() throws MIDletStateChangeException {
myDisplay.setCurrent(mainScreen);
}
}
the code for web Server is
package web;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class RomaServlet extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String username=request.getParameter(null);
PrintWriter out = response.getWriter();
String totti="";
for(int i=username.length()-1;i>=0;i--){
totti=totti+username.charAt(i);
}
System.out.println(request.getParameterMap().size());
try {
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet RomaServlet</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet RomakServlet at " +totti+ "</h1>");
out.println("</body>");
out.println("</html>");
} finally {
out.close();
}
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
@Override
public String getServletInfo() {
return "Short description";
}
}
in the web server code what should i do to receive the message sent from J2ME application
thank you very much
|
|
|
|
|
You have to call a method (public, web method) in your web server from the app with passing the arguments.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
would you give me an example
thank you
|
|
|
|
|
|
hello friends
i want to devloped a IDE for java and in that project we create a user interface for java user.it will automaitally generate a code for desinger a frame.
i am facing a problem how to perform drag operation
like in vb we are place a button and by using drag operation we set location and by resizing we set size of componeds
so that type of task i am performing if any body knowing this please help me.
|
|
|
|
|
|
hi friends,
i am doing a project of Java IDE.i am facing a problem for saving the frame.In that frame the components which we have used can be call anytime after saving it,but it is not happening.
for ex: in visual basic we can save the form which has a extensiotn.vb.when we click it,it opens automatically in VB.
Like that i also want such type of IDE for java and i am facing such a problem.
please can anybody Help me for that..................
|
|
|
|
|
If I understood you correctly, you should Google "file association".
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
|
hello,
plz send me the full code in J2SE for using Web Services "sending sms from Net to Mobile"...
|
|
|
|
|
No!
Please, at least make an effort to do your own work.
|
|
|
|
|
Oh come on - we could at least ask him, what he is willing to pay
But I second that he should have made directly a high, not to be misunderstanding, kind of overwhelming financial offer...
I would do it for the same amount the Winkelvoss-Brothers got from Facebook. Sounds like a fair price for me.
regards
Torsten
I never finish anyth...
|
|
|
|
|
hi how are you today
(SORRY FOR MY BAD ENGLISH)
i don't know what this question about.. maybe it is about versions of NetBeans..
i want to sent something from Mobile Application using J2ME to a Server and then send a response from Server to Mobile
so i found a video tutorial in Youtube , and it is very useful to help me the first steps in my project
but the problem that in the video , he (the makers of video) begins with new project and he selected an "Enterprise" project ..
and then he complete his works with building a new Session ..
in my NetBeans there is no "Enterprise" project option , i mean when i make a new project i don't found an Enterprise project..
i think that J2EE solves the problem, but in J2EE there is no Session option
how can i allow my NetBeans to built an "Enterprise" project?
thank you all
|
|
|
|
|
i found the solution
thank you all
|
|
|
|
|
there is a J2EE option stand at 3rd in the new project list.
|
|
|
|
|
anyone help me ... iwant to make tranparent jcombobox with netbean.... help
|
|
|
|
|
I suggest you read the forum guidelines, i.e. the top message of this forum. It will help you asking about your problem in such a way that you may get useful answers.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Drag the object onto your JPanel or wherever you want it and then try adjusting the properties[^].
|
|
|
|
|
try
private JComboBox one;
one = new JComboBox();
one.setOpaque(false);
one.setVisible(true);
one.setBorder(new EtchedBorder());
if it does'nt work try:
one.setBackground(new Color(0, 0, 0, 0));
|
|
|
|
|
hi for all
(SORRY FOR MY BAD ENGLISH)
i am really thank you all because you always help me
today i am working in sending something from mobile using J2ME to localhost
i put the defalutUrl="http://localhost" is this right?
and how to the bytes (that i sent) to localhost ,
i read that the class "HttpServlet" and its functions is important to me is this right?
the most important thing is how to receive to localhost and should i make a php page to receive the bytes i sent?
this is the code
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
public class midle extends MIDlet implements CommandListener {
private static String defalutUrl="http://localhost";
private Display myDisplay=null;
private Form mainScreen;
private TextField requestField;
private Form resultScreen;
private StringItem resultField;
Command sendCommand = new Command("SEND", Command.OK, 1);
Command backCommand = new Command("BACK", Command.OK, 1);
public midle() {
myDisplay=Display.getDisplay(this);
mainScreen=new Form("Type in a string:");
requestField=new TextField(null, "TOTTI ", 100, TextField.ANY);
mainScreen.append(requestField);
mainScreen.addCommand(sendCommand);
mainScreen.setCommandListener(this);
}
public void commandAction(Command c, Displayable d) {
if(c==sendCommand){
String requestString= requestField.getString();
String resultString= sendPostRequest(requestString);
resultScreen=new Form("result String");
resultField=new StringItem(null,resultString);
resultScreen.append(resultField);
resultScreen.addCommand(backCommand);
resultScreen.setCommandListener(this);
myDisplay.setCurrent(resultScreen);
}else{
if(c==backCommand){
requestField.setString("SOMETHING GOOD");
myDisplay.setCurrent(mainScreen);
}else{
}
}
}
public String sendPostRequest(String requestString){
HttpConnection hc=null;
DataInputStream dis=null;
DataOutputStream dos=null;
StringBuffer messagebuffer=new StringBuffer();
try {
hc=(HttpConnection)Connector.open(defalutUrl,Connector.READ_WRITE);
hc.setRequestMethod(HttpConnection.POST);
dos=hc.openDataOutputStream();
byte[] requst_budy=requestString.getBytes();
for(int i=0;i<requst_budy.length;i++){
dos.writeByte(requst_budy[i]);
}
dos.flush();
dos.close();
dis=new DataInputStream(hc.openInputStream());
int ch;
long len=hc.getLength();
if(len!=-1){
for(int i=0;i<len;i++)
if((ch=dis.read())!=-1){
messagebuffer.append((char)ch);
}else{
while((ch=dis.read())!=-1){
messagebuffer.append((char)ch);
}
}
}
dis.close();
} catch (IOException ioe) {
messagebuffer.append("ERROR!");
}finally{
try {
if(hc!=null)
hc.close();
} catch (Exception e) {
}
try {
if(dis!=null)
dis.close();
} catch (Exception e) {
}
try {
if(dos!=null)
dos.close();
} catch (Exception e) {
}
return messagebuffer.toString();
}
}
protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
protected void startApp() throws MIDletStateChangeException {
myDisplay.setCurrent(mainScreen);
}
}
thank you very much
|
|
|
|
|
it is not working. i am getting below error. Kindly provide code in zip for both sending and receiving SMS in java Midlet.
Thanks in advance
|
|
|
|
|
hi for all
(SORRY FOR MY BAD ENGLISH)
i am studing J2EE when i being studing in the tutorial i fount this
1. Choose FileNew Project. In the Categories tree, choose Web. Under
Projects, choose Web Application. Click Next.
2. In the Project Name field, type helloservice. In the Project Location
field, browse to the location where all your projects are stored. In the
Server field, make sure that the Sun Java System Application Server Platform
Edition is selected. (If the Sun Java System Application Server is not
available in the Server field, you need to register it in the IDE. Choose
ToolsServer Manager to do so.) Click Finish.
i use NetBeans IDE 6.7
in the step two , i don't fount the selected area Sun Java System Application
and i don't found tools Server
what sould i do
have i to install another Netbeans?
thank you all
|
|
|
|
|
You don't have to re-install Netbeans to fix the issue. You may have forgotten to install the Web Server with the original installation. So you will have to add one manually using the Tools -> Server Manager.
If you can't find an web server on your computer and you don't know how to install one manually, rerunning the netbeans installer will provide you the option to install one. Please note that you should have installed the Netbeans IDE for Java (Netbeans 6.9.1 Java Edition[^])
|
|
|
|