Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-29 Thread Jorge Infante Osorio
Hi Udayanga:

De: carbon-dev-boun...@wso2.org [mailto:carbon-dev-boun...@wso2.org] En
nombre de Udayanga Wickramasinghe
Enviado el: domingo, 29 de mayo de 2011 13:01
Para: carbon-dev@wso2.org
Asunto: Re: [Carbon-dev] Using class mediator to chance an output message

On Sun, May 29, 2011 at 9:35 PM, Jorge Infante Osorio 
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  element, and
in the outgoing message I want to see . 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");

Thanks for this. It work just fine.

Jorge.

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 
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 
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

Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-29 Thread Udayanga Wickramasinghe
On Sun, May 29, 2011 at 9:35 PM, Jorge Infante Osorio 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  element,
> and
> in the outgoing message I want to see . 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 
> 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 
> 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 Fe

Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-29 Thread Anjana Fernando
Hi Jorge,

On Sun, May 29, 2011 at 9:35 PM, Jorge Infante Osorio 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  element,
> and
> in the outgoing message I want to see . Or I need to use xpath?
>

Yeah you can, basically when you get the "mc.getEnvelope().getBody()",
you've fully control over the XML element, and you can add elements or
create a whole new element and set it as the body. So here, the XML element
is represented by an OMElement, which is from the AXIOM API. For more info
on AXIOM check out its documentation, and there are plenty of articles on
it, like this [1].

[1] http://today.java.net/pub/a/today/2005/05/10/axiom.html

Cheers,
Anjana.


>
>
> 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 
> 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 
> 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-

Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-29 Thread Jorge Infante Osorio
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  element, and
in the outgoing message I want to see . Or I need to use xpath?


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 
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 
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


Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-27 Thread Anjana Fernando
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 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 
> 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


Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-26 Thread Jorge Infante Osorio
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 
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


Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-22 Thread Hiranya Jayathilaka
On Sun, May 22, 2011 at 12:06 AM, Jorge Infante Osorio 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?
>

Do you want to set the image as an attachment or into the payload as a
base64 string? If it's the latter it should be pretty easy to convert the
Object into a base64 String (using some Java tricks) and set it into the
SOAP envelope using the setText method. If it's the former then you should
use a DataHandler. Article at [1] may provide some help.

Thanks,
Hiranya

[1] - http://wso2.org/library/1675


>
> 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
>



-- 
Hiranya Jayathilaka
Senior Software Engineer;
WSO2 Inc.;  http://wso2.org
E-mail: hira...@wso2.com;  Mobile: +94 77 633 3491
Blog: http://techfeast-hiranya.blogspot.com
___
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev


Re: [Carbon-dev] Using class mediator to chance an output message

2011-05-21 Thread Anjana Fernando
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#setProperty%28java.lang.String,%20java.lang.Object%29

Cheers,
Anjana.

On Sun, May 22, 2011 at 12:06 AM, Jorge Infante Osorio 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


[Carbon-dev] Using class mediator to chance an output message

2011-05-21 Thread Jorge Infante Osorio
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