• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in running the webservice

 
balaji vidhyadharan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,

I am new to the webservice development by reading some mannual in netbeans with sun java server, i had developed a sample webservice. While running the client that consume webservice i getting error

HTTP transport error: java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL; nested exception is: HTTP transport error: java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL


My client code is

import java.io.*;
import java.net.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class NewServlet extends HttpServlet {
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
out.println("Success"+getNewWebServiceSEIPort().operation(" Test"));
} catch(java.rmi.RemoteException ex) {
out.println(ex.getMessage());
}

out.close();
}

protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

private own.NewWebService getNewWebService() {
own.NewWebService newWebService = null;
try {
javax.naming.InitialContext ic = new javax.naming.InitialContext();
newWebService = (own.NewWebService) ic.lookup("java:comp/env/service/NewWebService");
} catch(javax.naming.NamingException ex) {
// TODO handle JNDI naming exception
}
return newWebService;
}

private own.NewWebServiceSEI getNewWebServiceSEIPort() {
own.NewWebServiceSEI newWebServiceSEIPort = null;
try {
newWebServiceSEIPort = getNewWebService().getNewWebServiceSEIPort();
} catch(javax.xml.rpc.ServiceException ex) {
// TODO handle service exception
}
return newWebServiceSEIPort;
}
}

and i had added message handler too.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by balaji vidhyadharan:
HTTP transport error: java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL; nested exception is: HTTP transport error: java.net.MalformedURLException: no protocol: REPLACE_WITH_ACTUAL_URL


Actually the error suggests to me that the Web service address isn't set somewhere - it still has REPLACE_WITH_ACTUAL_URL as a place holder. There should be a <service-ref> in your web.xml, something like

Find that WSDL file that is mentioned in your <wsdl-file> element and check the <service> element

If you see "REPLACE_WITH_ACTUAL_URL" then "replace it with your actual web service URL".
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!