You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Marc Lefebvre <ml...@akimeka.com> on 2008/06/11 03:27:03 UTC

More SOAP Attachment Questions

Hello,
 
Its me again....   I have a few more questions about Attachments in SOAP.
 
I have the MTOM examples setup and working, uploading and downloading a binary file.  All good on that.  Thanks!
 
So, now, Im trying to get the SOAP w/ Attachments examples working.   I have the UPLOAD example working, 
but cant get the DOWNLOAD version working.
 
I have a couple questions:
 
1) I noticed you have a method signature like:
 
public OMElement getFile(OMElement element)
 
Why are you using OMElement as the argument and return value?
 
Couldn't you just send a String to request a specific file and return a String with the ContentID specified for a reference to the attachment? Or even better use a SwA reference, something like this in the WSDL:
 
<xs:element name="getFile">
   <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" name="filename" nillable="true" type="xs:string"/>
      </xs:sequence>
   </xs:complexType>
</xs:element>
<xs:element name="getFileResponse">
   <xs:complexType>
      <xs:sequence>
         <xs:element minOccurs="0" name="return" nillable="true" type="ref:swaRef"/>
      </xs:sequence>
   </xs:complexType>
</xs:element>
 
2) I noticed you use in your services.xml file:
<messageReceiver 
   class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
Is there a reason you chose this class to be your receiver instead of:
<messageReceiver 

   mep=http://www.w3.org/2004/08/wsdl/in-out

   class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>

which is what the UPLOAD method uses in the SwA attachment method.
 

3) I was under the impression that the main difference between MTOM and SwA methods of attachment is that in the MTOM method, the encoded binary file is INSIDE the envelope of the message instead of outside of the envelope, yet, when I look at what is being transmitted, it looks like the binary file is still being sent as an attachment outside of the envelope no matter which method is used. Why is this? Am I not understading the differences correctly?

__
Marc Lefebvre, Principle Software Engineer
Akimeka, 1305 N. Holopono Street, Kihei, HI 96753 
Phone: (808)442-7168, Email: mlefebvre@akimeka.com
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc

Re: [AXIS2-1.4] Mime-Multipart Attachment help

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,

I have a service I am trying to mimic and it requires a mime-multipart
> attachment in the soap message.  I think this is called an "in-line"
> attachment.

Not really.. In-line means you take the binary data, base64 encode it and
put it inside the XML as a text value.


>
>
> How does this differ from SwA or MTOM?

Most probably it would be either MTOM or SwA. If possible post a input
message to this service together with the HTTP headers. You can use TCPMon (
ws.apache.org/commons/tcpmon) to capture it.

>
>
> Does Axis2 support this kind of attachment?

Axis2 supports both MTOM as well as SwA attachments. Both the technologies
are capable of delivering MIME attachments together with SOAP.

>
>
> Can JAVA2WSDL generate this within the WSDL?

Yes if it's MTOM.. No if it's SwA.. Do you have the WSDL for the service??

>
>
> How would the classes in POJO development be structured to generate this
> kind of output?

We need to figure out whether it's MTOM or SwA or another beast before
thinking of this step..

thanks,
Thilina

>
>
> __
> Marc Lefebvre, Principle Software Engineer
> Akimeka, 1305 N. Holopono Street, Kihei, HI 96753
> Phone: (808)442-7168, Email: mlefebvre@akimeka.com
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>



-- 
Thilina Gunarathne - http://thilinag.blogspot.com

Re: [AXIS2-1.4] Java heap space properties

Posted by Upul Godage <up...@gmail.com>.
Because Axis2 engine is running inside Tomcat, you have to do it in Tomcat
like this. Before running the catalina.sh etc. shell scripts set the
CATALINA_OPTS environment variable with the necessary settings. Then this
will be used inside the catalina.sh file.

export CATALINA_OPTS="-Xms512m -Xmx512m"

Hope this helps.

Upul


On Thu, Jun 19, 2008 at 3:30 AM, Marc Lefebvre <ml...@akimeka.com>
wrote:

> How do you configure Axis2 heap space for the JVM?   I looked in axis2.xml
> and didnt see any settings.   Im running in Tomcat, perhaps its configured
> there?
>
> Im getting error:
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> ">
>   <soapenv:Body>
>      <soapenv:Fault>
>         <faultcode>soapenv:Server</faultcode>
>         <faultstring>java.lang.OutOfMemoryError: Java heap
> space</faultstring>
>         <detail/>
>      </soapenv:Fault>
>   </soapenv:Body>
> </soapenv:Envelope>
>
>
> __
> Marc Lefebvre, Principle Software Engineer
> Akimeka, 1305 N. Holopono Street, Kihei, HI 96753
> Phone: (808)442-7168, Email: mlefebvre@akimeka.com
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>

[AXIS2-1.4] Java heap space properties

Posted by Marc Lefebvre <ml...@akimeka.com>.
How do you configure Axis2 heap space for the JVM?   I looked in axis2.xml and didnt see any settings.   Im running in Tomcat, perhaps its configured there?
 
Im getting error:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>java.lang.OutOfMemoryError: Java heap space</faultstring>
         <detail/>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
 
 
__
Marc Lefebvre, Principle Software Engineer
Akimeka, 1305 N. Holopono Street, Kihei, HI 96753 
Phone: (808)442-7168, Email: mlefebvre@akimeka.com
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc

