[Axis2 1.2] Axis2 attachment interoperability???
Hi Axis2 users and developers, I am not sure whether I should consider the problem I encountered as Axis2 attachment interoperability. I have posted the question in another thread. But I hope this thread can explain my problem clearer. The following is the problem I encountered: Currently I have a web service receiving attachment and returning some other attachment. Since currently the web service only returns one attachment and returning only one attachment, my web service is assuming the first attachment is the required attachment for further processing. I have been using XML Exchanger Lite to produce the SOAP request with attachment. The request is as follows: ## Multipart Request created by XML Exchanger Lite ## POST /wsg/services/coi/HWACEWebService HTTP/1.1 Content-Type: multipart/related; type="text/xml"; boundary="=_Part_2_12191487.1181639896483" Content-Length: 7120 SOAPAction: urn:submitManifest Cache-Control: no-cache Pragma: no-cache User-Agent: Exchanger XML Editor/3.2 Java/1.4.2_11 Host: localhost:7001 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 Connection: keep-alive --=_Part_1_14487431.1181639896264 Content-Type: text/xml http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance";> http://hwams.mycompany.com/xsd";> acews01 testtest standard_cuscar HQ-S-VIRTUALXML.CUSCAR.xml --=_Part_1_14487431.1181639896264 Content-Type: application/octet-stream Content-Id: HQ-S-VIRTUALXML.CUSCAR.xml http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="R:\SCODE01\DEVM\IFX\IFX100\ACE\XSD\Manifest External Schemas + Documentations\Manifest 1.12\CUSCAR(submission)\e_complete_cuscar.1.11.xsd"> --=_Part_1_14487431.1181639896264-- ## END OF Multipart Request created by XML Exchanger Lite ## The server side is using Axis2 to send attachment. Please refer to the attached ServerProgram. The current server program can works properly, and send an acknowledgement file as attachment: ## START of Server Response ## HTTP/1.1 200 OK Date: Tue, 12 Jun 2007 09:18:16 GMT Server: WebLogic Server 8.1 SP2 Fri Dec 5 15:01:51 PST 2003 316284 Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_3E24C909072BF5DDDF1181639896910; type="text/xml"; start="< 0.urn:uuid:[EMAIL PROTECTED]>"; charset=UTF-8 Transfer-Encoding: chunked --MIMEBoundaryurn_uuid_3E24C909072BF5DDDF1181639896910 Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: <0.urn:uuid:[EMAIL PROTECTED]> http://schemas.xmlsoap.org/soap/envelope/";>http://hwams.mycompany.com/xsd";>nullAck.xml --MIMEBoundaryurn_uuid_3E24C909072BF5DDDF1181639896910 Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-ID: This is an sample error acknowledgement file. no ack generated. --MIMEBoundaryurn_uuid_3E24C909072BF5DDDF1181639896910-- ## END of Server Response ## Using the Axis2 Client program (please refer to the attached ClientProgram), I get the following Request message: ## Multipart Request created by Axis2 Client Program ## POST /wsg/services/coi/HWACEWebService HTTP/1.0 Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_1483F52F7EBB91BE7D1181639175926; type="text/xml"; start="< 0.urn:uuid:[EMAIL PROTECTED]>"; charset=UTF-8 SOAPAction: "urn:submitManifest" User-Agent: Axis2 Host: localhost:7001 Content-Length: 7307 --MIMEBoundaryurn_uuid_1483F52F7EBB91BE7D1181639175926 Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-ID: <0.urn:uuid:[EMAIL PROTECTED]> http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd=" http://www.w3.org/2001/XMLSchema";> http://ejb.hwams.trade.crimsonlogic.com/xsd";> acews01 testtest standard_cuscar HQ-S-VIRTUALXML.CUSCAR.xml --MIMEBoundaryurn_uuid_1483F52F7EBB91BE7D1181639175926 Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-ID: http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="R:\SCODE01\DEVM\IFX\IFX100\ACE\XSD\Manifest External Schemas + Documentations\Manifest 1.12\CUSCAR(submission)\e_complete_cuscar.1.11.xsd"> --MIMEBoundaryurn_uuid_1483F52F7EBB91BE7D1181639175926-- ## END of Multipart Request created by Axis2 Client Program ## I have some questions about the server respons
Re: [Axis2 1.2] Axis2 attachment interoperability???
Hi, http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd=" http://www.w3.org/2001/XMLSchema";> http://ejb.hwams.trade.crimsonlogic.com/xsd "> acews01 testtest standard_cuscar HQ-S-VIRTUALXML.CUSCAR.xml Looking at your earlier request it seems you expect submission file name to be the attachment content-id (though it's not required by the specs).. If you need it you need to set the file name as the content-id when adding the attachment to the attachment map of the message context.. --MIMEBoundaryurn_uuid_1483F52F7EBB91BE7D1181639175926 Content-Type: application/octet-stream Content-Transfer-Encoding: binary Content-ID: I have some questions about the server response: The whole SOAP response envelope is considered as an attachment with content-ID = < 0.urn:uuid:[EMAIL PROTECTED]>. This is exactly the value of "start" HTTP header in the response. Is this a standard operation or it is proprietary to Axis2? It is recommended by the specifications, but not required.. If the start parameter is present in the content-id header, then the SOAP processors are expected to use the MIME part with the content-id of that value as the part containing the SOAP envelope.. If it is not present SOAP processors needs to treat the first MIME part as the part containing the SOAP envelope.. Axis2 puts the start parameter as well as it makes sure to send the SOAP envelope in the first MIME part, in order to make sure interoperability with most of the SOAP stacks.. Can I assume the following: If content-ID of a part starts with "<0.urn:uuid:", then it must be the SOAP request/response part? Nope...You can't... It can be any arbitrary string.. If my web service assumes XML Exchanger Lite as client, I need to extract the FIRST (index 0) content-ID and treat its content as attachment. But if my web service assumes Axis2 ClientProgram as client, I need to extract the second (index 1) content-ID and treat its content as attachment. Web services normally do not do client specific processing... They treat all the clients as same.. But you can work around this issue by putting a start parameter to the content-id header which points to the second MIME part when XML Ex. Lite is used... How can I solve this interoperability issue on attachment? Still it's not clear me whether there is actually an interoperability issue... You can refer to the following articles to get more information about Axis2 SOAP with attachments support.. * Using SOAP with Attachments in Apache Axis2 - http://wso2.org/library/1148 * Downloading a Binary File from a Web Service using Axis2 and SOAP with Attachments - http://wso2.org/library/1675 thanks, Thilina Regards, Xinjun - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2 1.2] Axis2 attachment interoperability???
Hi Thilina, Thank you for the detailed reply. I have read through the SOAP Messages with Attachments specification. You are right that "start" parameter in Content-Type is recommended. I also looked through the Axiom code Attachments#getSOAPPartContentID(). It seems that Axiom assumes that every MIME part will have a content-ID. Even if I use XML Exchanger Lite to construct the MIME request, i.e., even if the original request's content-Type header does not contain "start" parameter and the SOAP Request Part does not have Content-ID header, the AXIOM will assign a content-ID to the SOAP Part. This is a good feature. I am considering the following solution, could you take a look and suggest for me? At the server side, I will invoke getSOAPPartContentID() to get the contentID of SOAP part. Then I exclude the soap part contentID from the contentID set, every remaining contentID will correspond to one actual attachment. By the way, currently I don't know how to get the "start" parameter value from Attachments class. Regards, Xinjun On 6/12/07, Thilina Gunarathne <[EMAIL PROTECTED]> wrote: Hi, > xmlns:SOAP-ENV=" http://schemas.xmlsoap.org/soap/envelope/ " > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xmlns:xsd=" http://www.w3.org/2001/XMLSchema "> >xmlns="http://ejb.hwams.trade.crimsonlogic.com/xsd "> > > acews01 > testtest > standard_cuscar >HQ-S-VIRTUALXML.CUSCAR.xml Looking at your earlier request it seems you expect submission file name to be the attachment content-id (though it's not required by the specs).. If you need it you need to set the file name as the content-id when adding the attachment to the attachment map of the message context.. > > > > --MIMEBoundaryurn_uuid_1483F52F7EBB91BE7D1181639175926 > Content-Type: application/octet-stream > Content-Transfer-Encoding: binary > Content-ID: > I have some questions about the server response: > > The whole SOAP response envelope is considered as an attachment with > content-ID = < > 0.urn:uuid:[EMAIL PROTECTED]>. > This is exactly the value of "start" HTTP header in the response. > > Is this a standard operation or it is proprietary to Axis2? It is recommended by the specifications, but not required.. If the start parameter is present in the content-id header, then the SOAP processors are expected to use the MIME part with the content-id of that value as the part containing the SOAP envelope.. If it is not present SOAP processors needs to treat the first MIME part as the part containing the SOAP envelope.. Axis2 puts the start parameter as well as it makes sure to send the SOAP envelope in the first MIME part, in order to make sure interoperability with most of the SOAP stacks.. > Can I assume the following: If content-ID of a part starts with > "<0.urn:uuid:", then it must be the SOAP request/response part? Nope...You can't... It can be any arbitrary string.. > If my web service assumes XML Exchanger Lite as client, I need to extract > the FIRST (index 0) content-ID and treat its content as attachment. But if > my web service assumes Axis2 ClientProgram as client, I need to extract the > second (index 1) content-ID and treat its content as attachment. Web services normally do not do client specific processing... They treat all the clients as same.. But you can work around this issue by putting a start parameter to the content-id header which points to the second MIME part when XML Ex. Lite is used... > How can I solve this interoperability issue on attachment? Still it's not clear me whether there is actually an interoperability issue... You can refer to the following articles to get more information about Axis2 SOAP with attachments support.. * Using SOAP with Attachments in Apache Axis2 - http://wso2.org/library/1148 * Downloading a Binary File from a Web Service using Axis2 and SOAP with Attachments - http://wso2.org/library/1675 thanks, Thilina > > > Regards, > Xinjun > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2 1.2] Axis2 attachment interoperability???
Hi Thilina/ Xinjun, Could you pl have a look at https://issues.apache.org/jira/browse/AXIS2-3245 & give me some pointers to move ahead? My current requirements force me to use jax-ws-ri on the server-side & axis2 on the client-side. The request/ response messages typically have more than one binary attachments and the order of attachments must be preserved. Thanks Regards -- View this message in context: http://www.nabble.com/-Axis2-1.2--Axis2-attachment-interoperabilitytf3906797.html#a13125936 Sent from the Axis - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2 1.2] Axis2 attachment interoperability???
Hi Skudx, I suggest you handle MessageContext directly if you want to solve the attachment interoperability issue. The MessageContext give you flexibility to handle your attachments. Axis2 recommend the use of "start" parameter but doesn't mandate it. I have tested that. But as for preserving the order of attachments, I don't think Axis2 developers will consider this request. You should not rely on the order of the attachments. You should use something like contentID or name to associate an ID with certain attachment. Regards, Xinjun On 10/10/07, skudx <[EMAIL PROTECTED]> wrote: > > > > Hi Thilina/ Xinjun, > > Could you pl have a look at > https://issues.apache.org/jira/browse/AXIS2-3245 > & give me some pointers to move ahead? > > My current requirements force me to use jax-ws-ri on the server-side & > axis2 > on the client-side. The request/ response messages typically have more > than > one binary attachments and the order of attachments must be preserved. > > Thanks > Regards > > > -- > View this message in context: > http://www.nabble.com/-Axis2-1.2--Axis2-attachment-interoperabilitytf3906797.html#a13125936 > Sent from the Axis - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [Axis2 1.2] Axis2 attachment interoperability???
> But as for preserving the order of attachments, I don't think Axis2 > developers will consider this request. I think we do support that... Can you please double check and let us know whether it's broken. thanks, Thilina >You should not rely on the order of > the attachments. You should use something like contentID or name to > associate an ID with certain attachment. > > > Regards, > Xinjun > > > > On 10/10/07, skudx <[EMAIL PROTECTED]> wrote: > > > > > > Hi Thilina/ Xinjun, > > > > Could you pl have a look at > https://issues.apache.org/jira/browse/AXIS2-3245 > > & give me some pointers to move ahead? > > > > My current requirements force me to use jax-ws-ri on the server-side & > axis2 > > on the client-side. The request/ response messages typically have more > than > > one binary attachments and the order of attachments must be preserved. > > > > Thanks > > Regards > > > > > > -- > > View this message in context: > http://www.nabble.com/-Axis2-1.2--Axis2-attachment-interoperabilitytf3906797.html#a13125936 > > Sent from the Axis - User mailing list archive at Nabble.com. > > > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- Thilina Gunarathne - http://thilinag.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2 1.2] Axis2 attachment interoperability???
Hi Thilina, What do you mean Axis2 preserve the order? I tried the attachment test in Axis2 1.2. At that time, I can see that the order of the attachment is not preserved, at least by default the order is not preserve. I encountered scenarios that I even encountered scenarios that I retrieved attachment parts before SOAP body when I iterated the AttachmentMap. The WS-I Attachment Profile 1.0 Final R2921 specifies that the order of mime parts should not be inferred from the parts definition in WSDL. I.e., the order of attachment parts should not be preserved. Hi skudx, Which order do you want to preserve? You want the attachment parts have the same order as the definition in WSDL, or you want the attachment parts received in the same order as they are sent? As for the former order, it should not be preserved as specified by WS-I Attachment Profile 1.0 Final R2921. As for the latter order, the AttachmentMap is a map, I don't know how you can preserve the order. Maybe some Axis2 developer can help you. But as a walkaround, I would prefer to use the contentID or some element specified in the WSDL Schema part to associate each attachment part with a name. Regards, Xinjun On 10/17/07, Thilina Gunarathne <[EMAIL PROTECTED]> wrote: > > > But as for preserving the order of attachments, I don't think Axis2 > > developers will consider this request. > I think we do support that... Can you please double check and let us > know whether it's broken. > > thanks, > Thilina > > >You should not rely on the order of > > the attachments. You should use something like contentID or name to > > associate an ID with certain attachment. > > > > > > Regards, > > Xinjun > > > > > > > > On 10/10/07, skudx <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi Thilina/ Xinjun, > > > > > > Could you pl have a look at > > https://issues.apache.org/jira/browse/AXIS2-3245 > > > & give me some pointers to move ahead? > > > > > > My current requirements force me to use jax-ws-ri on the server-side & > > axis2 > > > on the client-side. The request/ response messages typically have more > > than > > > one binary attachments and the order of attachments must be preserved. > > > > > > Thanks > > > Regards > > > > > > > > > -- > > > View this message in context: > > > http://www.nabble.com/-Axis2-1.2--Axis2-attachment-interoperabilitytf3906797.html#a13125936 > > > Sent from the Axis - User mailing list archive at Nabble.com. > > > > > > > > > > > - > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > > > -- > Thilina Gunarathne - http://thilinag.blogspot.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >