RE: [Axiom]Re: Axis2: "ContentID is null" using MTOM
Sorry but I’m not. The best and only resource has been the WSE 3.0 download and samples, which will be located at: \Microsoft WSE\v3.0\Samples\CS\QuickStart\Basic\BinaryDataMTOM From there I read and understood the service example, but there is a client example too. Ivan From: Tech Savvy [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 3:14 PM To: axis-user@ws.apache.org Subject: Re: [Axiom]Re: Axis2: "ContentID is null" using MTOM Ivan, Thanks for your offer. Are you familiar with the .NET C# technology? I need a jump start on how to quickly create a C# client to access a web serivce, i.e. what to download/set up, a simple tutorial, etc... Thanks. Sunny * On 7/5/06, Ivan Vasquez <[EMAIL PROTECTED]> wrote: Sunny, I will try that immediately. By the way, I have a working prototype of MTOM from .Net to Axis2. Even though I see that you need the opposite scenario, let me know if mine can help at all. Thank you, Ivan. From: Tech Savvy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 05, 2006 2:54 PM To: axis-user@ws.apache.org Subject: Re: [Axiom]Re: Axis2: "ContentID is null" using MTOM Ivan, In my experience, you can use OMText.isOptimized() to detect whether MTOM is presented. If it is, it will return true. By the way, in the senario you describe, it seems like you shouldn't need to worry about getting the handler and all that, if you simply want to retrieve the binary data being sent back. The AXIS2 API will automatically converted a MTOM soap back to standard SOAP so you client is not affected by this underline transport technlogy. You can simply get the OMText out and decoded with org.apache.axis2.util.Base64.decode() to get the binary data out... Of course if you choose, if OMText.isOptimized() returns true, you can still get the hander to use the input stream to get the binary data out. However this approach makes the client depends on or be awared of the SOAP transport mechanism, which is not necessary... Thanks. Sunny * On 7/5/06, Ivan Vasquez < [EMAIL PROTECTED]> wrote: Thilina, In line with your comments, the .Net service seems to have a threshold. For very small files (<700 bytes) it puts its base64 representation inside the soap envelope. For larger files I get several MIME sections as expected. In Axis2/Axiom, is there a way to tell whether an MTOM attachment is present? Thank you! Ivan. From: Thilina Gunarathne [mailto: [EMAIL PROTECTED]] Sent: Wednesday, July 05, 2006 1:43 PM To: axis-user@ws.apache.org; commons-dev@ws.apache.org Subject: [Axiom]Re: Axis2: "ContentID is null" using MTOM Receiving binary can happen as either MTOM attachments or as Base64 encoded text. In the case of Base64 user has to explicitly specify that the content is binary, before calling getDataHandler(), getInputStream() As you can see in this message no MTOM attachments are present in the response, eventhough a MIME envelope is used. Binary file is in lined using base64 encoding. TmFocmdpcw== You need to add the following before calling for getDataHandler. binaryNode.setOptimize(true); Even though it works, IMHO above method is not the clean way to do this.. Because of that I'm going to introduce the setBinary(boolean value) method to OMText.. You will be able to get that method in SVN head in couple of hours. ~Thilina On 7/5/06, Ivan Vasquez < [EMAIL PROTECTED]> wrote: Hi, I'm using Axis2 to call a .Net service which returns a binary file. I've read the documentation and followed the examples, and both parties are using MTOM. But when my code runs: OMElement elem = (OMElement)it.next(); ... OMText binaryNode = (OMText)elem.getFirstOMChild(); DataHandler actualDH = (DataHandler)binaryNode.getDataHandler(); The last instruction causes: java.lang.RuntimeException: ContentID is null at org.apache.axiom.om.impl.llom.OMTextImpl.getDataHandler(OMTextImpl.java: 339) at edu.uga.cviog.itos.ws.Client.foo (Client.java:87) at edu.uga.cviog.itos.ws.Client.main(Client.java:36) >From what I see, the response message *does* have a "content-id" field (below). Could you help me determine what's wrong? Here are the exchanged messages: AXIS2 Request (synchronous): POST /Interop/BinaryDataMTOMService.asmx HTTP/1.1 User-Agent: Axis/2.0 Host: 127.0.0.1: Transfer-Encoding: chunked Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491; type="application/xop+xml"; start="< 0.urn:uuid:[EMAIL PROTECTED]>"; start-info="application/soap+xml"; charset=UTF-8;action="" href="http://stockservice.contoso.com/wse/samples/2005/1" target="_blank"> http://stockservice.
Re: [Axiom]Re: Axis2: "ContentID is null" using MTOM
Ivan,Thanks for your offer. Are you familiar with the .NET C# technology? I need a jump start on how to quickly create a C# client to access a web serivce, i.e. what to download/set up, a simple tutorial, etc... Thanks.Sunny *On 7/5/06, Ivan Vasquez <[EMAIL PROTECTED]> wrote: Sunny, I will try that immediately. By the way, I have a working prototype of MTOM from .Net to Axis2. Even though I see that you need the opposite scenario, let me know if mine can help at all. Thank you, Ivan. From: Tech Savvy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 05, 2006 2:54 PM To: axis-user@ws.apache.org Subject: Re: [Axiom]Re: Axis2: "ContentID is null" using MTOM Ivan, In my experience, you can use OMText.isOptimized() to detect whether MTOM is presented. If it is, it will return true. By the way, in the senario you describe, it seems like you shouldn't need to worry about getting the handler and all that, if you simply want to retrieve the binary data being sent back. The AXIS2 API will automatically converted a MTOM soap back to standard SOAP so you client is not affected by this underline transport technlogy. You can simply get the OMText out and decoded with org.apache.axis2.util.Base64.decode() to get the binary data out... Of course if you choose, if OMText.isOptimized() returns true, you can still get the hander to use the input stream to get the binary data out. However this approach makes the client depends on or be awared of the SOAP transport mechanism, which is not necessary... Thanks. Sunny * On 7/5/06, Ivan Vasquez < [EMAIL PROTECTED]> wrote: Thilina, In line with your comments, the .Net service seems to have a threshold. For very small files (<700 bytes) it puts its base64 representation inside the soap envelope. For larger files I get several MIME sections as expected. In Axis2/Axiom, is there a way to tell whether an MTOM attachment is present? Thank you! Ivan. From: Thilina Gunarathne [mailto: [EMAIL PROTECTED]] Sent: Wednesday, July 05, 2006 1:43 PM To: axis-user@ws.apache.org; commons-dev@ws.apache.org Subject: [Axiom]Re: Axis2: "ContentID is null" using MTOM Receiving binary can happen as either MTOM attachments or as Base64 encoded text. In the case of Base64 user has to explicitly specify that the content is binary, before calling getDataHandler(), getInputStream() As you can see in this message no MTOM attachments are present in the response, eventhough a MIME envelope is used. Binary file is in lined using base64 encoding. TmFocmdpcw== You need to add the following before calling for getDataHandler. binaryNode.setOptimize(true); Even though it works, IMHO above method is not the clean way to do this.. Because of that I'm going to introduce the setBinary(boolean value) method to OMText.. You will be able to get that method in SVN head in couple of hours. ~Thilina On 7/5/06, Ivan Vasquez < [EMAIL PROTECTED]> wrote: Hi, I'm using Axis2 to call a .Net service which returns a binary file. I've read the documentation and followed the examples, and both parties are using MTOM. But when my code runs: OMElement elem = (OMElement)it.next(); ... OMText binaryNode = (OMText)elem.getFirstOMChild(); DataHandler actualDH = (DataHandler)binaryNode.getDataHandler(); The last instruction causes: java.lang.RuntimeException: ContentID is null at org.apache.axiom.om.impl.llom.OMTextImpl.getDataHandler(OMTextImpl.java: 339) at edu.uga.cviog.itos.ws.Client.foo (Client.java:87) at edu.uga.cviog.itos.ws.Client.main(Client.java:36) >From what I see, the response message *does* have a "content-id" field (below). Could you help me determine what's wrong? Here are the exchanged messages: AXIS2 Request (synchronous): POST /Interop/BinaryDataMTOMService.asmx HTTP/1.1 User-Agent: Axis/2.0 Host: 127.0.0.1: Transfer-Encoding: chunked Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491; type="application/xop+xml"; start="< 0.urn:uuid:[EMAIL PROTECTED]>"; start-info="application/soap+xml"; charset=UTF-8;action="" href="http://stockservice.contoso.com/wse/samples/2005/1" target="_blank" > http://stockservice.contoso.com/wse/samples/2005/1 0/GetFile"; 1d1 --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491 content-type:application/xop+xml; charset=UTF-8; type="application/soap+xml"; content-transfer-encoding:binary content-id:<0.urn:uuid:[EMAIL PROTECTED] > xmlns:soapenv=" http://www.w3.org/2003/05/soap-envelope"> --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491-- 0 .NET Response: HTTP/1.1 100 Continue Server: Micr
RE: [Axiom]Re: Axis2: "ContentID is null" using MTOM
Sunny, I will try that immediately. By the way, I have a working prototype of MTOM from .Net to Axis2. Even though I see that you need the opposite scenario, let me know if mine can help at all. Thank you, Ivan. From: Tech Savvy [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 2:54 PM To: axis-user@ws.apache.org Subject: Re: [Axiom]Re: Axis2: "ContentID is null" using MTOM Ivan, In my experience, you can use OMText.isOptimized() to detect whether MTOM is presented. If it is, it will return true. By the way, in the senario you describe, it seems like you shouldn't need to worry about getting the handler and all that, if you simply want to retrieve the binary data being sent back. The AXIS2 API will automatically converted a MTOM soap back to standard SOAP so you client is not affected by this underline transport technlogy. You can simply get the OMText out and decoded with org.apache.axis2.util.Base64.decode() to get the binary data out... Of course if you choose, if OMText.isOptimized() returns true, you can still get the hander to use the input stream to get the binary data out. However this approach makes the client depends on or be awared of the SOAP transport mechanism, which is not necessary... Thanks. Sunny * On 7/5/06, Ivan Vasquez <[EMAIL PROTECTED]> wrote: Thilina, In line with your comments, the .Net service seems to have a threshold. For very small files (<700 bytes) it puts its base64 representation inside the soap envelope. For larger files I get several MIME sections as expected. In Axis2/Axiom, is there a way to tell whether an MTOM attachment is present? Thank you! Ivan. From: Thilina Gunarathne [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 05, 2006 1:43 PM To: axis-user@ws.apache.org; commons-dev@ws.apache.org Subject: [Axiom]Re: Axis2: "ContentID is null" using MTOM Receiving binary can happen as either MTOM attachments or as Base64 encoded text. In the case of Base64 user has to explicitly specify that the content is binary, before calling getDataHandler(), getInputStream() As you can see in this message no MTOM attachments are present in the response, eventhough a MIME envelope is used. Binary file is in lined using base64 encoding. TmFocmdpcw== You need to add the following before calling for getDataHandler. binaryNode.setOptimize(true); Even though it works, IMHO above method is not the clean way to do this.. Because of that I'm going to introduce the setBinary(boolean value) method to OMText.. You will be able to get that method in SVN head in couple of hours. ~Thilina On 7/5/06, Ivan Vasquez < [EMAIL PROTECTED]> wrote: Hi, I'm using Axis2 to call a .Net service which returns a binary file. I've read the documentation and followed the examples, and both parties are using MTOM. But when my code runs: OMElement elem = (OMElement)it.next(); ... OMText binaryNode = (OMText)elem.getFirstOMChild(); DataHandler actualDH = (DataHandler)binaryNode.getDataHandler(); The last instruction causes: java.lang.RuntimeException: ContentID is null at org.apache.axiom.om.impl.llom.OMTextImpl.getDataHandler(OMTextImpl.java: 339) at edu.uga.cviog.itos.ws.Client.foo (Client.java:87) at edu.uga.cviog.itos.ws.Client.main(Client.java:36) >From what I see, the response message *does* have a "content-id" field (below). Could you help me determine what's wrong? Here are the exchanged messages: AXIS2 Request (synchronous): POST /Interop/BinaryDataMTOMService.asmx HTTP/1.1 User-Agent: Axis/2.0 Host: 127.0.0.1: Transfer-Encoding: chunked Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491; type="application/xop+xml"; start="< 0.urn:uuid:[EMAIL PROTECTED]>"; start-info="application/soap+xml"; charset=UTF-8;action="" href="http://stockservice.contoso.com/wse/samples/2005/1" target="_blank"> http://stockservice.contoso.com/wse/samples/2005/1 0/GetFile"; 1d1 --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491 content-type:application/xop+xml; charset=UTF-8; type="application/soap+xml"; content-transfer-encoding:binary content-id:<0.urn:uuid:[EMAIL PROTECTED] > xmlns:soapenv=" http://www.w3.org/2003/05/soap-envelope"> --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491-- 0 .NET Response: HTTP/1.1 100 Continue Server: Microsoft-IIS/5.1 Date: Wed, 05 Jul 2006 13:52:02 GMT X-Powered-By: ASP.NET HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Wed, 05 Jul 2006 13:52:02 GMT X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Cache-Control: private, max-age=0 Content-Type: multipart/rela
Re: [Axiom]Re: Axis2: "ContentID is null" using MTOM
Ivan,In my experience, you can use OMText.isOptimized() to detect whether MTOM is presented. If it is, it will return true. By the way, in the senario you describe, it seems like you shouldn't need to worry about getting the handler and all that, if you simply want to retrieve the binary data being sent back. The AXIS2 API will automatically converted a MTOM soap back to standard SOAP so you client is not affected by this underline transport technlogy. You can simply get the OMText out and decoded with org.apache.axis2.util.Base64.decode() to get the binary data out...Of course if you choose, if OMText.isOptimized() returns true, you can still get the hander to use the input stream to get the binary data out. However this approach makes the client depends on or be awared of the SOAP transport mechanism, which is not necessary... Thanks.Sunny *On 7/5/06, Ivan Vasquez <[EMAIL PROTECTED]> wrote: Thilina, In line with your comments, the .Net service seems to have a threshold. For very small files (<700 bytes) it puts its base64 representation inside the soap envelope. For larger files I get several MIME sections as expected. In Axis2/Axiom, is there a way to tell whether an MTOM attachment is present? Thank you! Ivan. From: Thilina Gunarathne [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 05, 2006 1:43 PM To: axis-user@ws.apache.org; commons-dev@ws.apache.org Subject: [Axiom]Re: Axis2: "ContentID is null" using MTOM Receiving binary can happen as either MTOM attachments or as Base64 encoded text. In the case of Base64 user has to explicitly specify that the content is binary, before calling getDataHandler(), getInputStream() As you can see in this message no MTOM attachments are present in the response, eventhough a MIME envelope is used. Binary file is in lined using base64 encoding. TmFocmdpcw== You need to add the following before calling for getDataHandler. binaryNode.setOptimize(true); Even though it works, IMHO above method is not the clean way to do this.. Because of that I'm going to introduce the setBinary(boolean value) method to OMText.. You will be able to get that method in SVN head in couple of hours. ~Thilina On 7/5/06, Ivan Vasquez < [EMAIL PROTECTED]> wrote: Hi, I'm using Axis2 to call a .Net service which returns a binary file. I've read the documentation and followed the examples, and both parties are using MTOM. But when my code runs: OMElement elem = (OMElement)it.next(); ... OMText binaryNode = (OMText)elem.getFirstOMChild(); DataHandler actualDH = (DataHandler)binaryNode.getDataHandler(); The last instruction causes: java.lang.RuntimeException: ContentID is null at org.apache.axiom.om.impl.llom.OMTextImpl.getDataHandler(OMTextImpl.java: 339) at edu.uga.cviog.itos.ws.Client.foo (Client.java:87) at edu.uga.cviog.itos.ws.Client.main(Client.java:36) >From what I see, the response message *does* have a "content-id" field (below). Could you help me determine what's wrong? Here are the exchanged messages: AXIS2 Request (synchronous): POST /Interop/BinaryDataMTOMService.asmx HTTP/1.1 User-Agent: Axis/2.0 Host: 127.0.0.1: Transfer-Encoding: chunked Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491; type="application/xop+xml"; start="< 0.urn:uuid:[EMAIL PROTECTED]>"; start-info="application/soap+xml"; charset=UTF-8;action="" href="http://stockservice.contoso.com/wse/samples/2005/1" target="_blank" > http://stockservice.contoso.com/wse/samples/2005/1 0/GetFile"; 1d1 --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491 content-type:application/xop+xml; charset=UTF-8; type="application/soap+xml"; content-transfer-encoding:binary content-id:<0.urn:uuid:[EMAIL PROTECTED] > xmlns:soapenv=" http://www.w3.org/2003/05/soap-envelope"> --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491-- 0 .NET Response: HTTP/1.1 100 Continue Server: Microsoft-IIS/5.1 Date: Wed, 05 Jul 2006 13:52:02 GMT X-Powered-By: ASP.NET HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Wed, 05 Jul 2006 13:52:02 GMT 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=--MIMEBoundary632876899223120893; start="< [EMAIL PROTECTED] >"; start-info="application/soap+xml; charset=utf-8" Content-Length: 1569 MIMEBoundary632876899223120893 content-id: < [EMAIL PROTECTED] > content-type: application/xop+xml; charset=utf-8; type="application/soap+xml; charset=utf-8" content-transfer-encoding: binary http://www.w3.org/2004/08/xop/include" xmlns:soap=" http://www.w3.org/2003/05/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
RE: [Axiom]Re: Axis2: "ContentID is null" using MTOM
Thilina, In line with your comments, the .Net service seems to have a threshold. For very small files (<700 bytes) it puts its base64 representation inside the soap envelope. For larger files I get several MIME sections as expected. In Axis2/Axiom, is there a way to tell whether an MTOM attachment is present? Thank you! Ivan. From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 05, 2006 1:43 PM To: axis-user@ws.apache.org; commons-dev@ws.apache.org Subject: [Axiom]Re: Axis2: "ContentID is null" using MTOM Receiving binary can happen as either MTOM attachments or as Base64 encoded text. In the case of Base64 user has to explicitly specify that the content is binary, before calling getDataHandler(), getInputStream() As you can see in this message no MTOM attachments are present in the response, eventhough a MIME envelope is used. Binary file is in lined using base64 encoding. TmFocmdpcw== You need to add the following before calling for getDataHandler. binaryNode.setOptimize(true); Even though it works, IMHO above method is not the clean way to do this.. Because of that I'm going to introduce the setBinary(boolean value) method to OMText.. You will be able to get that method in SVN head in couple of hours. ~Thilina On 7/5/06, Ivan Vasquez <[EMAIL PROTECTED]> wrote: Hi, I'm using Axis2 to call a .Net service which returns a binary file. I've read the documentation and followed the examples, and both parties are using MTOM. But when my code runs: OMElement elem = (OMElement)it.next(); ... OMText binaryNode = (OMText)elem.getFirstOMChild(); DataHandler actualDH = (DataHandler)binaryNode.getDataHandler(); The last instruction causes: java.lang.RuntimeException: ContentID is null at org.apache.axiom.om.impl.llom.OMTextImpl.getDataHandler(OMTextImpl.java: 339) at edu.uga.cviog.itos.ws.Client.foo (Client.java:87) at edu.uga.cviog.itos.ws.Client.main(Client.java:36) >From what I see, the response message *does* have a "content-id" field (below). Could you help me determine what's wrong? Here are the exchanged messages: AXIS2 Request (synchronous): POST /Interop/BinaryDataMTOMService.asmx HTTP/1.1 User-Agent: Axis/2.0 Host: 127.0.0.1: Transfer-Encoding: chunked Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491; type="application/xop+xml"; start="< 0.urn:uuid:[EMAIL PROTECTED]>"; start-info="application/soap+xml"; charset=UTF-8;action="" href="http://stockservice.contoso.com/wse/samples/2005/1" target="_blank"> http://stockservice.contoso.com/wse/samples/2005/1 0/GetFile"; 1d1 --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491 content-type:application/xop+xml; charset=UTF-8; type="application/soap+xml"; content-transfer-encoding:binary content-id:<0.urn:uuid:[EMAIL PROTECTED] > xmlns:soapenv=" http://www.w3.org/2003/05/soap-envelope"> --MIMEBoundaryurn_uuid_D2233EEE05CE572BC211521075222491-- 0 .NET Response: HTTP/1.1 100 Continue Server: Microsoft-IIS/5.1 Date: Wed, 05 Jul 2006 13:52:02 GMT X-Powered-By: ASP.NET HTTP/1.1 200 OK Server: Microsoft-IIS/5.1 Date: Wed, 05 Jul 2006 13:52:02 GMT 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=--MIMEBoundary632876899223120893; start="< [EMAIL PROTECTED] >"; start-info="application/soap+xml; charset=utf-8" Content-Length: 1569 MIMEBoundary632876899223120893 content-id: < [EMAIL PROTECTED] > content-type: application/xop+xml; charset=utf-8; type="application/soap+xml; charset=utf-8" content-transfer-encoding: binary http://www.w3.org/2004/08/xop/include" xmlns:soap=" http://www.w3.org/2003/05/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-wsse curity-secext-1.0.xsd " xmlns:wsu=" http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec urity-utility-1.0.xsd"> xmlns:env=" http://www.w3.org/2003/05/soap-envelope"> http://stockservice.contoso.com/wse/samples/2005/10/GetFileR esponse urn:uuid:d4be97db-bdaa-428a-87cd-554aa2192a75 eID> urn:uuid:850f1505-4dcb-475a-93b7-8bc5e274cea5 sTo> http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous < /wsa:To> wsu:Id="Timestamp-39117870-658a-4e5a-b3aa-d149240a1cbb"> 2006-07-05T14:04:45Z 2006-07-05T14:09:45Z xmlns=" http://stockservice.contoso.com/wse/samples/2005/10 "> hola.txt TmFocmdpcw== MIMEBoundary6328