Sunny-

You can read the encoding from the Envelope
        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();
 
        SOAPPart soapPart = message.getSOAPPart();
        SOAPEnvelope envelope = soapPart.getEnvelope();

        String style = envelope.getEncodingStyle();
 
Take a look at
Martin --
*********************************************************************
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: Tech Savvy
Sent: Wednesday, July 05, 2006 2:39 PM
Subject: Re: MTOM web service

Thilina,

Thanks for your reply. What I am trying to do, is to test the MTOM technology with AXIS2. I have successfully run the MTOM example come with AXIS2. However, since the sample is tied to the OMElement APIs, and there's no WSDL generated, I can't prove that a .net client can access the web service with its MTOM implementation. Is there a way to do such a test? The approach I was thinking is to develop a web service with POJO so a WSDL is generate, and I can use it in a .net framework to generate a client, and enable MTOM when making the call...can this be done?

On the OMText side, since the WebService will receive a String regardless OTOM is enabled or not, should there be a API call to detected wether the text is a Base64 encoded string? Here's my senario: on my client side I send a OMText to the web serivce. If the OMText is built using a handler, it will be Based64 encoded thus I need to decode it manually to get the original content; if the OMText is a plain "Hello, World", it wont' be encoded. However on the webservice side, it always received a OMText. Now comes the hard part: how do I know if I need to decode the text or not?

Thanks.

Sunny *


On 7/5/06, Thilina Gunarathne <[EMAIL PROTECTED]> wrote:
See my comments inline..

On 7/6/06, Tech Savvy < [EMAIL PROTECTED]> wrote:
Hi,

Have two question regarding to MTOM:

1. The sample in the guide is using AXIS2 api to code the webservice and client, e.g. OMElements. In such case a wsdl is not present so this is tied to AXIS2, i.e . a .NET client can't access the service. Is there a way to code the webservice use POJO (i.e. RPC style webservice), then generate the client stub to call it, and still be able to enable MTOM?
 
I'm not sure about this..

2. In the webservice, how do I detect whether a OMText is Base64 encoded?
 
If it is in a message you receive then you will not be able to detect it without knowing the schema. If you created it using some binary or by explicitly specifying that it is base64 then the OMText.isBinay() will return true.
 
~Thilina


Reply via email to