Hi Ramindu,

When using binary relay builder message is encoded and wrapped in an
envelop. [1] contains more information regarding this.

How are you trying to access the data?

If you need to access it from a class mediator you need to decode the
message.

eg:-

                javax.xml.namespace.QName BINARY_CONTENT_QNAME = new
javax.xml.namespace.QName("http://ws.apache.org/commons/ns/payload";,
"binary");
org.apache.axiom.om.OMElement contentEle =
((org.apache.synapse.core.axis2.Axis2MessageContext)mc).getEnvelope().getBody().getFirstChildWithName(BINARY_CONTENT_QNAME);
System.out.println(contentEle.getText());
byte[]bytes = org.apache.axiom.om.util.Base64.decode(contentEle.getText());

System.out.println("
<----------------------------------------------------------- >");
System.out.println(new String(bytes));
System.out.println("
<----------------------------------------------------------- >");

1
http://wso2.com/library/articles/binary-relay-efficient-way-pass-both-xml-non-xml-content-through-apache-synapse/

Best Regards,
Malaka


On Mon, Jan 27, 2014 at 8:11 AM, Ramindu Deshapriya <[email protected]>wrote:

> Essentially what I'm trying to do is, attach a file along with a REStful
> PUT request, the same as you'd be able to do through a SOAPUI REST project.
>
> Thanks.
>
> ------------------------------
> View this message in context: Re: [ESB] Sending Binary data as request
> body<http://wso2-oxygen-tank.10903.n7.nabble.com/ESB-Sending-Binary-data-as-request-body-tp90764p91256.html>
>
> Sent from the WSO2 Development mailing list 
> archive<http://wso2-oxygen-tank.10903.n7.nabble.com/WSO2-Development-f3.html>at
>  Nabble.com.
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/<http://wso2.com/about/team/malaka-silva/>

Save a tree -Conserve nature & Save the world for your future. Print this
email only if it is absolutely necessary.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to