On Wed, May 18, 2011 at 19:19, Anil Atyam <[email protected]> wrote: > Folks > > I appreciate if you can help with the following issue we are struggling to > resolve. > > We @ National Rail Road Corporation implementing a solution where we send > Itinerary as PDF attachment to the passenger's email. To do so, we are using > MTOM enabled Web Service which sends to request to a third party company > which runs on IIS server to send emails. > > Everything works until here. Emails are delivered fine. However, we are > having exception while processing the response. AXIS2 framwork failed to > process the response. > > First, we don't have any attachments in response. We only have attachments > in Request and its processed succesfully. The response has only Success > element and nothing else. The response sent to us is MIME encoded > base64Binary. > > Here is the response: > > HTTP/1.1 200 OK > Connection: close > Date: Thu, 12 May 2011 14:42:15 GMT > Server: Microsoft-IIS/6.0 > X-Powered-By: ASP.NET > X-AspNet-Version: 2.0.50727 > Cache-Control: private, max-age=0 > Content-Type: multipart/related; type="application/xop+xml"; > boundary=--MIMEBoundary634407937359568655; > start="<[email protected]>"; start-info="text/xml; > charset=utf-8" > Content-Length: 890 > > ----MIMEBoundary634407937359568655 > content-id: <[email protected]> > content-type: application/xop+xml; charset=utf-8; type="text/xml; > charset=utf-8" > content-transfer-encoding: binary > > <soap:Envelope xmlns:xop="http://www.w3.org/2004/08/xop/include" > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" > xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" > xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><soap:Body><TravelDocumentNotificationRS > Version="1.000" xmlns="http://www.amtrak.com/schema/2010/01/01"><Success > /></TravelDocumentNotificationRS></soap:Body></soap:Envelope> > ----MIMEBoundary634407937359568655-- > > Exception: > > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R Caused by: > java.lang.NullPointerException > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axiom.attachments.Attachments.getSOAPPartContentType(Attachments.java:450) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.builder.MIMEBuilder.processDocument(MIMEBuilder.java:41) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:191) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:139) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:102) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:66) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R at > org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:567) > [5/6/11 15:49:57:536 EDT] 0000001c SystemErr R ... 20 more > > > > > Why does the AXIS2 framwork code going to attachment class when there are no > attachments? > > We appreciate any help in this regard. >
Actually, the name "Attachments" for that class was not chosen very well, because it represents (at least in this context) the complete set of MIME parts in a MIME multipart (i.e. an MTOM or SOAP with attachments message), including the SOAP part. In your case the response is an MTOM message, so the use of the Attachments class is correct. On the other hand it should obviously not result in a NullPointerException. To figure out why this happens, we need the exact version of the Axiom library that you are using. Andreas --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
