problem with a POJO web service returning a file in a DataHandler and 
RPCServiceClient accessing that web service
-----------------------------------------------------------------------------------------------------------------

                 Key: AXIS2-2960
                 URL: https://issues.apache.org/jira/browse/AXIS2-2960
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: client-api
    Affects Versions: 1.2
         Environment: Axis 2 (version 1.2) running on Tomcat 5.5.17 running on 
Windows XP
            Reporter: albert quinn


- POJO web service deployed on Axis 2 1.2 :

package code.prueba;
 
 import ....
 
   public class PruebaBD { 
     public DataHandler getFile() {
       DataHandler oDataHandler = new DataHandler( new FileDataSource( 
"C:\\prueba\\file.txt" ) );
       return oDataHandler;
  }
}

- RPCServiceClient accesing that POJO web service :

  package code.prueba;
 
  import ....
 
  public class RPClient {
    public static void main(String[] args) {
      try {
        RPCServiceClient serviceClient = new RPCServiceClient();
        Options options = serviceClient.getOptions();
        EndpointReference target = new EndpointReference( 
"http://localhost:8080/axis2/services/PruebaBD/getFile";);
        options.setTo(target);
        QName op = new QName("http://prueba.code/xsd";, "getFile");
        Object[]  opArgs= new Object[] { };
        Class[] returnTypes = new Class[] { DataHandler.class };
 
        Object[] response = serviceClient.invokeBlocking(op, opArgs, 
returnTypes);

        DataHandler dh = (DataHandler) response[0];
 
        if (dh == null)
          System.out.println("ERROR !!! dh == NULL");
        else {
          System.out.println("file name : " + dh.getName() );
          FileOutputStream fos = new FileOutputStream( "C:\\prueba\\file.txt" );
          dh.writeTo(fos);
          fos.close();
       }
    } catch (AxisFault fault) {
       System.out.println("ERROR !!!!! Fault.");
       fault.printStackTrace();
    } catch(Exception oException) {
       System.out.println("ERROR !!!!! Exception.");
       oException.printStackTrace();
    }
  }
}

- Result of running that client :

 ERROR !!!!! Exception.
 org.apache.axiom.soap.SOAPProcessingException:
 com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a close tag 
for element <faultstring> at [row,col {unknown-source}]: [1,193]
 at 
org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.processText(SOAP11BuilderHelper.java:156)
 at 
 
org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.handleEvent(SOAP11BuilderHelper.java:73)
 at  
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:345)
 at 
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:182)
 at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:135) at 
org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:546) at
org.apache.axiom.om.impl.llom.OMNodeImpl.getNextOMSibling(OMNodeImpl.java:131) 
at 
org.apache.axiom.om.impl.llom.OMElementImpl.getNextOMSibling(OMElementImpl.java:268)
 
at 
org.apache.axiom.om.impl.traverse.OMChildrenQNameIterator.next(OMChildrenQNameIterator.java:90)
 at
org.apache.axiom.om.impl.llom.OMElementImpl.getFirstChildWithName(OMElementImpl.java:221)
 at 
org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl.getCode(SOAP11FaultImpl.java:132)
 at org.apache.axis2.AxisFault.initializeValues(AxisFault.java:173)
  at org.apache.axis2.AxisFault.<init>(AxisFault.java:167)
  at 
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:434)
  at 
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:373)
 at  
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:294)
 at 
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:520) at 
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:500) at 
org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceClient.java:97)
 at borrar.main(borrar.java:24)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF; was expecting a 
close tag for element <faultstring> at [row,col {unknown-source}]: [1,193]
 at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
 at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2730)
 at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1019)
 at 
org.apache.axiom.soap.impl.builder.SOAP11BuilderHelper.processText(SOAP11BuilderHelper.java:143)
 ... 19 more


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to