[AXIS2-1.4] Mime-Multipart Attachment help

Posted by Marc Lefebvre <ml...@akimeka.com>.
I have a service I am trying to mimic and it requires a mime-multipart attachment in the soap message.  I think this is called an "in-line" attachment.  
 
How does this differ from SwA or MTOM?  
 
Does Axis2 support this kind of attachment?  
 
Can JAVA2WSDL generate this within the WSDL?  
 
How would the classes in POJO development be structured to generate this kind of output?
 
__
Marc Lefebvre, Principle Software Engineer
Akimeka, 1305 N. Holopono Street, Kihei, HI 96753 
Phone: (808)442-7168, Email: mlefebvre@akimeka.com
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc

Re: [AXIS2-1.4] Content-id based referencing vs Content Location based referencing

Posted by Andreas Veithen <an...@skynet.be>.
The SOAP with Attachment specs define two approaches to reference  
attachments: one is based on the Content-ID header, the other on the  
Content-Location header. See http://www.w3.org/TR/SOAP-attachments for  
more information (look for "Content-Location"). The second approach is  
not supported by Axis2 (presumably because it is not frequently used).

Andreas

On 17 juin 08, at 22:46, Marc Lefebvre wrote:

> What does this mean in the Axis2 documentation?
>
> "Axis2 supports content-id based referencing only. Axis2 does not  
> support Content Location based referencing of MIME parts."
>
> __
> Marc Lefebvre, Principle Software Engineer
> Akimeka, 1305 N. Holopono Street, Kihei, HI 96753
> Phone: (808)442-7168, Email: mlefebvre@akimeka.com
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
> < 
> winmail 
> .dat 
> >---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


[AXIS2-1.4] Content-id based referencing vs Content Location based referencing

Posted by Marc Lefebvre <ml...@akimeka.com>.
What does this mean in the Axis2 documentation?
 
"Axis2 supports content-id based referencing only. Axis2 does not support Content Location based referencing of MIME parts."
 
__
Marc Lefebvre, Principle Software Engineer
Akimeka, 1305 N. Holopono Street, Kihei, HI 96753 
Phone: (808)442-7168, Email: mlefebvre@akimeka.com
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc

RE: More SOAP Attachment Questions

Posted by Marc Lefebvre <ml...@akimeka.com>.
I have an XML appliance that works only with SOAP with Attachments, AND it is expecting a WSDL that uses mime multipart/related definitions.
 
I was wondering if there was a way to tweak the Axis2 sample of SWA to use this kind of WSDL?  Can anyone provide such a WSDL for my testing.  I appreciate this very much.
 
__
Marc Lefebvre, Principle Software Engineer
Akimeka, 1305 N. Holopono Street, Kihei, HI 96753 
Phone: (808)442-7168, Email: mlefebvre@akimeka.com
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
 

Re: More SOAP Attachment Questions

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,


> I have the MTOM examples setup and working, uploading and downloading a
> binary file.  All good on that.  Thanks!

Nice..

>
> So, now, Im trying to get the SOAP w/ Attachments examples working.   I
> have the UPLOAD example working,
> but cant get the DOWNLOAD version working.
>
> I have a couple questions:
>
> 1) I noticed you have a method signature like:
>
> public OMElement getFile(OMElement element)
>
> Why are you using OMElement as the argument and return value?
>
> Couldn't you just send a String to request a specific file and return a
> String with the ContentID specified for a reference to the attachment?

Yes... It's possible.. But u need to make sure you return the correct
content-id of the attachment you attached.
                   String graphImageID =
outMessageContext.addAttachment(graphImageDataHandler);


> Or even better use a SwA reference, something like this in the WSDL:

AFAIK Axis2 does not support code generating to SwARef..

>
>
> 2) I noticed you use in your services.xml file:
> <messageReceiver
>   class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
> Is there a reason you chose this class to be your receiver instead of:
> <messageReceiver
>
>   mep=http://www.w3.org/2004/08/wsdl/in-out
>
>   class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>
> which is what the UPLOAD method uses in the SwA attachment method.

You can use either of them.

>
>
> 3) I was under the impression that the main difference between MTOM and SwA
> methods of attachment is that in the MTOM method, the encoded binary file is
> INSIDE the envelope of the message instead of outside of the envelope, yet,
> when I look at what is being transmitted, it looks like the binary file is
> still being sent as an attachment outside of the envelope no matter which
> method is used. Why is this? Am I not understading the differences
> correctly?

The wire level format is more or less that same for MTOM & SwA.. It's the
referencing mechanism that's different.. That small difference gives a lot
of advantages at the XML level. Also when using MTOM, binary data can go in
the envelope (base64 encoded) or can go as attachments without making any
difference to the XML object models of the sending/receiving sides..

Have a look at http://ws.apache.org/axis2/1_4/mtom-guide.html..
Specifically at the message traces given at the
http://ws.apache.org/axis2/1_3/mtom-guide.html#33

thanks,
Thilina


>
>
> __
> Marc Lefebvre, Principle Software Engineer
> Akimeka, 1305 N. Holopono Street, Kihei, HI 96753
> Phone: (808)442-7168, Email: mlefebvre@akimeka.com
> echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D4D465452snlbxq' | dc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>



-- 
Thilina Gunarathne - http://thilinag.blogspot.com