You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Philippe Frangioni <ph...@linxo.com> on 2010/06/10 20:03:53 UTC

[Axis2] Spring/POJO Web Service questions

Hi all,

As part of my current project, I need to expose a Spring Bean as a Web
Service. (I'm new to Web Services.) We're using Axis2 1.5.1.
The project is built with maven2 and produces a war. We want the Web Service
to be part of the Webapp (we do not want to deploy the Axis2 webapp and use
an aar).

I've read the POJO Guide here:
http://ws.apache.org/axis2/1_5_1/pojoguide.html
and the Spring Guide here:
http://ws.apache.org/axis2/1_5_1/spring.html
This page:
http://wso2.org/library/90
also helped me on how to embed an Axis2 Web Service in our webapp.

Good news is that I got something working. But it's not fully working and
there are still a few things not clear to me:

First, I haven't written a WSDL file. Only a services.xml. But when I reach
the URL:
http://domain/services/myService?wsdl
...I do get a WSDL. So I guess it's generated by Axis2 based on the
services.xml and on the bean itself. My first question is: is it a good way
to go? Or should I write a WSDL?


My second question is about the parameters we can or cannot use in web
services:

The interface of the bean exposed as a web service looks like:

public interface MyService
{
    String getName(String name);
    MyObject createMyObject(Map<String, String> properties)
    MyObject updateMyObject(MyObject object, Map<String, String>
newProperties);
    MyObject removeMyObject(MyObject object);
}

and the MyObject class is:

public class MyObject
{
    public enum Status {
      Success,
      Error,
      Invalid
    }

  private Status status;
  private long id;
  private String field1;
  private String field2;

  // + getters and setters for each field
}

With my Web Service client (which uses an RPCServiceClient), I can call the
String getName(String name) method successfully, but not the other ones.
I have 2 problems with the other methods:
First, they are using Map<String, String> as parameters. I read a lot of
posts about that and it seems using java specific classes in web services is
not a good thing since web services are supposed to be platform/language
independent.
But I know for sure that my project will be 100% Java, so I'd like to use
Maps anyway. And since the posts I read were quite old, I was wondering if
there is now an easy way to do that? Maybe using JiBX ? Would it be
compatible with a POJO/Spring web service?

Second, I have a problem with the serialization of the MyObject class: I get
an error related to the status field. The error says something like "Status
type has no constructor...." Anyone know about that?

Last thing, I'll have to make this web service secure. Is Rampart the way I
should go? Can I integrate it with a POJO/Spring web service?

Any help would be much appreciated!
Thank you,
Phil.

Re: [Axis2] Spring/POJO Web Service questions

Posted by Jan Sinschek <su...@gmx.net>.
On 6/10/2010 8:17 PM, robert lazarski wrote:
> On Thu, Jun 10, 2010 at 3:03 PM, Philippe Frangioni<ph...@linxo.com>  wrote:
>    
>> Hi all,
>>
>> As part of my current project, I need to expose a Spring Bean as a Web
>> Service. (I'm new to Web Services.) We're using Axis2 1.5.1.
>> The project is built with maven2 and produces a war. We want the Web Service
>> to be part of the Webapp (we do not want to deploy the Axis2 webapp and use
>> an aar).
>>
>> I've read the POJO Guide here:
>> http://ws.apache.org/axis2/1_5_1/pojoguide.html
>> and the Spring Guide here:
>> http://ws.apache.org/axis2/1_5_1/spring.html
>> This page:
>> http://wso2.org/library/90
>> also helped me on how to embed an Axis2 Web Service in our webapp.
>>
>> Good news is that I got something working. But it's not fully working and
>> there are still a few things not clear to me:
>>
>> First, I haven't written a WSDL file. Only a services.xml. But when I reach
>> the URL:
>> http://domain/services/myService?wsdl
>> ...I do get a WSDL. So I guess it's generated by Axis2 based on the
>> services.xml and on the bean itself. My first question is: is it a good way
>> to go? Or should I write a WSDL?
>>
>>      
> IMHO you don't need your own wsdl.
>    
indeed, the Deployer is responsible for setting up a wsdl, so you do not 
have to

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: [Axis2] Spring/POJO Web Service questions

Posted by Philippe Frangioni <ph...@linxo.com>.
Thank you guys for your replies.
I'm now using arrays instead of the maps and the ordinal value of the enum
instead of the enum itself. Everything works fine.
Regarding security, https is what I want, indeed. I'm currently trying to
set up mutual SSL authentication...

Thank you again,
Phil

On Thu, Jun 10, 2010 at 8:17 PM, robert lazarski
<ro...@gmail.com>wrote:

> On Thu, Jun 10, 2010 at 3:03 PM, Philippe Frangioni <ph...@linxo.com>
> wrote:
> > Hi all,
> >
> > As part of my current project, I need to expose a Spring Bean as a Web
> > Service. (I'm new to Web Services.) We're using Axis2 1.5.1.
> > The project is built with maven2 and produces a war. We want the Web
> Service
> > to be part of the Webapp (we do not want to deploy the Axis2 webapp and
> use
> > an aar).
> >
> > I've read the POJO Guide here:
> > http://ws.apache.org/axis2/1_5_1/pojoguide.html
> > and the Spring Guide here:
> > http://ws.apache.org/axis2/1_5_1/spring.html
> > This page:
> > http://wso2.org/library/90
> > also helped me on how to embed an Axis2 Web Service in our webapp.
> >
> > Good news is that I got something working. But it's not fully working and
> > there are still a few things not clear to me:
> >
> > First, I haven't written a WSDL file. Only a services.xml. But when I
> reach
> > the URL:
> > http://domain/services/myService?wsdl
> > ...I do get a WSDL. So I guess it's generated by Axis2 based on the
> > services.xml and on the bean itself. My first question is: is it a good
> way
> > to go? Or should I write a WSDL?
> >
>
> IMHO you don't need your own wsdl.
>
> >
> > My second question is about the parameters we can or cannot use in web
> > services:
> >
> > The interface of the bean exposed as a web service looks like:
> >
> > public interface MyService
> > {
> >     String getName(String name);
> >     MyObject createMyObject(Map<String, String> properties)
> >     MyObject updateMyObject(MyObject object, Map<String, String>
> > newProperties);
> >     MyObject removeMyObject(MyObject object);
> > }
> >
> > and the MyObject class is:
> >
> > public class MyObject
> > {
> >     public enum Status {
> >       Success,
> >       Error,
> >       Invalid
> >     }
> >
> >   private Status status;
> >   private long id;
> >   private String field1;
> >   private String field2;
> >
> >   // + getters and setters for each field
> > }
> >
> > With my Web Service client (which uses an RPCServiceClient), I can call
> the
> > String getName(String name) method successfully, but not the other ones.
> > I have 2 problems with the other methods:
> > First, they are using Map<String, String> as parameters. I read a lot of
> > posts about that and it seems using java specific classes in web services
> is
> > not a good thing since web services are supposed to be platform/language
> > independent.
> > But I know for sure that my project will be 100% Java, so I'd like to use
> > Maps anyway. And since the posts I read were quite old, I was wondering
> if
> > there is now an easy way to do that? Maybe using JiBX ? Would it be
> > compatible with a POJO/Spring web service?
> >
>
> IIRC, The axis2 java collections pojo support is spotty. I don't
> remember if Map is supported or not. My recommendation is to send
> arrays, and use the java api for things like Arrays.asList() to
> convert to your app level needs,
>
> > Second, I have a problem with the serialization of the MyObject class: I
> get
> > an error related to the status field. The error says something like
> "Status
> > type has no constructor...." Anyone know about that?
> >
>
> Not sure on this one. Try adding a no-arg constructor.
>
> > Last thing, I'll have to make this web service secure. Is Rampart the way
> I
> > should go? Can I integrate it with a POJO/Spring web service?
> >
>
> In many cases just using https is sufficient.
>
> > Any help would be much appreciated!
> > Thank you,
> > Phil.
> >
>
> - R
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

Re: Problem with maven dependency

Posted by Jan Sinschek <su...@gmx.net>.
On 6/11/2010 9:35 PM, Andreas Veithen wrote:
> On Thu, Jun 10, 2010 at 20:51, Jan Sinschek<su...@gmx.net>  wrote:
>    
>> Hi,
>>
>> when I try to build axis2 from the current trunk, (mvn install) I eventually
>> get
>>      
>>> java.lang.NoClassDefFoundError: org/codehaus/plexus/util/DirectoryScanner
>>>        
>> So, after looking into the matter unsuccesfully, I scraped part of my m2
>> repository and found myself in the same situation. Also, corrupted
>> ressources are still being downloaded from java.net, which has already been
>> "fixed" by someone making a statement in jira issue about how to distract
>> maven from using that site; however my problem with plexus comes up
>> regardless.
>>      
> For the Axis2 trunk, no particular set up is required for java.net.
> This is only required when building previous release tags.
>
>    
I am using the trunk, in a version I found on Thursday, namely svn r953088
though, i cannot remember where i got it; the site  
(http://ws.apache.org/axis2/svn.html) has a wrong location where nothing 
is to be found anymore; I believe that I got it from
https://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/

>> I am not sure what's the best thing to do about this: where should I get
>> plexus? And which module is really missing?
>> The following shows the last of my downloads before the failure; I do no
>> really see how all the outputs relate; I would normally try to find another
>> alternative repository for plexus- some downloads already, use the fourth
>> fallback to get the jars they _do_ obtain- but as I cannot find the current
>> repository's location, "ws.zones.apache.org", I cannoti mage what to change
>> in the pom to get the alternative download location
>>      
> Clear your local maven repository, check that your settings.xml file
> doesn't contain any esoteric settings, check that you don't have an
> HTTP proxy that blocks stuff, and then restart the build. If that
> doesn't help, please report the Maven version you are using.
>    
I  am not using a settings.xml
maven is
Apache Maven 2.2.1 (rdebian-1)
Java version: 1.6.0_18
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.32-22-generic" arch: "i386" Family: "unix"

furthermore, I am still positive about the java.net issue. from the list 
in /modules/parent/pom.xml , some modules can no longer be found.
the last attempt is made to http://download.java.net/maven/1 , which 
contains a couple of jars, but only 404s for others; these maven 
downloads and notices a checksum error, but keeps the artifacts in the 
repo anyway to produce misleading unzipping errors ( :-( ). I put the 
central repo in place of these, and got most jars but had to manually 
install some snapshots of FastInfoset, woden and neethi (in the latter 
case, I do not know why a 3.0.0-SNAPSHOT is sought after; I chose to 
just register the latest 2.x.y release under that name for want of a 
better idea). This left me at where I am now, with javac complaining 
that it cannot find org.apache.xerces.parsers.DOMParser ,which is in 
XercesImpl  I tried to just put that into the repo as well with the 
group id I found on jarvana, put maven would not find it. I notice that 
more invalid stuff is to be found further up in the build process 
(kernel module)
[WARNING] POM for 'org.apache.maven:maven-profile:pom:2.0.1:runtime' is 
invalid.

Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'org.apache.maven:maven-model:pom:2.0.1:runtime' is 
invalid.

Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 
'org.apache.maven:maven-artifact-manager:pom:2.0.1:runtime' is invalid.

Its dependencies (if any) will NOT be available to the current build.
[WARNING] POM for 'org.apache.maven:maven-artifact:pom:2.0.1:runtime' is 
invalid.

Its dependencies (if any) will NOT be available to the current build.
but I have no idea what they relate to. I am feeling quite swamped by 
errors here, so if it is just some repositories that one of the 
developers has noticed to be missing, it would be nice if you could 
update these.
the ant build does not make me much happier either; after successfully 
installing the mar and aar plug-ins, it ultimately fails missing the 
same class.
In any case, the tests fail quite sometimes; should the suite pass in 
its entirety?
so, any help appreciated

PS: if anyone wants to update the source location, he can just change 
the entries on where the mailing lists are to be found while he/she's at 
it :-)
>    
>>> Downloading:
>>> http://dist.wso2.org/maven2/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom
>>> 1K downloaded  (plexus-containers-1.0-alpha-16.pom)
>>> Downloading:
>>> http://ws.zones.apache.org/repository2/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
>>> [INFO] Unable to find resource
>>> 'org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-9' in repository ws-zones
>>> (http://ws.zones.apache.org/repository2)
>>> Downloading:
>>> http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
>>>
>>> Downloading:
>>> http://ws.zones.apache.org/repository2/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>>>
>>> Downloading:
>>> http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>>>
>>> [INFO] [jar:jar {execution: default-jar}]
>>> [FATAL ERROR] org.apache.maven.plugin.jar.JarMojo#execute() caused a
>>> linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check
>>> the realms:
>>> [FATAL ERROR] Plugin realm =
>>> app0.child-container[org.apache.maven.plugins:maven-jar-plugin:2.2]
>>> urls[0] =
>>> file:/home/jan/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.2/maven-jar-plugin-2.2.jar
>>> urls[1] =
>>> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.jar
>>> urls[2] =
>>> file:/home/jan/.m2/repository/org/apache/maven/maven-archiver/2.3/maven-archiver-2.3.jar
>>> urls[3] =
>>> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
>>> urls[4] =
>>> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>>> urls[5] =
>>> file:/home/jan/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
>>> [FATAL ERROR] Container realm = plexus.core
>>> urls[0] = file:/usr/share/maven2/lib/maven-debian-uber.jar
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [ERROR] FATAL ERROR
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] org/codehaus/plexus/util/DirectoryScanner
>>> org.codehaus.plexus.util.DirectoryScanner
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Trace
>>> java.lang.NoClassDefFoundError: org/codehaus/plexus/util/DirectoryScanner
>>>     at
>>> org.codehaus.plexus.archiver.AbstractArchiver.addFileSet(AbstractArchiver.java:160)
>>>
>>>
>>>
>>>        
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>>      
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>    


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Problem with maven dependency

Posted by Andreas Veithen <an...@gmail.com>.
On Thu, Jun 10, 2010 at 20:51, Jan Sinschek <su...@gmx.net> wrote:
> Hi,
>
> when I try to build axis2 from the current trunk, (mvn install) I eventually
> get
>>java.lang.NoClassDefFoundError: org/codehaus/plexus/util/DirectoryScanner
>
> So, after looking into the matter unsuccesfully, I scraped part of my m2
> repository and found myself in the same situation. Also, corrupted
> ressources are still being downloaded from java.net, which has already been
> "fixed" by someone making a statement in jira issue about how to distract
> maven from using that site; however my problem with plexus comes up
> regardless.

For the Axis2 trunk, no particular set up is required for java.net.
This is only required when building previous release tags.

> I am not sure what's the best thing to do about this: where should I get
> plexus? And which module is really missing?
> The following shows the last of my downloads before the failure; I do no
> really see how all the outputs relate; I would normally try to find another
> alternative repository for plexus- some downloads already, use the fourth
> fallback to get the jars they _do_ obtain- but as I cannot find the current
> repository's location, "ws.zones.apache.org", I cannoti mage what to change
> in the pom to get the alternative download location

Clear your local maven repository, check that your settings.xml file
doesn't contain any esoteric settings, check that you don't have an
HTTP proxy that blocks stuff, and then restart the build. If that
doesn't help, please report the Maven version you are using.

>> Downloading:
>> http://dist.wso2.org/maven2/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom
>> 1K downloaded  (plexus-containers-1.0-alpha-16.pom)
>> Downloading:
>> http://ws.zones.apache.org/repository2/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
>> [INFO] Unable to find resource
>> 'org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-9' in repository ws-zones
>> (http://ws.zones.apache.org/repository2)
>> Downloading:
>> http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
>>
>> Downloading:
>> http://ws.zones.apache.org/repository2/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>>
>> Downloading:
>> http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>>
>> [INFO] [jar:jar {execution: default-jar}]
>> [FATAL ERROR] org.apache.maven.plugin.jar.JarMojo#execute() caused a
>> linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. Check
>> the realms:
>> [FATAL ERROR] Plugin realm =
>> app0.child-container[org.apache.maven.plugins:maven-jar-plugin:2.2]
>> urls[0] =
>> file:/home/jan/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.2/maven-jar-plugin-2.2.jar
>> urls[1] =
>> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.jar
>> urls[2] =
>> file:/home/jan/.m2/repository/org/apache/maven/maven-archiver/2.3/maven-archiver-2.3.jar
>> urls[3] =
>> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
>> urls[4] =
>> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>> urls[5] =
>> file:/home/jan/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
>> [FATAL ERROR] Container realm = plexus.core
>> urls[0] = file:/usr/share/maven2/lib/maven-debian-uber.jar
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] FATAL ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] org/codehaus/plexus/util/DirectoryScanner
>> org.codehaus.plexus.util.DirectoryScanner
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> java.lang.NoClassDefFoundError: org/codehaus/plexus/util/DirectoryScanner
>>    at
>> org.codehaus.plexus.archiver.AbstractArchiver.addFileSet(AbstractArchiver.java:160)
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Problem with maven dependency

Posted by Jan Sinschek <su...@gmx.net>.
Hi,

when I try to build axis2 from the current trunk, (mvn install) I 
eventually get
 >java.lang.NoClassDefFoundError: org/codehaus/plexus/util/DirectoryScanner

So, after looking into the matter unsuccesfully, I scraped part of my m2 
repository and found myself in the same situation. Also, corrupted 
ressources are still being downloaded from java.net, which has already 
been "fixed" by someone making a statement in jira issue about how to 
distract maven from using that site; however my problem with plexus 
comes up regardless.
I am not sure what's the best thing to do about this: where should I get 
plexus? And which module is really missing?
The following shows the last of my downloads before the failure; I do no 
really see how all the outputs relate; I would normally try to find 
another alternative repository for plexus- some downloads already, use 
the fourth fallback to get the jars they _do_ obtain- but as I cannot 
find the current repository's location, "ws.zones.apache.org", I cannoti 
mage what to change in the pom to get the alternative download location

> Downloading: 
> http://dist.wso2.org/maven2/org/codehaus/plexus/plexus-containers/1.0-alpha-16/plexus-containers-1.0-alpha-16.pom
> 1K downloaded  (plexus-containers-1.0-alpha-16.pom)
> Downloading: 
> http://ws.zones.apache.org/repository2/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
> [INFO] Unable to find resource 
> 'org.codehaus.plexus:plexus-archiver:jar:1.0-alpha-9' in repository 
> ws-zones (http://ws.zones.apache.org/repository2)
> Downloading: 
> http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
>
> Downloading: 
> http://ws.zones.apache.org/repository2/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>
> Downloading: 
> http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
>
> [INFO] [jar:jar {execution: default-jar}]
> [FATAL ERROR] org.apache.maven.plugin.jar.JarMojo#execute() caused a 
> linkage error (java.lang.NoClassDefFoundError) and may be out-of-date. 
> Check the realms:
> [FATAL ERROR] Plugin realm = 
> app0.child-container[org.apache.maven.plugins:maven-jar-plugin:2.2]
> urls[0] = 
> file:/home/jan/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.2/maven-jar-plugin-2.2.jar
> urls[1] = 
> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-utils/1.4.9/plexus-utils-1.4.9.jar
> urls[2] = 
> file:/home/jan/.m2/repository/org/apache/maven/maven-archiver/2.3/maven-archiver-2.3.jar
> urls[3] = 
> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-9/plexus-archiver-1.0-alpha-9.jar
> urls[4] = 
> file:/home/jan/.m2/repository/org/codehaus/plexus/plexus-io/1.0-alpha-1/plexus-io-1.0-alpha-1.jar
> urls[5] = 
> file:/home/jan/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
> [FATAL ERROR] Container realm = plexus.core
> urls[0] = file:/usr/share/maven2/lib/maven-debian-uber.jar
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] org/codehaus/plexus/util/DirectoryScanner
> org.codehaus.plexus.util.DirectoryScanner
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.NoClassDefFoundError: org/codehaus/plexus/util/DirectoryScanner
>     at 
> org.codehaus.plexus.archiver.AbstractArchiver.addFileSet(AbstractArchiver.java:160)
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: [Axis2] Spring/POJO Web Service questions

Posted by robert lazarski <ro...@gmail.com>.
On Thu, Jun 10, 2010 at 3:03 PM, Philippe Frangioni <ph...@linxo.com> wrote:
> Hi all,
>
> As part of my current project, I need to expose a Spring Bean as a Web
> Service. (I'm new to Web Services.) We're using Axis2 1.5.1.
> The project is built with maven2 and produces a war. We want the Web Service
> to be part of the Webapp (we do not want to deploy the Axis2 webapp and use
> an aar).
>
> I've read the POJO Guide here:
> http://ws.apache.org/axis2/1_5_1/pojoguide.html
> and the Spring Guide here:
> http://ws.apache.org/axis2/1_5_1/spring.html
> This page:
> http://wso2.org/library/90
> also helped me on how to embed an Axis2 Web Service in our webapp.
>
> Good news is that I got something working. But it's not fully working and
> there are still a few things not clear to me:
>
> First, I haven't written a WSDL file. Only a services.xml. But when I reach
> the URL:
> http://domain/services/myService?wsdl
> ...I do get a WSDL. So I guess it's generated by Axis2 based on the
> services.xml and on the bean itself. My first question is: is it a good way
> to go? Or should I write a WSDL?
>

IMHO you don't need your own wsdl.

>
> My second question is about the parameters we can or cannot use in web
> services:
>
> The interface of the bean exposed as a web service looks like:
>
> public interface MyService
> {
>     String getName(String name);
>     MyObject createMyObject(Map<String, String> properties)
>     MyObject updateMyObject(MyObject object, Map<String, String>
> newProperties);
>     MyObject removeMyObject(MyObject object);
> }
>
> and the MyObject class is:
>
> public class MyObject
> {
>     public enum Status {
>       Success,
>       Error,
>       Invalid
>     }
>
>   private Status status;
>   private long id;
>   private String field1;
>   private String field2;
>
>   // + getters and setters for each field
> }
>
> With my Web Service client (which uses an RPCServiceClient), I can call the
> String getName(String name) method successfully, but not the other ones.
> I have 2 problems with the other methods:
> First, they are using Map<String, String> as parameters. I read a lot of
> posts about that and it seems using java specific classes in web services is
> not a good thing since web services are supposed to be platform/language
> independent.
> But I know for sure that my project will be 100% Java, so I'd like to use
> Maps anyway. And since the posts I read were quite old, I was wondering if
> there is now an easy way to do that? Maybe using JiBX ? Would it be
> compatible with a POJO/Spring web service?
>

IIRC, The axis2 java collections pojo support is spotty. I don't
remember if Map is supported or not. My recommendation is to send
arrays, and use the java api for things like Arrays.asList() to
convert to your app level needs,

> Second, I have a problem with the serialization of the MyObject class: I get
> an error related to the status field. The error says something like "Status
> type has no constructor...." Anyone know about that?
>

Not sure on this one. Try adding a no-arg constructor.

> Last thing, I'll have to make this web service secure. Is Rampart the way I
> should go? Can I integrate it with a POJO/Spring web service?
>

In many cases just using https is sufficient.

> Any help would be much appreciated!
> Thank you,
> Phil.
>

- R

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org