Search |
||
Using Metro to talk to Amazon EC2Posted by kohsuke on October 31, 2008 at 2:32 PM PDT
Amazon EC2 has a SOAP web service, and I wanted to talk to EC2 from Hudson, so I decided to use Metro for this. The end result is the JAX-WS commons EC2 module, which is a library you can put in your classpath with Metro 1.4 when you need to talk to EC2. EC2 SOAP API is pretty straight-forward except one caveat — you need to sign the whole request, but their WSDL doesn't say so in a machine readable way (that is, by using WS-Policy.) Had they put a proper policy declaration, tools like Metro would be able to hide the whole thing behind the scene, but because they didn't, I had to manually configure Metro a bit to get this working. Basically, this amounts to manually putting the corresponding policy element in WSDL (which is not a very pleasant experience, I have to say, unless you use NetBeans to have it generated for you.) I also added JAXB fluent API plugin when compiling WSDL, so that the calling application has an easier type building a tree of JAXB objects when sending a request. I think this is very useful with almost any JAX-WS compilation, so here's the POM snippet you can copy into your POM to do this in any other JAX-WS compilation:
In any case, all these work is done by me and the generated interfaces and JAXB beans are packaged up in a jar file, so you just need to depend on this from your Maven POM or download the jar and put it in your classpath to use this. »
Related Topics >>
Java Web Services and XML Comments
Comments are listed in date ascending order (oldest first)
Submitted by aronolsen on Fri, 2008-10-31 21:40.
Dear Sir (Kohsuke),
I'm not in the all above. I'm pretty much down to earth, and doing Java all the time. In respect of JAXB I am a "from-java" guy.
As such, I want to give some feeed-back (I'm on JAXB 2.1.8 currently), please:
1) Why is it, that I can't control the ordering of XML-attributes?
2) Why is it, that I can't control the default value of XML-attributes?
3) Why is it, that I can't control the "REQUIRED" property of an attribute?
4) Why is it, that JAXB produces <... att=""/> when there is no value for the attribute (i.e. empty string)?
5) Why don't you have any support for "dynamic" binding. At least, you could provide for "out-of-package" package-annotations?
Nevertheless, its Great, and I'm strait back into "POJO".
Best,
Aron.
Best,
Aron
,
Submitted by aronolsen on Fri, 2008-10-31 22:03.
As of 5):
It relates to the "interface" problem.. Say:
1) I have a general datamodel, un/marshable, but not in it self.
2) I want to "attach" custom-implementations to my model.
3) It's impossible. I realized.
Now adays I have th options:
A) Clone my model for each project
B) Make provisions for, that every project exists whithin my code-base.
Can You see my problem?
Respect,
Aron,
Submitted by krystian_nowak on Wed, 2008-12-10 11:30.
Does "talking to EC2 from Hudson" means you are planning to release a plugin to fire builds on EC2 instances or maybe launch an instance before starting a build and shut it down when finished?
Kind regards,
Krystian Nowak
Submitted by kohsuke on Wed, 2008-12-10 12:21.
Aron — your question goes beyond what I can handle in this comment section. Please direct your question to users@jaxb.dev.java.net.
krystian_nowak — Yes.
|
||
|
|