Aaahhhhha.....
Nice finding... Any comments from SOAP1.2 specialists...
Anyway this content type needs to be fixed...
Please log a Jira...
 
~Thilina
 

Content-Type: multipart/related;
boundary=MIMEBoundaryurn_uuid_26C55753A5E981E64A11479668765601;
type="application/xop+xml";
start="<0.urn:uuid:[EMAIL PROTECTED]>";
start-info="application/soap+xml"; charset=UTF-8;action=""

This then presumably blows up on the server inside the
javax.mail.internet.ParameterList
constructor, since the action="" can't be parsed properly - resulting in
the not so
helpful "SOAPEnvelope must contain a body element which is either first or
second child
element of the SOAPEnvelope" a few levels up (masking the OMException with a
"Invalid
Content Type Field in the Mime Message" message),

1) Is the action parameter supposed to have a value?
2) As other people presumably have this working, am I missing a
configuration on the client side?

My client look pretty much like this at the moment:

EndpointReference target = new EndpointReference(url);

ServiceClient serviceClient = new ServiceClient();
Options options = new Options();
options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI );
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setTo(target);
serviceClient.setOptions(options);

OMElement payload = getOMElement(messageContent);
OMElement result = serviceClient.sendReceive (payload);

I haven't still had the chance to follow up where the other attachments
vanish to... any
help would be appreciated. :)

Kind regards,
Timo

-----Original Message-----
From: Timo Ahokas [mailto: [EMAIL PROTECTED]]
Sent: 18 May 2006 14:07
To: Axis User
Subject: [Axis2] Vanishing MTOM attachments


Hi all,

We are using Axis2 1.0 (client & server) and sending XML and
binary MTOM attachments to the server. The XML document and the
first binary attachment are received without problems, but any
additional attachments never reach the server (are not available
from the OMElement when the server-side code starts executing).

I'm sending roughly the following from the client:

<OMElement>
<OMElement>
   <OMElement>
     XML document (constructed via StAXOMBuilder.getDocumentElement())
   </OMElement>
</OMElement>

<OMElement>
   <OMText>
     Binary attachment 1 (via factory.createOMText(datahandler, true))
   </OMText>
</OMElement>

<OMElement>
   <OMText>
     Binary attachment 2
   </OMText>
</OMElement>

<OMElement>
   <OMText>
     Binary attachment n
   </OMText>
</OMElement>
</OMElement>

This is sent out without problems from the client (as confirmed by
running through the Axis1 SoapMon proxy). The message on the wire
looks like fine, the first part of the multipart contains the
message (SOAP message with a XML payload and include references
for all the 1-n binary attachments) and each of the binary
attachments are included in separate parts of the message.

But when the message reaches the server, only the first binary
part seems to be in the OMElement that the server has constructed.
If I return that to the client, again looking at the wire
representation, only the first binary attachment is in place.

Also (possibly related to how the message is constructed), if I try
to set SOAP version to 1.2 on the client
(options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI )),
I get the following error on the server side:

2006-05-18 13:30:11,108 [ERROR][http-80-Processor24][org.apache.catalina
.core.ContainerBase.[Catalina].[localhost].[/voxsurf].[AxisServlet]]:
Servlet.service () for servlet AxisServlet threw exception org.apache.
axiom.om.OMException: SOAPEnvelope must contain a body element which is
either first or second child element of the SOAPEnvelope.
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getBody (SOAPEnvelopeImpl.ja
va:142)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.addChild(SOAPEnvelopeImpl.j
ava:103)
at
org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.getHeader(SOAPEnvelopeImpl.
java:82)
at
org.apache.axis2.engine.AxisEngine.createFaultMessageContext(AxisEngine.java
:183)
at
org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:168
)
at org.apache.axis2.transport.http.AxisServlet.doPost (AxisServlet.java:153)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
...

But looking at the messages sent over the wire, only the soapenv
is different, and both messages start otherwise similarly:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
       <soapenv:Header/>
       <soapenv:Body>
         ... body content

Is there something fundamentally wrong in our approach for sending the
multiple binary attachments in the single message? Has someone been able to
do something similar using Axis2 1.0? Are there any debug flags etc
I could enable to see what happens when the message from the wire is
being processed?

Kind regards,
Timo Ahokas





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
"May the SourcE be with u"            
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/                 http://www.bloglines.com/blog/Thilina               

Reply via email to