Error : java.net.MalformedURLException: no protocol:

Hi,I am getting this error when i am trying to call a webservice from a remote standalone client in weblogic .Does anyone has any idea why i am getting this error?Thanks,Shikha
[204 byte] By [shikha_csa] at [2007-11-26 19:56:53]
# 1
Hello,Can you post the code your using to consume that WebService.Regards,Sebastien Degardin
sdegardina at 2007-7-9 22:51:18 > top of Java-index,Java Essentials,Java Programming...
# 2

Hi,

This is my client program-

public final class UserClient

{

public static void main(String [] arg)

{

try

{

String endpoint="http://penguin.ic.gs.com:45503/ws/AxisServlet";

Service service = new Service();

Callcall= (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );

call.setOperationName(new QName("UserEntitlementsService","getparty")) ;

call.setUsername("gs:mathsh");

call.setPassword("");

call.getMessageContext().setMaintainSession(true);

call.setTimeout(new Integer(3600000));

Integer ret = (Integer) call.invoke(new Object[] {} );

System.out.println("RECEIVED " + ret + "\n");

}catch (AxisFault fault) {

System.err.println("Error : " + fault.toString());

}

catch (RemoteException e) {

System.out.println("Failed to retrieve user data.");

}

catch (ServiceException e) {

System.out.println("Failed to retrieve user data.");

}

catch (java.net.MalformedURLException e) {

System.out.println("Failed to retrieve user data.");

}

}

}

shikha_csa at 2007-7-9 22:51:18 > top of Java-index,Java Essentials,Java Programming...
# 3
The exception ""java.net.MalformedURLException: no protocol' says it's not related to the webservice.But, can you tell me where is the Exception thrown in the code ?And maybe the stacktrace of the exception.Regards,Sebastien Degardin
sdegardina at 2007-7-9 22:51:18 > top of Java-index,Java Essentials,Java Programming...
# 4
That code does not throw a MalformedUrlException for endpoint.
CeciNEstPasUnProgrammeura at 2007-7-9 22:51:18 > top of Java-index,Java Essentials,Java Programming...
# 5
> That code does not throw a MalformedUrlException for> endpoint.With exception mishandling like yours, how would you actually know it occured there?
CeciNEstPasUnProgrammeura at 2007-7-9 22:51:18 > top of Java-index,Java Essentials,Java Programming...
# 6
it occured when we are trying to invoke the service-Integer ret = (Integer) call.invoke(new Object[] {} );
shikha_csa at 2007-7-9 22:51:18 > top of Java-index,Java Essentials,Java Programming...
# 7
Can you also put the stack trace ?Thanks.
sdegardina at 2007-7-9 22:51:19 > top of Java-index,Java Essentials,Java Programming...
# 8
The point is, you're doing the same System.out.println("Failed to retrieve user data.") for three different kinds of exceptions ... so how do you know at all that it was a MalformedURLException?
quittea at 2007-7-9 22:51:19 > top of Java-index,Java Essentials,Java Programming...
# 9

stacktrace-

{http://xml.apache.org/axis/}stackTrace:java.net.MalformedURLException: no protocol: /login/login_a.cgi?target=L3dzL0F4aXNTZXJ2bGV0

at java.net.URL.<init>(URL.java:473)

at java.net.URL.<init>(URL.java:376)

at java.net.URL.<init>(URL.java:330)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:133)

at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:727)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

at org.apache.axis.client.Call.invokeEngine(Call.java:2765)

at org.apache.axis.client.Call.invoke(Call.java:2748)

at org.apache.axis.client.Call.invoke(Call.java:2424)

at org.apache.axis.client.Call.invoke(Call.java:2347)

at org.apache.axis.client.Call.invoke(Call.java:1804)

at UserClient.main(UserClient.java:39)

{http://xml.apache.org/axis/}hostname:ncpcdsa01.eq.gs.com

java.net.MalformedURLException: no protocol: /login/login_a.cgi?target=L3dzL0F4aXNTZXJ2bGV0

java.net.MalformedURLException: no protocol: /login/login_a.cgi?target=L3dzL0F4aXNTZXJ2bGV0

at java.net.URL.<init>(URL.java:473)

at java.net.URL.<init>(URL.java:376)

at java.net.URL.<init>(URL.java:330)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:133)

at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:727)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)

at org.apache.axis.client.Call.invokeEngine(Call.java:2765)

at org.apache.axis.client.Call.invoke(Call.java:2748)

at org.apache.axis.client.Call.invoke(Call.java:2424)

at org.apache.axis.client.Call.invoke(Call.java:2347)

at org.apache.axis.client.Call.invoke(Call.java:1804)

at UserClient.main(UserClient.java:39)

shikha_csa at 2007-7-9 22:51:19 > top of Java-index,Java Essentials,Java Programming...
# 10
Looks like a configuration issue to me or something. So what did the folks at the Axis mailing list have to say? I'm sure you asked them, after all, they're suppposed to provide support for that product.
CeciNEstPasUnProgrammeura at 2007-7-9 22:51:19 > top of Java-index,Java Essentials,Java Programming...
# 11
Integer ret = (Integer) call.invoke(new Object[] {} );What's the significance of that empty array?
CeciNEstPasUnProgrammeura at 2007-7-9 22:51:19 > top of Java-index,Java Essentials,Java Programming...