[JBoss JIRA] (JBWS-2575) Client received com.sun.xml.ws.streaming.XMLStreamReaderException when invoking WebService annotated with OneWay
by Alessio Soldano (JIRA)
[ https://issues.jboss.org/browse/JBWS-2575?page=com.atlassian.jira.plugin.... ]
Alessio Soldano updated JBWS-2575:
----------------------------------
Assignee: (was: Alessio Soldano)
> Client received com.sun.xml.ws.streaming.XMLStreamReaderException when invoking WebService annotated with OneWay
> ----------------------------------------------------------------------------------------------------------------
>
> Key: JBWS-2575
> URL: https://issues.jboss.org/browse/JBWS-2575
> Project: JBoss Web Services
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: jbossws-native
> Environment: JBoss 5.0.0 under Windows XP
> wsdl and stub generated using jax-ws tools
> Reporter: Mosse Franck
>
> A standalone client receives an exception when it tries to invoke a web service annotated with @OneWay.
> The exception received on the client side is :
> com.sun.xml.ws.streaming.XMLStreamReaderException: XML reader error: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
> at [row,col {unknown-source}]: [1,0]
> at com.sun.xml.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:242)
> at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:70)
> at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextContent(XMLStreamReaderUtil.java:85)
> at com.sun.xml.ws.streaming.XMLStreamReaderUtil.nextElementContent(XMLStreamReaderUtil.java:75)
> at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:167)
> at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:149)
> at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:121)
> at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:280)
> at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:158)
> at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:74)
> at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:559)
> at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:518)
> at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:503)
> at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:400)
> at com.sun.xml.ws.client.Stub.process(Stub.java:235)
> at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:120)
> at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:230)
> at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
> at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
> at $Proxy30.createPerson(Unknown Source)
> at test.example1.TestPeopleManager.testCreatePerson(TestPeopleManager.java:41)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
> at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
> at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
> at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
> at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
> at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
> at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
> at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
> at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:686)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.sun.xml.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:56)
> at com.sun.xml.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:51)
> ... 39 more
> The code of the web service is :
> package test.example1;
> import javax.ejb.Stateless;
> import javax.jws.Oneway;
> import javax.jws.WebMethod;
> import javax.jws.WebParam;
> import javax.jws.WebService;
> @WebService( name="PeopleManager", serviceName="PeopleManager", targetNamespace="http://techtip.com/samples/example1")
> @Stateless
> public class PeopleManager {
> @WebMethod( operationName="createPerson")
> @Oneway
> public void createPerson ( @WebParam(name="firstName") String firstName, @WebParam(name="lastName")String lastName, @WebParam(name="age") int age)
> {
> System.out.println ("Creating person [firstName=" + firstName + "; lastName=" + lastName + ";age=" + age + "]");
> }
> }
> Remark : If the @OneWay annotation is removed, the invocation from the client is successful.
> The code of the client is :
> package test.example1;
> import java.net.MalformedURLException;
> import java.net.URL;
> import javax.xml.namespace.QName;
> import org.junit.BeforeClass;
> import org.junit.Test;
> import test.example1.generated.*;
> public class TestPeopleManager {
>
> private static PeopleManager peopleManager;
> private static final String HOST_NAME = "localhost";
> private static final String PORT_NUMBER = "8080";
> private static final String TARGET_NAMESPACE = "http://techtip.com/samples/example1";
>
> @BeforeClass
> public static void beforeClass () throws MalformedURLException
> {
> String wsdlUrl = "http://" + HOST_NAME + ":" + PORT_NUMBER + "/TestWebService/PeopleManager?wsdl";
> URL wsdlLocation = new URL( wsdlUrl);
> QName serviceName = new QName(
> TARGET_NAMESPACE,
> "PeopleManager"
> );
>
> PeopleManager_Service service = new PeopleManager_Service(
> wsdlLocation, serviceName
> );
>
> peopleManager = service.getPeopleManagerPort ();
>
> }
> @Test
> public void testCreatePerson() throws Exception {
> peopleManager.createPerson ( "Franck", "Mosse", 40);
> }
>
> }
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira