Strange exception that only occurs the first time i call a WS operation
When i call [b]any[/b] WS operation from a J2ME client i get this strange exception:
java.rmi.MarshalException: Unexpected Exception : unexpected end of stream
The thing is, the WS receives the info i send, but the client doesn't receive the response. And even more wierd is that this only happens the first time, if i run the client again, it's all ok. I tried using J2SE and that works fine.
I can pass whatever data to whatever WS operation, it's the same story.
This is my J2ME code:
[CODE]
public void startApp() {
try {
pack.WSService_Stub service = new pack.WSService_Stub();
boolean result = service.anyOperation();
System.out.println(result);
} catch (RemoteException e) {
e.printStackTrace();
}
}
[/CODE]
Re: Strange exception that only occurs the first time i call a WS operation
Hi,
Did you manage to find a solution for this problem?
I have the same problem calling a web service. It occurs only invoking one method,
which returns an array of objects.
When calling simples methods, it works.
Cheers,
Vladdy
Re: Strange exception that only occurs the first time i call a WS operation
No, but i only get this exception when i run the emulator. On the actual device it works fine.
I always try the operation twice :)
Re: Strange exception that only occurs the first time i call a WS operation
Hi, I quest you, are you problem only the Emulator?, and device? Is work fine?
Because I try connet to Web Service, but Nettbeans show me a Error:
"java.rmi.MarshalException: Unexpected Exception : unexpected end of stream
java.rmi.MarshalException: Unexpected Exception : unexpected end of stream
at com.sun.j2mews.xml.rpc.SOAPDecoder.decode(), bci=241
at com.sun.j2mews.xml.rpc.OperationImpl.invoke(), bci=103
at operacionesservice.OperacionesService_Stub.suma(OperacionesService_Stub.java:94)
at Midlet.commandAction(Midlet.java:95)
at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46
at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74
at com.sun.midp.chameleon.layers.SoftButtonLayer.commandSelected(), bci=11
at com.sun.midp.chameleon.layers.MenuLayer.keyInput(), bci=290
at com.sun.midp.chameleon.CWindow.keyInput(), bci=38
at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17
at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277
at com.sun.midp.events.EventQueue.run(), bci=179
at java.lang.Thread.run(Thread.java:662)"
Please help me with your answer and Which device do you use?
Re: Strange exception that only occurs the first time i call a WS operation
It looks to be some issue with your emulator or internet/server access, try to run it on some other emulator on some other system or try to check the web services accessibility from your computer via some desktop test tools..