Thanks for that, I had assumed something totally different for
context-name.
Just did a quick test and I got it to work.
I will contribute examples for these scenarios below.

Just on this track we are heavy users of Maven2 and we found it was
really easy
to set up and get going. We use a whole range of Open Source stuff and I
have
been for 30 years or more now. We use: Maven, Spring, drools, tomcat,
apache, hibernate,
MySQL, XFire, Axis to name a few. So we are not new to Open Source.
However all of these
are very well documented. So having extreme Open Source experience here,
Synapse 
still stands out as impenetrable.

I am quite happy with bugs, but at the moment I have no idea if the
issues are 
bugs or features. One example I found, the VFS memory leak was a bug. So
step
one is checking if an issue is a bug.... So the memory leak issue
highlights that
our problem could not have been solved in a week or two; let alone in a
3 hour course.

To me raising these issues is contributing to the Testing of the
product.

Our local area is Australia, so training in the US and Apache
conferences
are out of the Question. I would have thought WS02 would be sponsoring
Synapse ?
I think we are in a difficult space now, way past tutorials, and intro
courses
but trying to use the tool in anger, for a real problem.

Yes the Synapse book is clearly needed; as is a good Axis book. 



-----Original Message-----
From: Asankha Perera [mailto:[email protected]] On Behalf Of
Asankha C. Perera
Sent: Wednesday, 11 March 2009 1:50 PM
To: [email protected]
Subject: Re: POJOCommand Fails

Hi Kim
> I do not understand your response below and still cannot understand
what
> "context-name" does even after reading the "Configuration guide" again
?
Well I agree with your comments about the POJO mediator, and usually the

samples are the ones more easier to understand by new users by looking 
at working examples - but in this case we need a sample that illustrates

all the options.

What is meant by context-name is the name of a property set on the 
message context. For example if you used the property mediator before in

a sequence, then you can pass that value into the setter of a POJO. The 
setters only support simple types such as String, XML, boolean, int etc.

In addition to a property name, you could also pass in a XPath 
expression, in which case its evaluated result value is passed. If you 
could show a sample request message, and what you want passed into the 
POJO, we could tell you exactly what you could do.

e.g.

<property name="mcPropertyName" value="value1"/>
<pojoCommand name="SomeClass">
   <property name="stringConstant" value="value2"/> |
   <property name="username" context-name="mcPropertyName"
[action=(ReadContext | UpdateContext | ReadAndUpdateContext)]>
     (either literal or XML child)
   </property> |
   <property name="password" expression="//password"
[action=(ReadMessage | UpdateMessage | ReadAndUpdateMessage)]/>
 </pojoCommand> 


The above does this:
1) Create a new instance of SomeClass for each invocation. (Note - if 
this is an issue, you must use the Class mediator instead)
2) call "setStringConstant()" passing the literal string "value2"
3) call "setUsername()" passing in value1 read from the context property

variable named "mcPropertyName"
4) call "setPassword()" passing in the result of the XPath evaluation of

"//password" on the current message payload
5) call execute() method of the POJO
6) call getters - see below

Now, depending on the Read/Update/ReadAndUpdate, either only the setters

will get called on the POJO before the execute(),
or only getters from the POJO would be called after execute(), and the 
results set back as message context properties into
the message or to the payload at the XPath evaluated node, or both 
setters followed by execute() and then the getters would
be called as per above.
> You must understand that when people write software It is very clear
to
> them how it works. However outsiders have no idea. Encapsulation only
> works when the contract (API) is well explained. So My dilemma (and
many
> other people trying to use synapse) is that I am trying to understand
> Synapse, from the outside, but I do not have access to the knowledge
> required. At the moment this knowledge only resides in the Synapse
> Authors heads (and in the low level code).
Yes, I do understand you, 3 years back I was new to open source too, and

came from an enterprise software development background. With limited 
documentation around than the expensive commercial equivalents, users 
must be able to work a bit cooperatively with other users and developers

to solve any specific issue they encounter.

On previous ApacheCon/SOAWorld conferences I've covered some of the 
basics of Synapse, and Paul has done some sessions as well. Tutorial 
sessions are accepted only if a quorum confirms attendance at these 
events - and I would do a tutorial at the next ApacheCon in the US if 
people are interested. I have also been thinking about writing a book on

Synapse for quite sometime, but the time I have for this is limited 
especially now since I work as an independent consultant, and need to 
support my family, in addition to making voluntary contributions :-)
> Our development team uses many open source products here. I am not
being
> critical but Synapse stands out in that a number of developers here
have
> looked at Synapse and have given up; not being able to comprehend it.
>
> So it is hard for people to make contributions when they can't get
past
> square one. Maybe a solution is a Synapse beginners email list; so
> people new to Synapse can ask these "obvious" questions until they
> become expert enough to contribute.
>   
With some/most open source projects one would not need any specialized 
training most of the time - e.g. Tomcat (since its a standard servlet 
engine), httpd etc.. however there are some projects that does require 
some help, or where some help would save you loads of time. In my 
experience Maven2 has been one such project. Take a look at the list of 
sessions at the next ApacheCon sessions in Amsterdam in a few more days:

http://www.eu.apachecon.com/c/aceu2009/schedule/grid and you can see 
quite a list of Apache projects, where some detailed help would 
certainly save you time and money.

You could also consider custom training for your use of Synapse, since 
your overall cost would still be much less as you save a lot on license 
fees. "/During a training session with WSO2, the Concur team used the 
"WSO2 ESB to replicate a data synchronization system in three hours that

the group had previously taken three weeks to build in Java/" [0] - 
Training thus can really help you jump start your effort, and save your 
team a lot of time - which actually results in a cost saving. There may 
be others around locally in your area, but WSO2 as well as I, do provide

training and development support to help get started with Synapse.

I must also say that you must be able to deal with a bug or two, or an 
enhancement sometimes, to fully support your use case. One nice example 
is this [1] from about 2 years back with Synapse 1.0 on an old Sun 
Solaris 5.9.. the user reported the issue, and we went from Synapse to 
HttpComponents where the real issue was solved [2] with contributions 
from quite a few people everywhere around, and help with testing from 
the user which was crucial as no one else had a Solaris 5.9.. Now AFAIK 
the US Army is happily using Synapse [3]

cheers
asankha

[0] 
http://searchsoa.techtarget.com/news/article/0,289142,sid26_gci1334139,0
0.html
[1] http://markmail.org/message/4isn3ant5qol25q5
[2] http://markmail.org/message/naxxjbdhjnnxken4
[3] http://markmail.org/message/b67h6ggfh7vspt2u

-- 
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com




Reply via email to