getting SOAP part content ID
Hi I have a series of attachments along with SOAP. I need to get SOAP part ContentID. In Axiom 1.2.4 (which is used by Axis2 1.2) exposes getSOAPPartContentID(). However, I need to use Axis2 1.1.1 which uses Axiom 1.2.2. This does not expose getSOAPPartContentID(). How can I get SOAP part ContentID in Axis1.1.1? Thanks, Jennifer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Axis2 1.1 vs. 1.2
Hello, I am encountering some different behaviors when I migrate over my service from 1.1 to 1.2. 1. In 1.2, I run into soapenv:MustUnderstand. My request contains mustUnderstand attribute in the header. I looked at the source code of 1.1 and 1.2. It seemed like in 1.1 has more complex logic as below, hence my request wasn't tripping on mustUnderstand. I don't know which is more correct behavior, but is there any way I can suppress the MustUnderstand check in 1.2? if ((role != null) && !SOAP11Constants.SOAP_ACTOR_NEXT.equals(role)) { throw new AxisFault(Messages.getMessage( "mustunderstandfailed", prefix, SOAP12Constants.FAULT_CODE_MUST_UNDERSTAND)); } 2. I tried submitting the request without setting mustUnderstand. I got past the error above, however when I try to retrieve the attachements in the request, stream read times-out Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:747) at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:777) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:115) at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:712) at org.apache.coyote.Request.doRead(Request.java:429) at org.apache.coyote.tomcat5.InputBuffer.realReadBytes(InputBuffer.java:290) at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:374) at org.apache.coyote.tomcat5.InputBuffer.read(InputBuffer.java:305) at org.apache.coyote.tomcat5.CoyoteInputStream.read(CoyoteInputStream.java:179) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:256) at java.io.BufferedInputStream.read(BufferedInputStream.java:313) at java.io.FilterInputStream.read(FilterInputStream.java:111) at java.io.PushbackInputStream.read(PushbackInputStream.java:161) at org.apache.axiom.attachments.BoundaryPushbackInputStream.readFromStream(BoundaryPushbackInputStream.java:99) at org.apache.axiom.attachments.BoundaryPushbackInputStream.readFromStream(BoundaryPushbackInputStream.java:99) at org.apache.axiom.attachments.BoundaryPushbackInputStream.read(BoundaryPushbackInputStream.java:224) at org.apache.axiom.attachments.MIMEBodyPartInputStream.read(MIMEBodyPartInputStream.java:84) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:256) at java.io.BufferedInputStream.read(BufferedInputStream.java:313) at com.sun.mail.util.ASCIIUtility.getBytes(ASCIIUtility.java:246) at javax.mail.internet.MimeBodyPart.(MimeBodyPart.java:175) ... 40 more Any idea? Thanks, Jennifer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
inline response for SWA request
Hi I am getting SWA request. Currently I am processing the SOAP with XMLBean. The response must be an in-line SOAP response, not an attachment. How can I return an in-line SOAP response? Thanks, Jennifer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: register DataHandler
Dims, I am sending mult-part request using HttpClient. When I try reading from the IncomingAttachmentStream, I get read-time-out error on the last attachment. It seems the location where read-time-out occurs depends on the content of stream input. Repeated attempts of a same request always timesout at the same location. Adding another attachment to the same request runs into readtime out on the last attachment. This seems like the read buffer is blocked. When I intercept the incoming request using TCPMon, the entire request is there. Hence, I don't think it's a flush problem from the sender side. Any idea? Am I missing something? Here is the code snippet: private void getAttachments(MessageContext msgCtx) throws IOException { Attachments attchts = msgCtx.getAttachmentMap(); IncomingAttachmentStreams instreams = attchts.getIncomingAttachmentStreams(); int attchtIndex = 1; while (instreams.isReadyToGetNextStream()) { IncomingAttachmentInputStream instream = null; try { instream = instreams.getNextStream(); if (instream == null) break; System.out.println("\n\n content= " + instream.getContentId() + " -"); Map headers = instream.getHeaders(); for (Iterator iter = headers.keySet().iterator(); iter.hasNext(); ) { String header = (String) iter.next(); System.out.println("header: " + header + " = " + headers.get(header)); } System.out.println("---\n\n"); readContent(attchtIndex++, instream); } finally { if (instream != null) { instream.close(); } } } } private void readContent(int attachmentIndex, IncomingAttachmentInputStream instream) throws IOException { byte buffer[] = new byte[1024]; File file = new File(baseOutputDir + File.separator + attachmentIndex + ".out"); FileOutputStream fout = null; try { int len; fout = new FileOutputStream(file); while ((len = instream.read(buffer)) > 0 ) { fout.write(buffer, 0, len); } fout.flush(); } finally { if (fout != null) { fout.close(); } } } Exception statck: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:747) at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:777) at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:115) at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:712) at org.apache.coyote.Request.doRead(Request.java:429) at org.apache.coyote.tomcat5.InputBuffer.realReadBytes(InputBuffer.java:290) at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:374) at org.apache.coyote.tomcat5.InputBuffer.read(InputBuffer.java:305) at org.apache.coyote.tomcat5.CoyoteInputStream.read(CoyoteInputStream.java:179) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:256) at java.io.BufferedInputStream.read(BufferedInputStream.java:313) at java.io.FilterInputStream.read(FilterInputStream.java:111) at java.io.PushbackInputStream.read(PushbackInputStream.java:161) at org.apache.axiom.attachments.BoundaryDelimitedStream.readFromStream(BoundaryDelimitedStream.java:215) at org.apache.axiom.attachments.BoundaryDelimitedStream.read(BoundaryDelimitedStream.java:302) at org.apache.axiom.attachments.BoundaryDelimitedStream.read(BoundaryDelimitedStream.java:359) at org.apache.axiom.attachments.IncomingAttachmentInputStream.read(IncomingAttachmentInputStream.java:127) ... Thanks again, Jennifer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: register DataHandler
Thanks. I will give this a try. Don't mind doing some work. I just didn't want to create some hackey solution or reinvent the wheel. Thanks a lot, Jennifer On 5/28/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote: Thilina, Am sorry, i'd have to differ :) Remember the streaming API? Jennifer can use that. Jennifer, Be prepared to do some work :) Yes, it's possible. See IncomingAttachmentInputTest in axiom https://svn.apache.org/repos/asf/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/IncomingAttachmentInputTest.java Basically you start by accessing using the MessageConext.getAttachmentMap to get the Attachments object and then call the getIncomingAttachmentStreams of the attachments object. that will return a IncomingAttachmentInputStream and you can call getNextStream repeatedly till you find the one you want. IncomingAttachmentInputStream has a getHeaders which will let you access the custom headers in your mime parts. thanks, dims On 5/28/07, jy <[EMAIL PROTECTED]> wrote: > Thilina, > > Thanks for your reply. > > Do you have any suggestions as to how to address this? Do I need to > abandon Axis2 framework all together and read HTTP stream directly? > Is there another WS framework that offers more extensibility? > > Thanks, > Jennifer > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Davanum Srinivas :: http://davanum.wordpress.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: register DataHandler
Thilina, Thanks for your reply. Do you have any suggestions as to how to address this? Do I need to abandon Axis2 framework all together and read HTTP stream directly? Is there another WS framework that offers more extensibility? Thanks, Jennifer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
register DataHandler
Hello, We are getting SOAP message with multiple attachements. We are using XMLBean to parse the SOAP message. We also need to access the custom headers in the subsequent part of this multi-part request. It seems like we can do that by implementing a custom DataHandler, but I don't know how to register it so that Axis2 will return our DataHandler when we request for attachment using MessageContext.getAttachment(contentId). Is this the correct approach for parsing the custom header? If so, how can I register my DataHandler? If not, what's the correct solution? Message looks something like: Content-Type: multipart/related; boundary="NextPart_000_0125_01C19839.7237929064"; type=text/xml; start=<0705141922260100> Content-Length: 2216 SOAPAction: "" --NextPart_000_0125_01C19839.7237929064 Content-Type: text/xml; charset="utf-8" Content-ID: <0705141922260100> http://schemas.xmlsoap.org/soap/envelope/";> ... --NextPart_000_0125_01C19839.7237929064 Content-Type: application/foo Content-ID: <070514191100> Some-Custom-Header1: foo Another-Custom-Header2: foo2 blah, blah --NextPart_000_0125_01C19839.7237929064 Thanks, Jennifer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]