On Sun, May 29, 2011 at 9:35 PM, Jorge Infante Osorio <jorg...@uci.cu>wrote:

> Thanks any way Anjana.
>
> I found some interesting articles about what I want to do.
>
> Another question:
>
> Can I change the name of an element in the SOAP message using the class
> mediator?. For example in the incoming message I have the <url> element,
> and
> in the outgoing message I want to see <image>. Or I need to use xpath?
>

xapth is not a absolute must. Axiom gives you much control on
select/update/delete ops over xml linfoset. Exact  code for your scneario
would be similar to folllowing ,

OMElement urlEl = payloadEl.getFirstChildWithName(new QName("
http://your.namespace";, "url"));

urlEl.setLocalName("image");

Regards,
Udayanga


>
>
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> UCI
>
> De: carbon-dev-boun...@wso2.org [mailto:carbon-dev-boun...@wso2.org] En
> nombre de Anjana Fernando
> Enviado el: sábado, 28 de mayo de 2011 1:41
> Para: carbon-dev@wso2.org
> Asunto: Re: [Carbon-dev] Using class mediator to chance an output message
>
> Hi Jorge,
>
> I'm sorry, but Hiranya actually gave the correct answer. I misunderstood
> your question, where I thought, you need to set an object in the
> MessageContext and further down the sequence, you've to retrieve it again.
> These properties will not be shown in anyway in the actual XML payload that
> you will get at the end. It's purely to be used inside the ESB. So please
> follow Hiranya's instructions on setting the image payload in the body of
> the SOAP envelope.
>
> To learn more about the WSO2 ESB, you may want to further read the
> documentation here [1], which contains some useful info, and also check out
> OT [2], for some great articles on the subject.
>
> [1] http://wso2.org/project/esb/java/3.0.1/docs/index.html
> [2] http://wso2.org/library/esb
>
> Cheers,
> Anjana.
> On Thu, May 26, 2011 at 9:23 PM, Jorge Infante Osorio <jorg...@uci.cu>
> wrote:
> Thanks Anjana. Finally I can access to the mc and change the content of one
> element.
>
> I don´t use the serProperty method, because I don´t understand the
> parameters I need to pass. I continue study this. :-D
>
> In this case:
>
> void setProperty(java.lang.String key,
>                 java.lang.Object value)
>
> what is key??
> I figure out that value is the information, in my case the image object
> that
> I need to put into the message.
>
>
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> UCI
> De: carbon-dev-boun...@wso2.org [mailto:carbon-dev-boun...@wso2.org] En
> nombre de Anjana Fernando
> Enviado el: domingo, 22 de mayo de 2011 1:49
> Para: carbon-dev@wso2.org
> Asunto: Re: [Carbon-dev] Using class mediator to chance an output message
>
> Hi Jorge,
>
> In the MessageContext class what you'll have to use is the setProperty [1]
> method. And your jars, you'll have to put them in
> /repository/components/lib.
>
> [1]
>
> http://synapse.apache.org/apidocs/org/apache/synapse/MessageContext.html#set
> Property%28java.lang.String,%20java.lang.Object%29
>
> Cheers,
> Anjana.
> On Sun, May 22, 2011 at 12:06 AM, Jorge Infante Osorio <jorg...@uci.cu>
> wrote:
> Hi folks.
>
> I have the following scenario:
>
> A dataservice in WSAS return inside it response message  an URL that point
> to  the location of a file, in this case a binary file, and in the ESB I
> have a proxy service that return in it message response not the URL but the
> binary file.
>
> So in the dataservice WSDL the xsd type is string and in the proxy service
> the xsd type is base64Binary.
>
> My idea is to implement a class mediator in ESB that access the message
> context, extract the URL, them access to the server that store the file and
> load the file as an object and inject this object back to the message
> context.
>
> I study your class mediator examples and see a code line like this:
>
>
> mc.getEnvelope().getBody().getFirstElement().getFirstElement().getFirstChild
> WithName(nombre).setText(image);
>
> nombre is a QName objet.
> If image is a an object, not a string, how can inject it inside the message
> context? I only found the setText method.
>
> Any help?
>
> Another question: where I have to store the class, I put an example class
> in
> classpath and in [ESB_HOME]\repository\components\plugins\ but I can´t load
> it?
>
>
> Thanks,
> Ing. Jorge Infante Osorio.
> J´Dpto Soluciones SOA.
> CDAE.
> UCI
>
>
> _______________________________________________
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>
>
> --
> Anjana Fernando
> Senior Software Engineer
> WSO2 Inc. | http://wso2.com
> lean . enterprise . middleware
>
> _______________________________________________
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>
>
> --
> Anjana Fernando
> Senior Software Engineer
> WSO2 Inc. | http://wso2.com
> lean . enterprise . middleware
>
> _______________________________________________
> Carbon-dev mailing list
> Carbon-dev@wso2.org
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>



-- 
*Udayanga Wickramasinghe*
Software Engineer; WSO2 Inc.; http://wso2.com,
*email: **udaya...@wso2.com* <udayan...@wso2.com>* cell: +94 (77) 983-4365
blog: **http://udayangawiki.blogspot.com*<http://udayangawiki.blogspot.com/>
*
twitter: **http://twitter.com/udayanga_wick*<http://twitter.com/udayanga_wick>
*
*
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to