Any reason why you are cannot xmit the entity with Attachment as in 
/sample/soapwithattachments/client/SWAClient.java example?

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

  ----- Original Message ----- 
  From: Reneta Säll (HF/EBC) 
  To: axis-user@ws.apache.org 
  Sent: Thursday, May 10, 2007 9:51 AM
  Subject: Axis2: OMElement response message problem


  Hi everybody,

  I'm having a problem with Axis2 web service that uploads txt file. The 
downloading works fine. 
  The file content is binary 64 type and is transfered as xml element in the 
Soap message.(not as attachment!!!)
  The size of my txt file is 3 KB. When I minimized the file size to1 KB then 
the problem does't exist.  

  The web service works fine with Axis 1.4. but not in Axis2?

  Is the max size of the OMElement in the response limited: firstChild, 
LastChild in some way?

  When I ran the client  it occured a wrong: java.lang.NullPointerException, 
then I debuged, it shows that: com.sun.jdi.InvocationException - exception held 
inside the result.


  I am using autogenerated wsdl2java Stub:

  public org.apache.axiom.om.OMElement View( org.apache.axiom.om.OMElement 
param18) throws java.rmi.RemoteException


  {

      try

      {

          org.apache.axis2.client.OperationClient _operationClient = 
_serviceClient.

          createClient(_operations[0].getName());

          _operationClient.getOptions().setAction("urn:#View");

          _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);


                      // create SOAP envelope with that payload

          org.apache.axiom.soap.SOAPEnvelope env = null;


          //Style is Doc.


          env = 
toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),param18,optimizeContent(new
 javax.xml.namespace.QName("","View")));


          //adding SOAP headers

          _serviceClient.addHeadersToEnvelope(env);

          // create message context with that soap envelope

          org.apache.axis2.context.MessageContext _messageContext = new 
org.apache.axis2.context.MessageContext();

         _messageContext.setEnvelope(env);


          // add the message contxt to the operation client

          _operationClient.addMessageContext(_messageContext);


          //execute the operation client

          _operationClient.execute(true);


          org.apache.axis2.context.MessageContext _returnMessageContext = 
_operationClient.getMessageContext 
(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);

          org.apache.axiom.soap.SOAPEnvelope _returnEnv = 
_returnMessageContext.getEnvelope();


          org.apache.axiom.om.OMElement omElement = 
_returnEnv.getBody().getFirstElement();



          java.lang.Object object = fromOM( 
_returnEnv.getBody().getFirstElement(), org.apache.axiom.om.OMElement.class, 
getEnvelopeNamespaces    (_returnEnv));

          
_messageContext.getTransportOut().getSender().cleanup(_messageContext);

          return (org.apache.axiom.om.OMElement) object;


  }

  When I debug this (autogenerated) piece of code with a breakpoint on the 
return statement, the debugger says "com.sun.jdi.InvocationException occurred 
invoking method" and I get cin the client  java.lang.NullPointerException.

  I hope this is enough information. Please help me out with this.


  Best regards, Reneta

   

Reply via email to