You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by "Jesus M. Salvo Jr." <je...@migasia.com> on 2003/01/31 00:57:55 UTC
Content-Type and other MIME headers
I have been trying to find a way to store away the MimeBodyPart that is
being sent by the Apache-SOAP client to the SOAP service, and comparing
it with what I see is being sent on the wire via sniffer.
Here are some interesting results:
1) When sending a multipart, SOAPContext.writeTo() does _NOT_ write out
the start parameter and the type mutlipart/related parameters.
2) The start and type parameters of the multipart is written out via
TransportMessage.save() which gets called within
SOAPHttpConnection.send(), just before calling HttpUtils.post(). (
Hence, the reason why SOAPCOntext.writeTo() does not write out those
multipart/related parameters ).
Why doesn't SOAPContext.writeTo() add those multipart/related parameters
in the Content-Type header, instead of doing it in TransportMessage.save()?
3) Because of item [2], if you load a serialized multipart that has the
start and type parameters already set in the Content-Type
multipart/related header into a SOAPContext, .... and then send the
context via SOAPHttpConnection.send(), the start and type parameters of
the multipart will be written __twice__. To work around this, the start
and type parameters must be remove before sending.
4) In a different way, [3] is good in the sense that we can serialize
the message via SOAPContext.writeTo(), thereby NOT saving the start and
type parameters, load it again from the serialized store into a
SOAPContext, then SOAPHttpConnection.send() should simlpy set the start
and type parameters automatically.
Part of the exercise of why I am saving the MimeBodyPart ( or its parent
multipart, if one exists ) that is being sent by the Apache-SOAP client are:
a) Debugging and logging ( they get stored in the database )
b) In the event of a SOAP service failure, would be good to retry
sending the SOAP message without having to reconstruct it from an
Envelope, attachments, etc ....
c) Forward a SOAP message that I receive to another external SOAP
service. The forwarding has to be asynchronous.
Feedback?
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>