axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertlazarski <robertlazar...@gmail.com>
Subject Re: axis2 client issue with version 1.7.8
Date Tue, 31 Jul 2018 16:09:16 GMT
On Tue, Jul 31, 2018 at 4:18 AM, viji.mv <viji.mv@beo.in> wrote:

> Hello,
>
> I have checked the document given in this thread and tried the code
> changes , but no positive result
>
> while using axis2 1.7.8
>
> in response message context , have following values
>
> response message context Properties :
>
> ContentType = multipart/related; boundary="----=_Part_70639_
> 27660911.1533020418529"
>
> transport.http.statusCode = 500
>
> HttpTransportHeaders :
>
> [X-Backside-Transport: FAIL FAIL
> , Connection: Keep-Alive
> , Transfer-Encoding: chunked
> , Date: Mon, 30 Jul 2018 13:52:31 GMT
> , Server: Jetty/5.1.0 (Linux/2.6.16.60-0.132.1-bigsmp i386 java/1.5.0_11
> , Content-Type: multipart/related; boundary="----=_Part_70639_
> 27660911.1533020418529"
> , X-Global-Transaction-ID: 521669063
> ]
>
> can you find anything from this regarding , why the type ="text/xml" is
> missing
>
>
>
The unit tests show the mime type working, see below. I suggest using that
code.

https://svn.apache.org/repos/asf/axis/axis2/java/core/branches/1_7/modules/integration/test/org/apache/axis2/mtom/EchoRawMTOMTest.java

2018/07/31 09:58:58:524 MDT [DEBUG] header - >> "Content-Type:
multipart/related;
boundary="MIMEBoundary_9be0dd97528736a98c8ef1df4603d992065767328beee9af";
type="text/xml"; start="<
0.8be0dd97528736a98c8ef1df4603d992065767328beee9af@apache.org>"[\r][\n]"

See below for an example from my local environment.

[linux-7cab(iksrazal)]
 /home/iksrazal/repos/axis2/178/v1.7.8/modules/integration> mvn
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.showdatetime=true
-Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug
-Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=debug
-Dtest=EchoRawSwATest clean test

[linux-7cab(iksrazal)]
 /home/iksrazal/repos/axis2/178/v1.7.8/modules/integration> cat
./target/surefire-reports/org.apache.axis2.swa.EchoRawSwATest-output.txt |
grep type
2018/07/31 09:58:58:524 MDT [DEBUG] header - >> "Content-Type:
multipart/related;
boundary="MIMEBoundary_9be0dd97528736a98c8ef1df4603d992065767328beee9af";
type="text/xml"; start="<
0.8be0dd97528736a98c8ef1df4603d992065767328beee9af@apache.org>"[\r][\n]"
2018/07/31 09:58:58:700 MDT [DEBUG] header - << "Content-Type:
multipart/related;
boundary="MIMEBoundary_dbe0dd97528736a964fef1df4603d992f65767328beee9af";
type="text/xml"; start="<
0.cbe0dd97528736a964fef1df4603d992f65767328beee9af@apache.org>"[\r][\n]"

Thank you
> Regards,
>
> Viji.
>
> On 07/20/2018 01:52 PM, viji.mv wrote:
>
> Hello,
>
> Actually we are getting correct response with Axis2 1.4.1
>
> we are sending an xml file and receiving xml with attachment .
>
> And that attachment is retrieving using this code
>
>
>             Attachments attachments = _returnMessageContext.
> getAttachmentMap();
>             List contentIDList = attachments.getContentIDList();
>             String[] idList = attachments.getAllContentIDs();
>             DataHandler pdfDataHandler;
>
>             for (int i = 0; i < idList.length; i++)
>                 {
>                     String temp = idList[i];
>                     pdfDataHandler = _returnMessageContext.
> getAttachment(temp);
>                     File xmlFile = null;
>
>                     File pdfFile = null;
>
>                     if (i == 0)
>                     {
>                         fileName = fileDir + timeStamp + ".xml";
>                         xmlFile = new File(fileName);
>                         FileOutputStream outputStream;
>                         outputStream = new FileOutputStream(xmlFile);
>                         pdfDataHandler.writeTo(outputStream);
>                         outputStream.flush();
>                         outputStream.close();
>
>                     }
>                     else
>                     {
>                         String type = "";
>                         type = temp.substring(0, temp.indexOf("="));
>                         fileName = fileDir +  "_" + type + "_" + timeStamp
> + ".pdf";
>                         pdfFile = new File(fileName);
>                         ByteArrayOutputStream byte1 = new
> ByteArrayOutputStream();
>                         pdfDataHandler.writeTo(byte1);
>                         FileOutputStream outputStream;
>                         outputStream = new FileOutputStream(pdfFile);
>                         Base64 decoder = new Base64();
>                         byte[] decoded_data =
> decoder.decode(byte1.toString());
>                         outputStream.write(decoded_data);
>                         outputStream.flush();
>                         outputStream.close();
>
>                     }
>                 }
>
>
>
>
> On 07/20/2018 10:42 AM, viji.mv wrote:
>
> Hello,
>
> In client side we are just sending a request xml , not with any
> attachment, From server side when response comes, there will be attachments.
>
> So should we set the mime type from client side itself?
>
> Thank you very much for your help. i will check with samples at
> https://axis.apache.org/axis2/java/core/docs/mtom-guide.html
>
>
>
> Thanks
>
> Regards
>
> Viji
>
> On 07/19/2018 10:15 PM, robertlazarski wrote:
>
>
>
> On Wed, Jul 18, 2018 at 8:02 AM, robertlazarski <robertlazarski@gmail.com>
> wrote:
>
>>
>>
>> On Wed, Jul 18, 2018 at 8:01 AM, robertlazarski <robertlazarski@gmail.com
>> > wrote:
>>
>>>
>>>
>>> On Wed, Jul 18, 2018 at 7:54 AM, viji.mv <viji.mv@beo.in> wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> I am running axis client using axis2 version 1.7.8 and getting following
>>>> error.
>>>>
>>>> It is found that type is null
>>>>
>>>> org.apache.axis2.AxisFault
>>>>     at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>>>>     at
>>>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(
>>>> TransportUtils.java:122)
>>>>     at
>>>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(
>>>> TransportUtils.java:66)
>>>>     at
>>>> org.apache.axis2.description.OutInAxisOperationClient.handle
>>>> Response(OutInAxisOperation.java:347)
>>>>     at
>>>> org.apache.axis2.description.OutInAxisOperationClient.send(O
>>>> utInAxisOperation.java:414)
>>>>     at
>>>> org.apache.axis2.description.OutInAxisOperationClient.execut
>>>> eImpl(OutInAxisOperation.java:225)
>>>>     at
>>>> org.apache.axis2.client.OperationClient.execute(OperationCli
>>>> ent.java:150)
>>>>     at
>>>> edecwebservice171.EdecServiceStub.goodsDeclarations(EdecServ
>>>> iceStub.java:490)
>>>>     at edecwebservice171.Test.main(Test.java:86)
>>>> Caused by: java.lang.NullPointerException
>>>>     at
>>>>
>>>
>
> Please post to the list.
>
> Best I can tell from the attached xml and these headers sent to my gmail
> account, you are using SWA for an attachment however these headers are
> missing the mime type aka media type.
>
> It should look like this example from the docs,  type="text/xml" :
>
> https://axis.apache.org/axis2/java/core/docs/mtom-guide.html
>
> Content-Type: multipart/related; type="text/xml";
>           start="<9D645C8EBB837CE54ABD027A3659535D>";
>                 boundary="----=_Part_0_1977511.1123163571138"
>
>
>
> The docs from the link above show some code for creating the mime type. I suggest starting
there and if you still have problems, paste your entire client code.
>
>
>
>
>
>> org.apache.axis2.builder.MIMEBuilder.processDocument(MIMEBuilder.java:72)
>>>>     at
>>>> org.apache.axis2.transport.TransportUtils.createDocumentElem
>>>> ent(TransportUtils.java:203)
>>>>     at
>>>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(
>>>> TransportUtils.java:144)
>>>>     at
>>>> org.apache.axis2.transport.TransportUtils.createSOAPMessage(
>>>> TransportUtils.java:107)
>>>>
>>>>
>>>> Any help is appreciated.
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Viji M V
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
>>>> For additional commands, e-mail: java-dev-help@axis.apache.org
>>>>
>>>>
>>> Here's the source that is failing in MIMEBuilder.java, the quickest way
>>> to debug would be to compile from source and see what is null here:
>>>
>>>  return builder.processDocument(attachments.getRootPartInputStream(f
>>> alse),
>>>                     type, msgContext);
>>>
>>> Best regards,
>>> Robert
>>>
>>
>> Ah you said type is null.
>>
>>    String type = ct.getParameter("type");
>>
>> That is content type. Maybe the request doesn't include it?
>>
>>
>
>
>
>

Mime
View raw message