1 Reply Latest reply: May 1, 2013 8:00 AM by Vijaya Moderator -Oracle RSS

    Weblogic 12.1.1 - Problem with SOAP-Webservice returning int-Value

    user11359507
      Since Weblogic 12.1.1 we have a problem with SOAP-Webservice returning int-value. We used Weblogic 11 before.

      Example:

      @Stateless(mappedName="WebService360")
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      @Remote ({WebService360ManagerRemote.class})
      @WebService(serviceName = "lvs360",
      name = "lvs360",
      portName = "lvs360Port",
      targetNamespace = "de.evelopment.retail.lvs.ejb.schnittstelle")
      @SOAPBinding(style = SOAPBinding.Style.RPC)
      @Interceptors(ExceptionInterceptor.class)
      public class WebService360ManagerBean implements WebService360ManagerRemote {

      @WebMethod
      public int getFreieMontagePlaetze() {
      return 1;
      }

      }

      We generate the WebService client site with command:
      wsimport.exe -keep -Xnocompile -p de.evelopment.retail.lvs.ejb.schnittstelle http://localhost/WebService360ManagerBean/lvs360?wsdl"

      If we try to request the WebService "getFreieMontagePlaetze", we get the error

      Exception in thread "main" com.sun.xml.internal.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
      Message: Premature end of file.
      at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:283)
      at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:180)
      at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
      at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
      at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
      at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
      at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
      at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
      at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
      at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)
      at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
      at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
      at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
      at $Proxy27.getFreieMontagePlaetze(Unknown Source)
      at de.evelopment.retail.lvs.WsTest.doGetMontagePlaetze(WsTest.java:83)
      at de.evelopment.retail.lvs.WsTest.main(WsTest.java:31)
      Caused by: com.sun.xml.internal.ws.streaming.XMLStreamReaderException: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
      Message: Premature end of file.
      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.wrapException(XMLStreamReaderUtil.java:256)
      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:84)
      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.nextContent(XMLStreamReaderUtil.java:99)
      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.nextElementContent(XMLStreamReaderUtil.java:89)
      at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:164)
      at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:292)
      at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:118)
      at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:278)
      ... 15 more
      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
      Message: Premature end of file.
      at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:594)
      at com.sun.xml.internal.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:81)
      at com.sun.xml.internal.ws.streaming.XMLStreamReaderUtil.next(XMLStreamReaderUtil.java:65)
      ... 21 more

      ----------------------------------------

      if we replace the return type (int) with own value holder object like

      public class WebServiceIntegerValue implements Serializable {
      private static final long serialVersionUID = 3340033677209814630L;
      private Integer value;
      public WebServiceIntegerValue(Integer value) {
      this.value = value;
      }
      public Integer getValue() {
      return value;
      }
      public void setValue(Integer value) {
      this.value = value;
      }
      }

      the WebService run well.