axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Seetha Rama Krishna <>
Subject Re: difference b/w bean mapping using SOAPBody
Date Sun, 16 Mar 2008 05:03:17 GMT
      Thanks. For time being, let us forget about attachment part.  what is the differenece
b/w constructing SOAP Request with BeanMapping and using SAAJ.
          When i check both th request's using TCPMON, i did not find any difference,except
extra reference in AXIS, So  except for attachement, remaining things are same.
           Please correct me if i am wrong.

Martin Gainty <> wrote:
          Didnt see anyone respond so i found this test harness from
          try {
            MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
            //MessageFactory fac = MessageFactory.newInstance();
            SOAPMessage msg = fac.createMessage();
            SOAPPart soapPart = msg.getSOAPPart();
            SOAPEnvelope envelope = soapPart.getEnvelope();
            SOAPBody body = envelope.getBody();
              AttachmentPart ap;
  //replace the fileName here with your attachment
              String fileName = System.getProperty("basedir", ".") + "/test-resources" + File.separator
              InputStream inputStream = new FileInputStream(new File(fileName));
            ap = msg.createAttachmentPart(inputStream, "text/xml");
            DataHandler dh = new DataHandler(new SAAJDataSource(inputStream, 1000, "text/xml",
              StringBuffer sb1 = copyToBuffer(dh.getInputStream());
              //Verify attachment part is not empty and contents are correct
            try {
                Object o = ap.getContent();
                InputStream is = null;
                if (o instanceof StreamSource) 
                    StreamSource ss = (StreamSource)o;
                    is = ss.getInputStream();
                    fail("got object: " + o + ", expected object:");
            catch (Exception e) 
                fail("attachment has no content - unexpected");
          catch (Exception e) 
            fail("Exception: " + e);
    ----- Original Message ----- 
  From: Seetha Rama Krishna 
  Sent: Saturday, March 15, 2008 1:06 AM
  Subject: RE: difference b/w bean mapping using SOAPBody

       Thanks for your reply.  My focus is to send a SOAP Request to the
webservice,which is already exposed and get the response . That's it
nothing more than that. No manipulation, nothing
      What is bothering me is that whether i have to pass the bean
class to AXIS / create the SOAP Request using  SAAJ.
           One more thing is i need to send one attachment along with
this SOAPRequest. So if i go for bean , how can i pass this attachement.

"Vinh Nguyen (vinguye2)" <> wrote:
  When you receive a SOAP response from a web service, the contents must match the WSDL/XSD
schema defined for that service operation.  I believe what you want is to take that XML and
send it back out in another slightly different format.  That amounts to changing from one
schema to another, and I believe that's outside the scope of Axis2.
  You might be able to write a simple translator framework that converts one XML to another
using mappings between one property to another, but it might not be straightforward as that.
  Keep in mind that Axis2 primaly handles sending/receiving SOAP.  It does comes with various
data binding options built-in.  The actual data binding tool used (i.e. XmlBeans) mainly handles
serialization between XML and the Java type for a given XSD schema.  To change from one schema
to another, you'd have do write additional code for that.

  From: Seetha Rama Krishna [] 
Sent: Friday, March 14, 2008 11:46 AM
Subject: difference b/w bean mapping using SOAPBody

       I am new bie to AXIS.  I have to send a SOAP Request in the following format 
           I had gone through SAAJ API and found that it is very easy to construct the  same
SOAP Request. 
           My question is the same can be build using bean mapping concept in AXIS..
             Is there any difference in sending the SOAP Request using AXIS with bean serialization
an by using SAAJ API.
      Can any body suggest me how to proceed further
  Chat on a cool, new interface. No download required. Click here. 

  Thanks & Regards,

  Now you can chat without downloading messenger. Click here to know how.

  Thanks & Regards,

 Bring your gang together - do your thing.  Start your group.
View raw message