Re: Axis2 1.3: Generated stubs have *Marker methods?

2007-10-01 Thread John G. Norman
Amila,

I have classes that extend the stubs.

Those classes use the Commons equals builder, hash builder, etc.

Commons equals builder, etc., uses reflection to build methods, and they can
see protected getters.

Therefore, the addition of these protected methods breaks code -- not to
mention the fact that it is polluting the method namespace.

John

On 9/28/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
>
> yes this tracker variable used to validate the input message when
> serailizing.
> if you want to generate the seperate classes use -u option.
>
> still I am not clear about your problem.
>
> Amila.
>
> On 9/26/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> >
> > Here is what goes on:
> >
> > The generated stub introduces new protected attributes. Before there was
> > only local
> >
> > Now there is not only local but
> > localTracker
> >
> > The Tracker attribute is used to detect when the setter is called, so
> > that the field can serialized conditionally.
> >
> > The gotcha for me is that if you extend from it and then use Commons
> > EqualsBuilder, the EqualsBuilder will see these new members and will return
> > surprisingly results unless the Tracker methods are excluded.
> >
> > It's a drag to change the state of an object without telling people . .
> > .
> >
> > A snippet from a generated Stub:
> >
> > /**
> > * field for Discontinued
> > */
> >
> >
> > protected boolean localDiscontinued ;
> >
> >/*  This tracker boolean wil be used to
> > detect whether the user called the set method
> >   *   for this attribute. It will be used to
> > determine whether to include this field
> >*   in the serialized XML
> >*/
> >protected boolean localDiscontinuedTracker =
> > false ;
> >
> >
> >/**
> >* Auto generated getter method
> >* @return boolean
> >*/
> >public  boolean getDiscontinued(){
> >return localDiscontinued;
> >}
> >
> >
> >
> > /**
> >* Auto generated setter method
> >* @param param Discontinued
> >*/
> >public void setDiscontinued(boolean
> > param){
> >
> >// setting primitive attribute
> > tracker to true
> >
> >if (false) {
> >localDiscontinuedTracker =
> > false;
> >
> >} else {
> >   localDiscontinuedTracker =
> > true;
> >}
> >
> > this.localDiscontinued=param
> > ;
> >
> >
> >}
> >
> >
> > On 9/25/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
> > >
> > > these methods are generated per operation. please check whether there
> > > is an operation with this name.
> > >
> > > Amila.
> > >
> > > On 9/25/07, John G. Norman < [EMAIL PROTECTED]> wrote:
> > > >
> > > > I notice that my generated stubs now have some new methods. If I
> > > > have a method getPhoneNumber I now have an extra getPhoneNumberMarker. I
> > > > think. I looked at for about 10 seconds.
> > > >
> > > > What's that about?
> > > >
> > > > (Broke a bunch of my unit tests . . .)
> > > >
> > > > John
> > > >
> > > >
> > >
> > >
> > > --
> > > Amila Suriarachchi,
> > > WSO2 Inc.
> >
> >
> >
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.


Port name changes between 1.2 and 1.3?

2007-10-01 Thread John G. Norman
I notice that some ports that were of the form MyServiceSOAP11port_http now
say MyServiceSOAP11port_http1

(Added a one at the end.)

These are for "pojo" services.

Why is this?

John


Re: [axis2-1.3] wsdl2java takes forever - unbearably long

2007-09-28 Thread John G. Norman
THANKS!

NOTE: I don't see that in the summary of changes for 1.3, and I truly
question the default being true!

Please, developers need more detail in the summary of changes from release
to release. If when I create stubs I see a 60x slowdown, (10 seconds to 600
seconds), that's a rather significant change, wouldn't everyone agree?

On 9/28/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
>
> to stop pretty print you can use axis2.jalopy system variable. (set it to
> false i.e -Daxis2.jalopy=false)
>
> Now it is change to pritty print only if it is given as -
> Daxis2.jalopy=true.
>
> Amila.
>
> On 9/26/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> >
> > I also am seeing extraordinary time generating stubs: From 15 minutes to
> > 10+.
> >
> > My machine has 3 GB RAM, and the memory allocation to javac is ample.
> >
> > This use of jalopy without telling users is pretty horrible. It looks to
> > me like it might have pretty-printed my whole project, so now everything's
> > out of sync with my subversion repository.
> >
> > WHY would anyone do that!?
> >
> > On 9/24/07, Jake Goulding <[EMAIL PROTECTED]> wrote:
> > >
> > > Martin:
> > >
> > > I'm not quite sure what Tomcat has to do with generating the Java
> > > stubs
> > > from the WSDL. However, I did assign more memory to the java process
> > > with -Xmx1500m (in the script wrapper that wsdl2java.sh calls). This
> > > did
> > > not improve performance at all.
> > >
> > > At this point, I'm quite sure it was the automatic code formatting
> > > done
> > > by jalopy, as Dims suggested. Removing the jalopy jar from the axis2
> > > libs folder caused my previous build of 6 files to take minutes,
> > > compared to a few hours with it.
> > >
> > > -Jake
> > >
> > > Martin Gainty wrote:
> > > > Hi Jake-
> > > >
> > > > I used to have the same performance issues until I bumped Physical
> > > RAM from
> > > > 2MB to 4MB
> > > >
> > > > and I also set these JAVA_OPTS to use 256MB (min) and 512MB (max)
> > > for TOMCAT
> > > > -Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:+PrintGCDetails
> > > -XX:+UseConcMarkS
> > > > weepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled
> > > >
> > > > start tomcat with JAV_OPTS
> > > > $CATALINA_HOME/bin/java %JAVA_OPTS% -jar bootstrap.jar
> > > >
> > > > HTH/
> > > > Martin--
> > > > - Original Message -
> > > > From: "Jake Goulding" < [EMAIL PROTECTED]>
> > > > To: < axis-user@ws.apache.org>
> > > > Sent: Monday, September 24, 2007 2:50 PM
> > > > Subject: Re: [axis2-1.3] wsdl2java takes forever - unbearably long
> > > >
> > > >
> > > >> Martin:
> > > >>
> > > >> I have 2GB on my desktop. I also ran the process on another Linux
> > > >> machine that has 4GB and a Windows machine with 6GB. All 3 machines
> > > were
> > > >> slow.
> > > >>
> > > >> -Jake
> > > >>
> > > >> Martin Gainty wrote:
> > > >>> Jake--
> > > >>>
> > > >>> Have much RAM do you have?
> > > >>>
> > > >>> M--
> > > >>> - Original Message -
> > > >>> From: "Davanum Srinivas" < [EMAIL PROTECTED] >
> > > >>> To: 
> > > >>> Sent: Friday, September 21, 2007 8:50 PM
> > > >>> Subject: Re: [axis2-1.3] wsdl2java takes forever - unbearably long
> > >
> > > >>>
> > > >>>
> > > >>>> please delete the jalopy.jar and try again.
> > > >>>>
> > > >>>> thanks,
> > > >>>> dims
> > > >>>>
> > > >>>> On 9/21/07, Jake Goulding < [EMAIL PROTECTED]> wrote:
> > > >>>>> I am upgrading from Axis2 1.1.1 to 1.3, and rebuilding my Java
> > > stubs
> > > > is
> > > >>>>> taking forever.
> > > >>>>>
> > > >>>>> This is the command I am running:
> > > >>>>>
> > > >>>>>  ../bin/wsdl2java.sh -s -p com.vivisimo.connector.sharepoint2007-uri
> > > >>>&g

Re: [axis2-1.3] wsdl2java takes forever - unbearably long

2007-09-26 Thread John G. Norman
I also am seeing extraordinary time generating stubs: From 15 minutes to
10+.

My machine has 3 GB RAM, and the memory allocation to javac is ample.

This use of jalopy without telling users is pretty horrible. It looks to me
like it might have pretty-printed my whole project, so now everything's out
of sync with my subversion repository.

WHY would anyone do that!?

On 9/24/07, Jake Goulding <[EMAIL PROTECTED]> wrote:
>
> Martin:
>
> I'm not quite sure what Tomcat has to do with generating the Java stubs
> from the WSDL. However, I did assign more memory to the java process
> with -Xmx1500m (in the script wrapper that wsdl2java.sh calls). This did
> not improve performance at all.
>
> At this point, I'm quite sure it was the automatic code formatting done
> by jalopy, as Dims suggested. Removing the jalopy jar from the axis2
> libs folder caused my previous build of 6 files to take minutes,
> compared to a few hours with it.
>
> -Jake
>
> Martin Gainty wrote:
> > Hi Jake-
> >
> > I used to have the same performance issues until I bumped Physical RAM
> from
> > 2MB to 4MB
> >
> > and I also set these JAVA_OPTS to use 256MB (min) and 512MB (max) for
> TOMCAT
> > -Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:+PrintGCDetails
> -XX:+UseConcMarkS
> > weepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled
> >
> > start tomcat with JAV_OPTS
> > $CATALINA_HOME/bin/java %JAVA_OPTS% -jar bootstrap.jar
> >
> > HTH/
> > Martin--
> > - Original Message -
> > From: "Jake Goulding" <[EMAIL PROTECTED]>
> > To: < axis-user@ws.apache.org>
> > Sent: Monday, September 24, 2007 2:50 PM
> > Subject: Re: [axis2-1.3] wsdl2java takes forever - unbearably long
> >
> >
> >> Martin:
> >>
> >> I have 2GB on my desktop. I also ran the process on another Linux
> >> machine that has 4GB and a Windows machine with 6GB. All 3 machines
> were
> >> slow.
> >>
> >> -Jake
> >>
> >> Martin Gainty wrote:
> >>> Jake--
> >>>
> >>> Have much RAM do you have?
> >>>
> >>> M--
> >>> - Original Message -
> >>> From: "Davanum Srinivas" <[EMAIL PROTECTED] >
> >>> To: 
> >>> Sent: Friday, September 21, 2007 8:50 PM
> >>> Subject: Re: [axis2-1.3] wsdl2java takes forever - unbearably long
> >>>
> >>>
>  please delete the jalopy.jar and try again.
> 
>  thanks,
>  dims
> 
>  On 9/21/07, Jake Goulding < [EMAIL PROTECTED]> wrote:
> > I am upgrading from Axis2 1.1.1 to 1.3, and rebuilding my Java stubs
> > is
> > taking forever.
> >
> > This is the command I am running:
> >
> >  ../bin/wsdl2java.sh -s -p com.vivisimo.connector.sharepoint2007-uri
> > sharepoint2007/SiteData.wsdl
> >
> > the WSDL file is attached. Can someone please explain what is taking
> > so
> > long for these files?
> >
> > With 1.1.1, there was nowhere near this amount of time taken, maybe
> > 5-15
> > seconds. With 1.3, my processor has been spinning for over 15
> minutes
> > at
> > 100% CPU, and 450+ MB of resident memory.
> >
> > Things do not appear to be deadlocked, as if I let it sit, java
> files
> > eventually get produced.
> >
> > -Jake
> >
> >
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>  --
>  Davanum Srinivas :: http://davanum.wordpress.com
> 
>  -
>
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> >>>
> >>> -
> >>> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>> For additional commands, e-mail: [EMAIL PROTECTED]
> >>>
> >>>
> >> -
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Axis2 1.3: Generated stubs have *Marker methods?

2007-09-26 Thread John G. Norman
Here is what goes on:

The generated stub introduces new protected attributes. Before there was
only local

Now there is not only local but localTracker

The Tracker attribute is used to detect when the setter is called, so that
the field can serialized conditionally.

The gotcha for me is that if you extend from it and then use Commons
EqualsBuilder, the EqualsBuilder will see these new members and will return
surprisingly results unless the Tracker methods are excluded.

It's a drag to change the state of an object without telling people . . .

A snippet from a generated Stub:

/**
* field for Discontinued
*/


protected boolean localDiscontinued ;

   /*  This tracker boolean wil be used to detect
whether the user called the set method
  *   for this attribute. It will be used to
determine whether to include this field
   *   in the serialized XML
   */
   protected boolean localDiscontinuedTracker =
false ;


   /**
   * Auto generated getter method
   * @return boolean
   */
   public  boolean getDiscontinued(){
   return localDiscontinued;
   }



/**
   * Auto generated setter method
   * @param param Discontinued
   */
   public void setDiscontinued(boolean param){

   // setting primitive attribute
tracker to true

   if (false) {
   localDiscontinuedTracker = false;

   } else {
  localDiscontinuedTracker = true;
   }

this.localDiscontinued=param;


   }


On 9/25/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:
>
> these methods are generated per operation. please check whether there is
> an operation with this name.
>
> Amila.
>
> On 9/25/07, John G. Norman < [EMAIL PROTECTED]> wrote:
> >
> > I notice that my generated stubs now have some new methods. If I have a
> > method getPhoneNumber I now have an extra getPhoneNumberMarker. I think. I
> > looked at for about 10 seconds.
> >
> > What's that about?
> >
> > (Broke a bunch of my unit tests . . .)
> >
> > John
> >
> >
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.


Axis2 1.3: Generated stubs have *Marker methods?

2007-09-24 Thread John G. Norman
I notice that my generated stubs now have some new methods. If I have a
method getPhoneNumber I now have an extra getPhoneNumberMarker. I think. I
looked at for about 10 seconds.

What's that about?

(Broke a bunch of my unit tests . . .)

John


Re: Does Axis2 1.2 REST work with POJO service?

2007-07-06 Thread John G. Norman
buteFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://service.addressbook.sample/xsd";>






















http://entry.addressbook.sample/xsd";
attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://entry.addressbook.sample/xsd";>











http://www.w3.org/2006/05/addressing/wsdl";
message="axis2:addEntryMessage" wsaw:Action="urn:addEntry"
/>http://www.w3.org/2006/05/addressing/wsdl";
message="axis2:findEntryMessage" wsaw:Action="urn:findEntry"
/>http://schemas.xmlsoap.org/soap/http"; style="document"
/>http://schemas.xmlsoap.org/soap/http"; style="document"
/>http://192.168.48.1:8080/axis2/services/AddressBookService";
/>http://192.168.48.1:8080/axis2/services/AddressBookService";
/>http://192.168.48.1:8080/axis2/services/AddressBookService";
/>

On 6/15/07, John G. Norman <[EMAIL PROTECTED]> wrote:

Keith,

That's what's apparently broken.

John

On 6/11/07, keith chapman <[EMAIL PROTECTED]> wrote:
> You can do a plain HTTP GET. The request parameters should have the same
> names at the localNames in the schema. for eg if you use the following
> request
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> then there should be a element called john in the request according to its
> schema.
>
> Thanks,
> Keith.
>
>
>  On 6/11/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> > Keith,
> >
> > Thanks.
> >
> > How do I do that with just a plain HTTP GET? Parameters on the URL?
> >
> > John
> >
> > On 6/11/07, keith chapman <[EMAIL PROTECTED]> wrote:
> > > Hi John,
> > >
> > > Yes REST works for pojo services.
> > > It looks like the request should ne namespace qualified. Just try
> qualifying
> > > the request usung the namespace
> > > http://service.addressbook.sample/xsd .
> > >
> > > Thanks Keith.
> > >
> > >
> > > On 6/8/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> > > > POJO service?
> > > >
> > > > The short version of my question is that I'm making a GET request like
> > > this:
> > > >
> > > >
> > >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > > >
> > > > But am getting an exception regarding a namespace mismatch
> > > >
> > > > Here's what I did to samples/pojo:
> > > >
> > > > 1. Have the default constructor to the sample/pojo AddressBookService
> > > > add a couple of Entry. E.g.,
> > > >
> > > >   public AddressBookService() {
> > > > super();
> > > > Entry e1 = new Entry();
> > > > e1.setName("John");
> > > > e1.setStreet("1 Broadway");
> > > > e1.setCity("Cambridge");
> > > > e1.setState("MA");
> > > > e1.setPostalCode("02142");
> > > > Entry e2 = new Entry();
> > > > e2.setName("George");
> > > > e2.setStreet("1600 Penn");
> > > > e2.setCity("Washington");
> > > > e2.setState("DC");
> > > > e2.setPostalCode("0");
> > > > entries.put(e1.getName(), e1);
> > > > entries.put (e2.getName(), e2);
> > > >   }
> > > >
> > > > 2. Build and deploy.
> > > >
> > > > 3. Try and access the service as follows:
> > > >
> > > >
> > >
> http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > > >
> > > > 4. Get exception like this:
> > > >
> > > > Jun 8, 2007 1:56:30 PM
> > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver
> > > invokeBusinessLogic
> > > > SEVERE: Exception occurred while trying to invoke service method
> findEntry
> > > > org.apache.axis2.AxisFault: namespace mismatch require
> > > > http://service.addressbook.sample/xsd found none
> > > > at
> > >
> 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
> > > > at
> > >
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.

Re: Does Axis2 1.2 REST work with POJO service?

2007-06-15 Thread John G. Norman

Keith,

That's what's apparently broken.

John

On 6/11/07, keith chapman <[EMAIL PROTECTED]> wrote:

You can do a plain HTTP GET. The request parameters should have the same
names at the localNames in the schema. for eg if you use the following
request
http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
then there should be a element called john in the request according to its
schema.

Thanks,
Keith.


 On 6/11/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> Keith,
>
> Thanks.
>
> How do I do that with just a plain HTTP GET? Parameters on the URL?
>
> John
>
> On 6/11/07, keith chapman <[EMAIL PROTECTED]> wrote:
> > Hi John,
> >
> > Yes REST works for pojo services.
> > It looks like the request should ne namespace qualified. Just try
qualifying
> > the request usung the namespace
> > http://service.addressbook.sample/xsd .
> >
> > Thanks Keith.
> >
> >
> > On 6/8/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> > >
> > > Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> > > POJO service?
> > >
> > > The short version of my question is that I'm making a GET request like
> > this:
> > >
> > >
> >
http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > >
> > > But am getting an exception regarding a namespace mismatch
> > >
> > > Here's what I did to samples/pojo:
> > >
> > > 1. Have the default constructor to the sample/pojo AddressBookService
> > > add a couple of Entry. E.g.,
> > >
> > >   public AddressBookService() {
> > > super();
> > > Entry e1 = new Entry();
> > > e1.setName("John");
> > > e1.setStreet("1 Broadway");
> > > e1.setCity("Cambridge");
> > > e1.setState("MA");
> > > e1.setPostalCode("02142");
> > > Entry e2 = new Entry();
> > > e2.setName("George");
> > > e2.setStreet("1600 Penn");
> > > e2.setCity("Washington");
> > > e2.setState("DC");
> > > e2.setPostalCode("0");
> > > entries.put(e1.getName(), e1);
> > > entries.put (e2.getName(), e2);
> > >   }
> > >
> > > 2. Build and deploy.
> > >
> > > 3. Try and access the service as follows:
> > >
> > >
> >
http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
> > >
> > > 4. Get exception like this:
> > >
> > > Jun 8, 2007 1:56:30 PM
> > > org.apache.axis2.rpc.receivers.RPCMessageReceiver
> > invokeBusinessLogic
> > > SEVERE: Exception occurred while trying to invoke service method
findEntry
> > > org.apache.axis2.AxisFault: namespace mismatch require
> > > http://service.addressbook.sample/xsd found none
> > > at
> >
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
> > > at
> >
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
> > (AbstractInOutSyncMessageReceiver.java:39)
> > > at
> >
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
> > >
> > > 5. I haven't added a JIRA -- seems like this one deserves a sanity
> > > check. Anyone?
> > >
> > > I found this in my own code where a service which worked via the 1.1.1
> > > Axis2RestServlet worked; but is now seemingly broken in the same way
> > > as the above.
> > >
> > > 6. As an aside, the documentation here:
> > >
> > > http://ws.apache.org/axis2/1_2/rest-ws.html
> > >
> > > is quite thin. The very last section shows a regular GET accessing
> > > version information via
> > >
http://127.0.0.1:8080/axis2/services/Version/getVersion
> > -- that's
> > > perfectly nice, but showing a few more examples, e.g., accessing a
> > > service with parameters -- would be more realistic. To be sure, one
> > > might write a Java REST client, but I would hazard a guess that many
> > > users are clients are in scripting languages and they just want to hit
> > > the URL and get the XML representation back.
> > >
> > >
> >
-
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> >
> > --
> > Keith Chapman
> > WSO2 Inc.
> > Oxygen for Web Services Developers.
> > http://wso2.org/
>
>
-
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Does Axis2 1.2 REST work with POJO service?

2007-06-11 Thread John G. Norman

Keith,

Thanks.

How do I do that with just a plain HTTP GET? Parameters on the URL?

John

On 6/11/07, keith chapman <[EMAIL PROTECTED]> wrote:

Hi John,

Yes REST works for pojo services.
It looks like the request should ne namespace qualified. Just try qualifying
the request usung the namespace
http://service.addressbook.sample/xsd .

Thanks Keith.


On 6/8/07, John G. Norman <[EMAIL PROTECTED]> wrote:
>
> Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
> POJO service?
>
> The short version of my question is that I'm making a GET request like
this:
>
>
http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
>
> But am getting an exception regarding a namespace mismatch
>
> Here's what I did to samples/pojo:
>
> 1. Have the default constructor to the sample/pojo AddressBookService
> add a couple of Entry. E.g.,
>
>   public AddressBookService() {
> super();
> Entry e1 = new Entry();
> e1.setName("John");
> e1.setStreet("1 Broadway");
> e1.setCity("Cambridge");
> e1.setState("MA");
> e1.setPostalCode("02142");
> Entry e2 = new Entry();
> e2.setName("George");
> e2.setStreet("1600 Penn");
> e2.setCity("Washington");
> e2.setState("DC");
> e2.setPostalCode("0");
> entries.put(e1.getName(), e1);
> entries.put(e2.getName(), e2);
>   }
>
> 2. Build and deploy.
>
> 3. Try and access the service as follows:
>
>
http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John
>
> 4. Get exception like this:
>
> Jun 8, 2007 1:56:30 PM
> org.apache.axis2.rpc.receivers.RPCMessageReceiver
invokeBusinessLogic
> SEVERE: Exception occurred while trying to invoke service method findEntry
> org.apache.axis2.AxisFault: namespace mismatch require
> http://service.addressbook.sample/xsd found none
> at
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
> at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive
(AbstractInOutSyncMessageReceiver.java:39)
> at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
>
> 5. I haven't added a JIRA -- seems like this one deserves a sanity
> check. Anyone?
>
> I found this in my own code where a service which worked via the 1.1.1
> Axis2RestServlet worked; but is now seemingly broken in the same way
> as the above.
>
> 6. As an aside, the documentation here:
>
> http://ws.apache.org/axis2/1_2/rest-ws.html
>
> is quite thin. The very last section shows a regular GET accessing
> version information via
> http://127.0.0.1:8080/axis2/services/Version/getVersion
-- that's
> perfectly nice, but showing a few more examples, e.g., accessing a
> service with parameters -- would be more realistic. To be sure, one
> might write a Java REST client, but I would hazard a guess that many
> users are clients are in scripting languages and they just want to hit
> the URL and get the XML representation back.
>
>
-
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



--
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Does Axis2 1.2 REST work with POJO service?

2007-06-08 Thread John G. Norman

Does the Axis2 1.2 REST (oops, I mean, POX over HTTP :-) work with a
POJO service?

The short version of my question is that I'm making a GET request like this:

http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John

But am getting an exception regarding a namespace mismatch

Here's what I did to samples/pojo:

1. Have the default constructor to the sample/pojo AddressBookService
add a couple of Entry. E.g.,

 public AddressBookService() {
   super();
   Entry e1 = new Entry();
   e1.setName("John");
   e1.setStreet("1 Broadway");
   e1.setCity("Cambridge");
   e1.setState("MA");
   e1.setPostalCode("02142");
   Entry e2 = new Entry();
   e2.setName("George");
   e2.setStreet("1600 Penn");
   e2.setCity("Washington");
   e2.setState("DC");
   e2.setPostalCode("0");
   entries.put(e1.getName(), e1);
   entries.put(e2.getName(), e2);
 }

2. Build and deploy.

3. Try and access the service as follows:

http://localhost:8080/axis2/services/AddressBookService/findEntry?name=John

4. Get exception like this:

Jun 8, 2007 1:56:30 PM
org.apache.axis2.rpc.receivers.RPCMessageReceiver invokeBusinessLogic
SEVERE: Exception occurred while trying to invoke service method findEntry
org.apache.axis2.AxisFault: namespace mismatch require
http://service.addressbook.sample/xsd found none
   at 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:98)
   at 
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
   at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)

5. I haven't added a JIRA -- seems like this one deserves a sanity
check. Anyone?

I found this in my own code where a service which worked via the 1.1.1
Axis2RestServlet worked; but is now seemingly broken in the same way
as the above.

6. As an aside, the documentation here:

   http://ws.apache.org/axis2/1_2/rest-ws.html

is quite thin. The very last section shows a regular GET accessing
version information via
http://127.0.0.1:8080/axis2/services/Version/getVersion -- that's
perfectly nice, but showing a few more examples, e.g., accessing a
service with parameters -- would be more realistic. To be sure, one
might write a Java REST client, but I would hazard a guess that many
users are clients are in scripting languages and they just want to hit
the URL and get the XML representation back.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis2 1.2 sanity check: Can generated POJO service/client handle 0-length array?

2007-05-24 Thread John G. Norman

Here it is: https://issues.apache.org/jira/browse/AXIS2-2706

On 5/24/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:


Absolutely, please do log a JIRA.

thanks,
dims

On 5/24/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> See note after exception trace below.
>
> Dims, if you advise, I will add some code to the POJO example code
shipped
> with Axis 1.2, and will add to Jira.
>
> Also see after the exception trace below for a note about the POJO
service.
>
> Here's a summary:
>
> In the Java POJO service:
>
> return new Job[0];
>
> In the WSDL:
>
> 
> 
> 
>  type="ns:Job"/>
> 
> 
> 
>
> 
>  wsaw:Action="urn:getJobsLaunched"/>
> 
>  name="getJobsLaunchedFault"/>
> 
>
> In the response that gets a client-side exception (exception trace
below):
>
>  xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/
"> xmlns:ns="http://v00.services.exampleco.com/xsd";
> />
>
> An example of a good response:
>
>  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> "> xmlns:ns="http://v00.services.exampleco.com/xsd";> xmlns=" http://v00.services.exampleco.com/xsd";>The
> bottle-washer has many
> responsibilities.http://v00.services.exampleco.com/xsd";>false xmlns="http://v00.services.exampleco.com/xsd";>300 xmlns="
> http://v00.services.exampleco.com/xsd
">ZWEWprOZEZSCWLPndg4-vqD2xKI xmlns="http://v00.services.exampleco.com/xsd
> ">Cambridge xmlns="http://v00.services.exampleco.com/xsd
">bottle-washer xmlns="
> http://v00.services.exampleco.com/xsd";>exampleco.com
 xmlns="http://v00.services.exampleco.com/xsd
> ">5000 xmlns="http://v00.services.exampleco.com/xsd
">JOB-001 xmlns="
> http://v00.services.exampleco.com/xsd
">iQSF587mI9niSrA5E2C1kP4qTaQ xmlns="http://v00.services.exampleco.com/xsd ">The
> bottle-washer has many
> responsibilities. xmlns="http://v00.services.exampleco.com/xsd";>false xmlns="
> http://v00.services.exampleco.com/xsd";>300 xmlns="http://v00.services.exampleco.com/xsd
> ">gkQqnYvQ3wT48vbcWznqhds3Syo xmlns="http://v00.services.exampleco.com/xsd";>Cambridge xmlns="
> http://v00.services.exampleco.com/xsd";>bottle-washer xmlns="http://v00.services.exampleco.com/xsd";>
> exampleco.com xmlns="http://v00.services.exampleco.com/xsd";>5000 xmlns="
> http://v00.services.exampleco.com/xsd";>JOB-001 xmlns="http://v00.services.exampleco.com/xsd
">f823FbOqFKoT7OrTNd238HO2lx0
>
>
>
> Exception trace:
>
> com.exampleco.clients.ServiceException:
> java.lang.RuntimeException: java.lang.RuntimeException: Unexpected
> subelement getJobsLaunchedResponse
> at
>
> [much deleted, then . . .]
>
> Caused by: java.lang.RuntimeException: java.lang.RuntimeException:
> Unexpected subelement getJobsLaunchedResponse
> at
> com.exampleco.generated.stubs.ReferralServiceStub.fromOM(
ReferralServiceStub.java:17392)
>  at
> com.exampleco.generated.stubs.ReferralServiceStub.getJobsLaunched(
ReferralServiceStub.java:557)
> at
> com.exampleco.clients.impl.ReferralServiceImpl.getJobsLaunched(
ReferralServiceImpl.java:156)
> ... 17 more
> Caused by: java.lang.RuntimeException: Unexpected subelement
> getJobsLaunchedResponse
> at
>
com.exampleco.generated.stubs.ReferralServiceStub$GetJobsLaunchedResponse$Factory.parse
(ReferralServiceStub.java:16924)
>  at
> com.exampleco.generated.stubs.ReferralServiceStub.fromOM(
ReferralServiceStub.java:17281)
> ... 19 more
>
>
> -
>
> So much is right about the POJO service apparatus. But if I had to put
my
> finger on something that would improve it, it would be making the sample
> application (the weather one) a bit more complicated. The three things I
> would add to that application, to make it resemble a bit more what
happens
> in the real world, would be: (1) A method than returns void; (2) A
method
> that throws exceptions that the client is expected to catch; (3)
returning
> arrays, and zero-length arrays.
>
> One of the reasons that beefing up this example would help is because
there
> is so much churn on the list regarding these topics. The POJO service
> apparatus is very close to following the 80/20 paradigm for the bulk of
> simple Java cases.
>
>
> On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
> > It seems like the schema in the wsdl might need a tweak as the adb
> > generated code is expecting at least 1. could you try saving the wsdl
> > and 

Re: Axis2 1.2 sanity check: Can generated POJO service/client handle 0-length array?

2007-05-24 Thread John G. Norman

See note after exception trace below.

Dims, if you advise, I will add some code to the POJO example code shipped
with Axis 1.2, and will add to Jira.

Also see after the exception trace below for a note about the POJO service.

Here's a summary:

In the Java POJO service:

   return new Job[0];

In the WSDL:


   
   











In the response that gets a client-side exception (exception trace below):

http://schemas.xmlsoap.org/soap/envelope/";>http://v00.services.exampleco.com/xsd";
/>

An example of a good response:

http://schemas.xmlsoap.org/soap/envelope/";>http://v00.services.exampleco.com/xsd";>http://v00.services.exampleco.com/xsd";>The bottle-washer has many
responsibilities.http://v00.services.exampleco.com/xsd";>falsehttp://v00.services.exampleco.com/xsd";>300http://v00.services.exampleco.com/xsd";>ZWEWprOZEZSCWLPndg4-vqD2xKIhttp://v00.services.exampleco.com/xsd";>Cambridgehttp://v00.services.exampleco.com/xsd";>bottle-washerhttp://v00.services.exampleco.com/xsd";>exampleco.comhttp://v00.services.exampleco.com/xsd";>5000http://v00.services.exampleco.com/xsd";>JOB-001http://v00.services.exampleco.com/xsd";>iQSF587mI9niSrA5E2C1kP4qTaQhttp://v00.services.exampleco.com/xsd";>The bottle-washer has many
responsibilities.http://v00.services.exampleco.com/xsd";>falsehttp://v00.services.exampleco.com/xsd";>300http://v00.services.exampleco.com/xsd";>gkQqnYvQ3wT48vbcWznqhds3Syohttp://v00.services.exampleco.com/xsd";>Cambridgehttp://v00.services.exampleco.com/xsd";>bottle-washerhttp://v00.services.exampleco.com/xsd";>exampleco.comhttp://v00.services.exampleco.com/xsd";>5000http://v00.services.exampleco.com/xsd";>JOB-001http://v00.services.exampleco.com/xsd
">f823FbOqFKoT7OrTNd238HO2lx0



Exception trace:

com.exampleco.clients.ServiceException: java.lang.RuntimeException:
java.lang.RuntimeException: Unexpected subelement getJobsLaunchedResponse
   at

[much deleted, then . . .]

Caused by: java.lang.RuntimeException: java.lang.RuntimeException:
Unexpected subelement getJobsLaunchedResponse
   at com.exampleco.generated.stubs.ReferralServiceStub.fromOM(
ReferralServiceStub.java:17392)
   at com.exampleco.generated.stubs.ReferralServiceStub.getJobsLaunched(
ReferralServiceStub.java:557)
   at com.exampleco.clients.impl.ReferralServiceImpl.getJobsLaunched(
ReferralServiceImpl.java:156)
   ... 17 more
Caused by: java.lang.RuntimeException: Unexpected subelement
getJobsLaunchedResponse
   at
com.exampleco.generated.stubs.ReferralServiceStub$GetJobsLaunchedResponse$Factory.parse
(ReferralServiceStub.java:16924)
   at com.exampleco.generated.stubs.ReferralServiceStub.fromOM(
ReferralServiceStub.java:17281)
   ... 19 more


-

So much is right about the POJO service apparatus. But if I had to put my
finger on something that would improve it, it would be making the sample
application (the weather one) a bit more complicated. The three things I
would add to that application, to make it resemble a bit more what happens
in the real world, would be: (1) A method than returns void; (2) A method
that throws exceptions that the client is expected to catch; (3) returning
arrays, and zero-length arrays.

One of the reasons that beefing up this example would help is because there
is so much churn on the list regarding these topics. The POJO service
apparatus is very close to following the 80/20 paradigm for the bulk of
simple Java cases.


On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:


It seems like the schema in the wsdl might need a tweak as the adb
generated code is expecting at least 1. could you try saving the wsdl
and tweaking the schema (minOccurs/maxOccurs) and then codegen using
the tweaked wsdl. If you make no headway, please log a bug with your
javabean/wsdl etc.

thanks,
dims

On 5/23/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> Thanks, dims.
>
> I'm returning an array of javabeans. So it's like:
>
> return new Thingy[0];
>
> (Returning many of them is fine; returning one of them is fine.)
>
>
> On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
> >
> > Say you are returning an array of strings...are you doing this?
> >
> > return new String[0];
> >
> > or this?
> >
> > return null;
> >
> > thanks,
> > dims
> >
> > On 5/23/07, John G. Norman < [EMAIL PROTECTED]> wrote:
> > > Hi.
> > >
> > > My Axis2 1.2 POJO service
> > > (http://ws.apache.org/axis2/1_2/pojoguide.html) can
> return
> > > an array of length 0.
> > >
> > > Does anyone know definitively if this will work with a vanilla
client
> > > generated with org.apache.axis2.tool.ant.AntCodegenTask
> > > taking all of 

Re: Axis2 1.2 sanity check: Can generated POJO service/client handle 0-length array?

2007-05-23 Thread John G. Norman

Unfortunately I'm stuck with Java 1.4; I've actually been doing quite
a bit of JAX-WS with Glassfish + Java 5, and I love it, but the
environment for this project requires 1.4.

I'll look into the JiBX binding. Thanks.

The POJO/ADB stuff in Axis2 is not great. 1.1.1 was terrible, 1.2 can be used.

(Among other things in the POJO support in 1.1.1: It couldn't handle
Java methods returning null; it completely blew exception handling.
But, sadly, even with these things partially fixed, 1.2 is different
enough from 1.1.1 that I've had to make some pretty serious changes in
a bunch of custom modules for SOAP envelope handling and much else.)

On 5/23/07, Dennis Sosnoski <[EMAIL PROTECTED]> wrote:

Hi John,

I haven't tried out the Axis2 POJO support, but in general anything you
do using POJOs directly is going to be both inflexible and very limited
in terms of the XML support. You might want to look into using JiBX data
binding, which will provide full XML support for existing POJO classes
while also offering a lot more flexibility. The Jibx2Wsdl tool
(http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/jibx2wsdl) can be
used to generate the full set of artifacts for this, including a JiBX
binding, the corresponding XML schema, and the WSDL.

If you're using Java 5+, you might also be able to use JAXB annotations
in your POJOs to achieve the same results (or does that change these to
POAJOs, Plain Old Annotated Java Objects?). I know there's some basic
support for JAXB in the Axis2 1.2 release. I don't know if this allows
you to work with existing JAXB-annotated classes, or if you always have
to generate your classes. JAX-WS support would definitely allow this,
but from what I know that's still at an experimental stage.

  - Dennis

--
Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



John G. Norman wrote:
> dims,
>
> Thanks. I'll look into that and will get back to the list and/or Jira
> tomorrow.
>
> Note that I am trying to avoid tweaking the WSDL at all costs. The
> value of the POJO stuff lies in not having to do that . . .
>
> John
>
> On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
>> It seems like the schema in the wsdl might need a tweak as the adb
>> generated code is expecting at least 1. could you try saving the wsdl
>> and tweaking the schema (minOccurs/maxOccurs) and then codegen using
>> the tweaked wsdl. If you make no headway, please log a bug with your
>> javabean/wsdl etc.
>>
>> thanks,
>> dims
>>
>> On 5/23/07, John G. Norman <[EMAIL PROTECTED]> wrote:
>> > Thanks, dims.
>> >
>> > I'm returning an array of javabeans. So it's like:
>> >
>> > return new Thingy[0];
>> >
>> > (Returning many of them is fine; returning one of them is fine.)
>> >
>> >
>> > On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
>> > >
>> > > Say you are returning an array of strings...are you doing this?
>> > >
>> > > return new String[0];
>> > >
>> > > or this?
>> > >
>> > > return null;
>> > >
>> > > thanks,
>> > > dims
>> > >
>> > > On 5/23/07, John G. Norman < [EMAIL PROTECTED]> wrote:
>> > > > Hi.
>> > > >
>> > > > My Axis2 1.2 POJO service
>> > > > (http://ws.apache.org/axis2/1_2/pojoguide.html) can
>> > return
>> > > > an array of length 0.
>> > > >
>> > > > Does anyone know definitively if this will work with a vanilla
>> client
>> > > > generated with org.apache.axis2.tool.ant.AntCodegenTask
>> > > > taking all of the defaults?
>> > > >
>> > > > (I.e., I'm trying to leverage as much of the auto-generated
>> stuff as
>> > > > possible.)
>> > > >
>> > > > At present, my client is generating a runtime exception:
>> unexpected
>> > > > subelement.
>> > > >
>> > > > Before I start going into this, if anyone has a proof case that a
>> > 0-length
>> > > > array can be successfully returned, I would appreciate it.
>> > > >
>> > > > I'm not going to paste in the XML 'cos I'm more concerned to
>> know if
>> > anyone
>> > > > can confirm the successful case, before I start to debug.
>> > > >
>> > > >
>> > >
>> > &g

Re: Axis2 1.2 sanity check: Can generated POJO service/client handle 0-length array?

2007-05-23 Thread John G. Norman

dims,

Thanks. I'll look into that and will get back to the list and/or Jira tomorrow.

Note that I am trying to avoid tweaking the WSDL at all costs. The
value of the POJO stuff lies in not having to do that . . .

John

On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:

It seems like the schema in the wsdl might need a tweak as the adb
generated code is expecting at least 1. could you try saving the wsdl
and tweaking the schema (minOccurs/maxOccurs) and then codegen using
the tweaked wsdl. If you make no headway, please log a bug with your
javabean/wsdl etc.

thanks,
dims

On 5/23/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> Thanks, dims.
>
> I'm returning an array of javabeans. So it's like:
>
> return new Thingy[0];
>
> (Returning many of them is fine; returning one of them is fine.)
>
>
> On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
> >
> > Say you are returning an array of strings...are you doing this?
> >
> > return new String[0];
> >
> > or this?
> >
> > return null;
> >
> > thanks,
> > dims
> >
> > On 5/23/07, John G. Norman < [EMAIL PROTECTED]> wrote:
> > > Hi.
> > >
> > > My Axis2 1.2 POJO service
> > > (http://ws.apache.org/axis2/1_2/pojoguide.html) can
> return
> > > an array of length 0.
> > >
> > > Does anyone know definitively if this will work with a vanilla client
> > > generated with org.apache.axis2.tool.ant.AntCodegenTask
> > > taking all of the defaults?
> > >
> > > (I.e., I'm trying to leverage as much of the auto-generated stuff as
> > > possible.)
> > >
> > > At present, my client is generating a runtime exception: unexpected
> > > subelement.
> > >
> > > Before I start going into this, if anyone has a proof case that a
> 0-length
> > > array can be successfully returned, I would appreciate it.
> > >
> > > I'm not going to paste in the XML 'cos I'm more concerned to know if
> anyone
> > > can confirm the successful case, before I start to debug.
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas :: http://davanum.wordpress.com
> >
> >
> -
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>


--
Davanum Srinivas :: http://davanum.wordpress.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis2 1.2 sanity check: Can generated POJO service/client handle 0-length array?

2007-05-23 Thread John G. Norman

Thanks, dims.

I'm returning an array of javabeans. So it's like:

return new Thingy[0];

(Returning many of them is fine; returning one of them is fine.)

On 5/23/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:


Say you are returning an array of strings...are you doing this?

return new String[0];

or this?

return null;

thanks,
dims

On 5/23/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> Hi.
>
> My Axis2 1.2 POJO service
> (http://ws.apache.org/axis2/1_2/pojoguide.html) can return
> an array of length 0.
>
> Does anyone know definitively if this will work with a vanilla client
> generated with org.apache.axis2.tool.ant.AntCodegenTask
> taking all of the defaults?
>
> (I.e., I'm trying to leverage as much of the auto-generated stuff as
> possible.)
>
> At present, my client is generating a runtime exception: unexpected
> subelement.
>
> Before I start going into this, if anyone has a proof case that a
0-length
> array can be successfully returned, I would appreciate it.
>
> I'm not going to paste in the XML 'cos I'm more concerned to know if
anyone
> can confirm the successful case, before I start to debug.
>
>


--
Davanum Srinivas :: http://davanum.wordpress.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Axis2 1.2 sanity check: Can generated POJO service/client handle 0-length array?

2007-05-23 Thread John G. Norman

Hi.

My Axis2 1.2 POJO service (http://ws.apache.org/axis2/1_2/pojoguide.html)
can return an array of length 0.

Does anyone know definitively if this will work with a vanilla client
generated with org.apache.axis2.tool.ant.AntCodegenTask taking all of the
defaults?

(I.e., I'm trying to leverage as much of the auto-generated stuff as
possible.)

At present, my client is generating a runtime exception: unexpected
subelement.

Before I start going into this, if anyone has a proof case that a 0-length
array can be successfully returned, I would appreciate it.

I'm not going to paste in the XML 'cos I'm more concerned to know if anyone
can confirm the successful case, before I start to debug.


Re: Release notes don't mention change in class name for generated stubs

2007-05-17 Thread John G. Norman

Thanks, guys.

In my case, I can't strip out the binding because I'm using the POJO service.

John

On 5/15/07, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:

Hi Dennis ,

I also agree with you that breaking backward compatibility among the
releases , what we should do is improve the functionalities without
breaking any API.

Thanks
Deepal
> Hi John,
>
> I agree completely - the Axis2 releases have been careless about
> breaking backward compatibility without even mentioning the breaks in
> the documentation. It looks like there's going to be a new set of API
> changes going into the 1.3 build, so I'll try to monitor what's
> changed in the release candidates and add a Jira for documenting
> anything that effects normal users.
>
> On this particular point, you may find it convenient to just strip out
> the SOAP 1.2  in the WSDL. If there's only one binding
> present WSDL2Java will use the same names as before.
>
>  - Dennis
>
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Axis2 Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Release notes don't mention change in class name for generated stubs

2007-05-10 Thread John G. Norman

Amila,

All I'm asking for is that the release notes should describe things
that break dependencies.

Even a link to an archived e-mail in the user or developer list would help.

Anything: Just a toehold.

:-)

John

On 5/10/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:

I really sorry for your inconvenience. Anyway we discussed this in user and
developer lists.
 Earlier Axis2 generated the code only for one port. But now it generates
the code for all the ports
So if you want to generate the code only for one binding please specify them
with the
-sn  -pn  attributes.



On 5/9/07, John G. Norman <[EMAIL PROTECTED]> wrote:
>
> I notice that codegen'd client stubs in 1.2 now have names like
>
> UserServiceUserServiceSOAP12Port_httpStub
>
> rather than
>
> UserServiceStub
>
> I suppose I can live with the name change, though it did, er, break my
> build script -- but the fact that this change is not mentioned in the
> release notes is inexcusable.
>
> If the changes are buried in JIRA, you might provide a link in the
> release notes that would pull up the changes for the particular
> packages or tools.
>
>
-
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



--
Amila Suriarachchi,
WSO2 Inc.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Release notes don't mention change in class name for generated stubs

2007-05-09 Thread John G. Norman

I notice that codegen'd client stubs in 1.2 now have names like

   UserServiceUserServiceSOAP12Port_httpStub

rather than

   UserServiceStub

I suppose I can live with the name change, though it did, er, break my
build script -- but the fact that this change is not mentioned in the
release notes is inexcusable.

If the changes are buried in JIRA, you might provide a link in the
release notes that would pull up the changes for the particular
packages or tools.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Axis2 deploy in Sun Application Server?

2007-04-17 Thread John G. Norman

Just FYI, The Tomcat 5.0.28 JSP compiler fails as well (i.e.,
pre-compiling JSPs before deploying - the on-the-fly compilation may
have worked) on jsp:include tags:

The original code has this idiom:

   

But Tomcat's JSP compiler can only handle:

   

John

On 4/16/07, Lahiru Sandakith <[EMAIL PROTECTED]> wrote:

Hi Duncan,

I have seen some compilation problems earlier and done small fixes to the
JSPs of the axis2 webapp to get it validate through the ECLIPSE WTP 1.5.1
JSP syntax validator (I believe J2EE complient).  Other than few warning
messages it did pass the validation. I have not tried it with sun
application server. Please try it, it will be valuable feedback.

Thanks

Lahiru


On 4/17/07, Duncan Thomson <[EMAIL PROTECTED]> wrote:
> I'm trying to deploy Axis2 in Sun Java System Application Server
> Platform Edition 9.0
>
> It fails.
>
> When I run the sun application server "verifier" tool on axis2.war
> I get the errors shown below.
>
> These errors seem like they'd be fixable without too much
> effort...  However, before I attempt this, has anyone had any
> experience getting axis2 deployed on the Sun App server?
>
> Thanks,
>
> Duncan
>
>
> Output from running Sun "verifier" on axis2.war:
>
===
>   FAILED TESTS :
>   --
>
>   Test Name : tests.web.AllJSPsMustBeCompilable
>   Test Assertion : All the JSPs that are bundled inside a
> web application must be compilable using a J2EE compliant JSP
> compiler th
> at does not have any proprietary or optional features in it.
>   Test Description : For [ axis2 ]
> Error: Some JSPs bundled inside [ axis2 ] could not be compiled.
> See details below.
> axis2-web/TopFrame.jsp(29,4) Expecting "jsp:param" standard action
> with "name" and "value" attributes
> axis2-web/listGroupService.jsp(38,0) Expecting
"jsp:param"
> standard action with "name" and "value" attributes
>
>   Test Name : tests.web.WelcomeFile
>   Test Assertion : welcome-file element contains the file
> name to use as a default welcome file.
>   Test Description : For [ axis2 ]
> Error: Welcome file URL [ /axis2-web/index.jsp ] must be a partial
> URL with no trailing or leading /.
>
=
>
> --
> Duncan Thomson
> Tel:  703-983-7337
> Mobile:   703-463-0536
> Text Msg: [EMAIL PROTECTED]
>
>
>
>
-
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



--
Regards
Lahiru Sandakith


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [Axis2 1.1.1] Exceptions and POJO services

2007-04-16 Thread John G. Norman

I'm having the same problem. In my POJO service I have something like:

public String myOp(String s) throws MyException . . .

But no fault for MyException is showing up in the WSDL, and so when I
try to generate an ADB client against the WSDL, I don't get
client-side exception code generated. And if I throw MyException from
the service, all I get is RemoteException on the client (with cause
set to null).

Could someone from Axis2 verify this a bit? POJO service/client
handling of exceptions seems pretty broken. I could file a JIRA, but
I'm uncertain that a description of these symptoms would capture what
seems to be pretty significant lack of functionality. (Or maybe POJO
services aren't supposed to throw exceptions!?)

On 4/16/07, Jarek Kucypera <[EMAIL PROTECTED]> wrote:

If I declare a (non-void) service method to throw an exception,
the resulting wsdl describes the corresponding exception
type as anyType, like this:
 
  
   
  
 
Is there a way to throw custom exceptions (return faults of custom
types) from POJO based services, so that the fault type is
described in the wsdl ?

J.K.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Clients don't get exception thrown out of methods returning void (was: Re: Web service error handling with POJO approach)

2007-04-15 Thread John G. Norman

Thanks, Anne. Here it is:

   https://issues.apache.org/jira/browse/AXIS2-2529

I attached a ZIP of a hacked version of samples/pojo that demonstrates
the problem.

On 4/15/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote:

Please file a JIRA.

On 4/14/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> Martin,
>
> *** Throw an exception from the method that returns void.
>
> That's what my posting was about: If you throw an exception from a
> method that returns void, ** the client never gets the exception **.
> It will be logged on the server-side.
>
> If you change the method to return something like String (but, again,
> throw an exception from within the method), the client does get the
> exception.
>
> John
>
> On 4/14/07, Martin Gainty <[EMAIL PROTECTED]> wrote:
> > Good Afternoon John-
> >
> > I just deployed the Axis 2.1.1 original pojo sample of AddressBookService
> > without any errors
> >
> > pojo/build/classes/META-INF/services.xml displays
> > 
> > 
> > POJO: AddressBook Service
> > 
> > 
> > http://www.w3.org/2004/08/wsdl/in-only";
> >  
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
> > http://www.w3.org/2004/08/wsdl/in-out";
> >  
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> > 
> >  > locked="false">sample.addressbook.service.AddressBookService
> >
> > 
> >
> > here is the code for AddressBookService
> >
> > package sample.addressbook.service;
> > public class AddressBookService {
> > private HashMap entries = new HashMap();
> > /*** Add an Entry to the Address Book
> >  * @param entry */
> > public void addEntry(Entry entry)
> >{
> > this.entries.put(entry.getName(), entry);
> > }
> >
> > /*** Search an address of a person
> >  * @param name the name of the person whose address needs to be found
> >  * @return return the address entry of the person.
> >  */
> > public Entry findEntry(String name)
> >{
> > return (Entry) this.entries.get(name);
> > }
> > }
> >
> > !--once the service is deployed I can access the service attributes via
> > !--http://localhost:8080/axis2-/axis2-admin/listService
> > !--which displays
> >
> > Service Description: AddressBookService
> > Service Status : Active
> > Engaged modules for the service
> >   a.. addressing-1.1 :: Disengage
> >
> >   Available operations
> >   b.. addEntry
> >   Engaged Modules for the Operation
> > a.. addressing-1.1 :: Disengage
> >
> >   c.. findEntry
> >   Engaged Modules for the Operation
> > a.. addressing-1.1 :: Disengage
> >
> >
> > I'm attempting to understand why you had to change the signatures when
> > services.xml already declares
> > org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver (addEntry method)
> > org.apache.axis2.rpc.receivers.RPCMessageReceiver (findEntry method)
> >
> > ???
> > Martin
> >
> > This email message and any files transmitted with it contain confidential
> > information intended only for the person(s) to whom this email message is
> > addressed.  If you have received this email message in error, please notify
> > the sender immediately by telephone or email and destroy the original
> > message without making a copy.  Thank you.
> >
> > - Original Message -
> > From: "John G. Norman" <[EMAIL PROTECTED]>
> > To: 
> > Sent: Saturday, April 14, 2007 11:12 AM
> > Subject: Clients don't get exception thrown out of methods returning void
> > (was: Re: Web service error handling with POJO approach)
> >
> >
> > > After many hours, I finally traced my problem to an apparent bug.
> > >
> > > (Workaround for the bug at the end.)
> > >
> > > The bug looks a lot like 1277 in Jira, which was a blocker and
> > > resolved for 1.0 (http://issues.apache.org/jira/browse/AXIS2-1277).
> > >
> > > Before I add a bug report, I would appreciate it if someone out there
> > > could reproduce what's below as a sanity check. It's about 10 lines
> > > added to one of the samples.
> > >
> > > Here's the story:
> > >
> > > My POJO-style client wasn't getting exceptions from its POJO-style
> > > service. So I went back to the samp

Re: Clients don't get exception thrown out of methods returning void (was: Re: Web service error handling with POJO approach)

2007-04-14 Thread John G. Norman

Martin,

*** Throw an exception from the method that returns void.

That's what my posting was about: If you throw an exception from a
method that returns void, ** the client never gets the exception **.
It will be logged on the server-side.

If you change the method to return something like String (but, again,
throw an exception from within the method), the client does get the
exception.

John

On 4/14/07, Martin Gainty <[EMAIL PROTECTED]> wrote:

Good Afternoon John-

I just deployed the Axis 2.1.1 original pojo sample of AddressBookService
without any errors

pojo/build/classes/META-INF/services.xml displays


POJO: AddressBook Service


http://www.w3.org/2004/08/wsdl/in-only";
 
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
http://www.w3.org/2004/08/wsdl/in-out";
 
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>

sample.addressbook.service.AddressBookService



here is the code for AddressBookService

package sample.addressbook.service;
public class AddressBookService {
private HashMap entries = new HashMap();
/*** Add an Entry to the Address Book
 * @param entry */
public void addEntry(Entry entry)
   {
this.entries.put(entry.getName(), entry);
}

/*** Search an address of a person
 * @param name the name of the person whose address needs to be found
 * @return return the address entry of the person.
 */
public Entry findEntry(String name)
   {
return (Entry) this.entries.get(name);
}
}

!--once the service is deployed I can access the service attributes via
!--http://localhost:8080/axis2-/axis2-admin/listService
!--which displays

Service Description: AddressBookService
Service Status : Active
Engaged modules for the service
  a.. addressing-1.1 :: Disengage

  Available operations
  b.. addEntry
  Engaged Modules for the Operation
a.. addressing-1.1 :: Disengage

  c.. findEntry
  Engaged Modules for the Operation
a.. addressing-1.1 :: Disengage


I'm attempting to understand why you had to change the signatures when
services.xml already declares
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver (addEntry method)
org.apache.axis2.rpc.receivers.RPCMessageReceiver (findEntry method)

???
Martin

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message -
From: "John G. Norman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 14, 2007 11:12 AM
Subject: Clients don't get exception thrown out of methods returning void
(was: Re: Web service error handling with POJO approach)


> After many hours, I finally traced my problem to an apparent bug.
>
> (Workaround for the bug at the end.)
>
> The bug looks a lot like 1277 in Jira, which was a blocker and
> resolved for 1.0 (http://issues.apache.org/jira/browse/AXIS2-1277).
>
> Before I add a bug report, I would appreciate it if someone out there
> could reproduce what's below as a sanity check. It's about 10 lines
> added to one of the samples.
>
> Here's the story:
>
> My POJO-style client wasn't getting exceptions from its POJO-style
> service. So I went back to the samples/pojo example, and threw an
> exception from a method. The client got it. Hmm. I just couldn't
> figure out what the difference was between my code and the sample.
> Then I realized that my methods return void.
>
> So I added this to AddressBookService.java in samples/pojo, a method
> returning void, then a second returning String:
>
>public void test1(String s) throws Exception {
> throw new Exception("test1");
>}
>
>public String test2(String s) throws Exception {
> throw new Exception("test2");
>}
>
> And this to AddressBookADBClient.java:
>
>Test1 test1 = new Test1();
>test1.setParam0("foo");
>stub.test1(test1);
>
>Test2 test2 = new Test2();
>test2.setParam0("bar");
>stub.test2(test2);
>
> Here's a snippet from the server-side log:
>
> Apr 14, 2007 10:55:28 AM
> org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver
> invokeBusinessLogic
> SEVERE: test1
> java.lang.reflect.InvocationTargetException
> Caused by: java.lang.Exception: test1
>at sample.addressbook.service.AddressBookService.test1(Unknown
> Source)
>... 35 more
> Apr 14, 2007 10:55:29 AM
> org.ap

Clients don't get exception thrown out of methods returning void (was: Re: Web service error handling with POJO approach)

2007-04-14 Thread John G. Norman

After many hours, I finally traced my problem to an apparent bug.

(Workaround for the bug at the end.)

The bug looks a lot like 1277 in Jira, which was a blocker and
resolved for 1.0 (http://issues.apache.org/jira/browse/AXIS2-1277).

Before I add a bug report, I would appreciate it if someone out there
could reproduce what's below as a sanity check. It's about 10 lines
added to one of the samples.

Here's the story:

My POJO-style client wasn't getting exceptions from its POJO-style
service. So I went back to the samples/pojo example, and threw an
exception from a method. The client got it. Hmm. I just couldn't
figure out what the difference was between my code and the sample.
Then I realized that my methods return void.

So I added this to AddressBookService.java in samples/pojo, a method
returning void, then a second returning String:

   public void test1(String s) throws Exception {
throw new Exception("test1");
   }

   public String test2(String s) throws Exception {
throw new Exception("test2");
   }

And this to AddressBookADBClient.java:

   Test1 test1 = new Test1();
   test1.setParam0("foo");
   stub.test1(test1);

   Test2 test2 = new Test2();
   test2.setParam0("bar");
   stub.test2(test2);

Here's a snippet from the server-side log:

Apr 14, 2007 10:55:28 AM
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver
invokeBusinessLogic
SEVERE: test1
java.lang.reflect.InvocationTargetException
Caused by: java.lang.Exception: test1
   at sample.addressbook.service.AddressBookService.test1(Unknown Source)
   ... 35 more
Apr 14, 2007 10:55:29 AM
org.apache.axis2.rpc.receivers.RPCMessageReceiver invokeBusinessLogic
SEVERE: test2
java.lang.reflect.InvocationTargetException
Caused by: java.lang.Exception: test2
   at sample.addressbook.service.AddressBookService.test2(Unknown Source)
   ... 35 more

As you can see, both exceptions are thrown.

Now here's the client (NOTICE: No evidence of an exception from the
test1 method):

adb.client.run:
[java] Name   :Abby Cadabby
[java] Street :Sesame Street
[java] City   :Sesame City
[java] State  :Sesame State
[java] Postal Code :1
[java] org.apache.axis2.AxisFault: test2
[java] at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.jav
a:271)
[java] at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.
java:202)
[java] at
sample.addressbook.stub.AddressBookServiceStub.test2(Unknown Source)

So I guess that the workaround is that I'll have to have all of my
methods return something: Perhaps a String, or maybe I'll create a
JavaBean class called Nothing. Or maybe even Void with a capital V.

This is a really awful bug.

On 4/10/07, John G. Norman <[EMAIL PROTECTED]> wrote:

With a POJO Service:

I have now tried the strategy here:

http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/FaultThrowingService.java?view=markup

Still not seeing the exception on the client that calls the service .
. . Still getting:

> FaultReason; nested exception is:
> java.lang.Exception: This is a test Exception
> java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> [much deleted]
>
> Caused by: org.apache.axis2.AxisFault: FaultReason; nested exception is:
> java.lang.Exception: This is a test Exception
> at com.myco.Service.test(Service.java:45)
> ... 48 more
> Caused by: java.lang.Exception: This is a test Exception
> ... 49 more
> DEBUG 16:24:37,843 org.apache.axis2.AxisFault: FaultReason; nested
> exception is:
> java.lang.Exception: This is a test Exception
> DEBUG 16:24:37,843 isReplyRedirected: FaultTo is null. Returning
> isReplyRedirected
> DEBUG 16:24:37,843 isReplyRedirected: ReplyTo is null. Returning false
>

On 4/9/07, John G. Norman <[EMAIL PROTECTED]> wrote:
> Hi all.
>
> This is a great topic -- how to manage exceptions for services built
> on POJOs. If it is as easy as the link Anne Manes provided
> (http://wso2.org/library/171) then throwing exceptions might well be
> included in the main Axis2 docs at
> http://ws.apache.org/axis2/1_1_1/pojoguide.html).
>
> But I just tried throwing an exception out of a POJO's method  (the
> basis for a service as described here:
> http://ws.apache.org/axis2/1_1_1/pojoguide.html), and the exception
> doesn't 

Re: Web service error handling with POJO approach

2007-04-10 Thread John G. Norman

With a POJO Service:

I have now tried the strategy here:

http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/FaultThrowingService.java?view=markup

Still not seeing the exception on the client that calls the service .
. . Still getting:


FaultReason; nested exception is:
java.lang.Exception: This is a test Exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
[much deleted]

Caused by: org.apache.axis2.AxisFault: FaultReason; nested exception is:
java.lang.Exception: This is a test Exception
at com.myco.Service.test(Service.java:45)
... 48 more
Caused by: java.lang.Exception: This is a test Exception
... 49 more
DEBUG 16:24:37,843 org.apache.axis2.AxisFault: FaultReason; nested
exception is:
java.lang.Exception: This is a test Exception
DEBUG 16:24:37,843 isReplyRedirected: FaultTo is null. Returning
isReplyRedirected
DEBUG 16:24:37,843 isReplyRedirected: ReplyTo is null. Returning false



On 4/9/07, John G. Norman <[EMAIL PROTECTED]> wrote:

Hi all.

This is a great topic -- how to manage exceptions for services built
on POJOs. If it is as easy as the link Anne Manes provided
(http://wso2.org/library/171) then throwing exceptions might well be
included in the main Axis2 docs at
http://ws.apache.org/axis2/1_1_1/pojoguide.html).

But I just tried throwing an exception out of a POJO's method  (the
basis for a service as described here:
http://ws.apache.org/axis2/1_1_1/pojoguide.html), and the exception
doesn't seem to make it back to the client.

Does the QName need to match one of the faults defined in the client stub?

In any case, the code looks like this:

  public void test() throws AxisFault {
throw  new AxisFault(new QName("http://test.org";, "FaultCode",
"test"), "FaultReason", new Exception("This is a test Exception"));
  }

On the server, the trace looks like this:

FaultReason; nested exception is:
java.lang.Exception: This is a test Exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
[much deleted]

Caused by: org.apache.axis2.AxisFault: FaultReason; nested exception is:
java.lang.Exception: This is a test Exception
at com.myco.Service.test(Service.java:45)
... 48 more
Caused by: java.lang.Exception: This is a test Exception
... 49 more
DEBUG 16:24:37,843 org.apache.axis2.AxisFault: FaultReason; nested
exception is:
java.lang.Exception: This is a test Exception
DEBUG 16:24:37,843 isReplyRedirected: FaultTo is null. Returning
isReplyRedirected
DEBUG 16:24:37,843 isReplyRedirected: ReplyTo is null. Returning false

On 4/3/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote:
> See http://wso2.org/library/171.
>
> On 4/3/07, Chan, Herman <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> > Hi all:
> >
> >
> >
> > I am relatively new to Axis 2 and web services in general, so please bear
> > with me if I ask any stupid questions.
> >
> >
> >
> > I am writing a very simple web service that would return a list of
> > directories on a server.  However, if certain directories does not exists,
> > I'd like a throw an error back to the calling client.
> >
> >
> >
> > I am using the POJO approach to create web services using axis2, so is it
> > good enough for me to throw a plain Exception or do I have to do more?  What
> > is the best practice in doing error handling in web services?
> >
> >
> >
> > Thanks in advance.
> >
> >
> >
> > Herman Chan
> >
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I make message contexts available to my service impl class?

2007-04-10 Thread John G. Norman

Aaron,

Thanks -- That helps a lot.

John

On 4/10/07, aaron aston <[EMAIL PROTECTED]> wrote:

John,

I went down this route a few weeks back:

MessageContext inContext =
MessageContext.getCurrentMessageContext(); // inbound soap
context (not needed)
MessageContext outContext =
(MessageContext)inContext.getOperationContext().getMessageContext("Out");
// outbound soap context

The trick was the static "getCurrentMessageContext()" call ...

I was implementing returned attachments;  I later abandoned this approach
and I no longer need the contexts from my POJO ...

Aaron.

P.S.  getCurrentMessageContext() doesn't seem to be in the Javadoc ?!



On 10-Apr-07, at 4:46 PM, John G. Norman wrote:

After reading the source for awhile, I can see that
org.apache.axis2.engine will init, startUp, and destroy on the service
at the appropriate times, passing in the ServiceContext -- that's
great!

But I still can't find any Axis class which calls a method on the
service with the message context as a parameter.

Is there some way to get the MessageContext passed into my POJO service?

:-)

On 4/9/07, John G. Norman <[EMAIL PROTECTED]> wrote:
The subject of this e-mail refers to a page which answers the question
"How do I make message contexts available to my service impl class?"

Here's the page:

http://wso2.org/library/106

This page refers to the interface org.apache.axis2.Service

But I can't find it here:

http://ws.apache.org/axis2/1_1_1/api/index.html

Where is this interface documented? Even better, in what jar is it
delivered?

As a bonus question:

Can the "service" mentioned be a POJO? I.e., a class named for
 in services.xml when
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver and
org.apache.axis2.rpc.receivers.RPCMessageReceiver are used?

Thanks!



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



_
Aaron Aston | Twisted Pair | 905.852.0950







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How do I make message contexts available to my service impl class?

2007-04-10 Thread John G. Norman

After reading the source for awhile, I can see that
org.apache.axis2.engine will init, startUp, and destroy on the service
at the appropriate times, passing in the ServiceContext -- that's
great!

But I still can't find any Axis class which calls a method on the
service with the message context as a parameter.

Is there some way to get the MessageContext passed into my POJO service?

:-)

On 4/9/07, John G. Norman <[EMAIL PROTECTED]> wrote:

The subject of this e-mail refers to a page which answers the question
"How do I make message contexts available to my service impl class?"

Here's the page:

http://wso2.org/library/106

This page refers to the interface org.apache.axis2.Service

But I can't find it here:

http://ws.apache.org/axis2/1_1_1/api/index.html

Where is this interface documented? Even better, in what jar is it delivered?

As a bonus question:

Can the "service" mentioned be a POJO? I.e., a class named for
 in services.xml when
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver and
org.apache.axis2.rpc.receivers.RPCMessageReceiver are used?

Thanks!



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How do I make message contexts available to my service impl class?

2007-04-09 Thread John G. Norman

The subject of this e-mail refers to a page which answers the question
"How do I make message contexts available to my service impl class?"

Here's the page:

   http://wso2.org/library/106

This page refers to the interface org.apache.axis2.Service

But I can't find it here:

   http://ws.apache.org/axis2/1_1_1/api/index.html

Where is this interface documented? Even better, in what jar is it delivered?

As a bonus question:

Can the "service" mentioned be a POJO? I.e., a class named for
 in services.xml when
org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver and
org.apache.axis2.rpc.receivers.RPCMessageReceiver are used?

Thanks!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Web service error handling with POJO approach

2007-04-09 Thread John G. Norman

Hi all.

This is a great topic -- how to manage exceptions for services built
on POJOs. If it is as easy as the link Anne Manes provided
(http://wso2.org/library/171) then throwing exceptions might well be
included in the main Axis2 docs at
http://ws.apache.org/axis2/1_1_1/pojoguide.html).

But I just tried throwing an exception out of a POJO's method  (the
basis for a service as described here:
http://ws.apache.org/axis2/1_1_1/pojoguide.html), and the exception
doesn't seem to make it back to the client.

Does the QName need to match one of the faults defined in the client stub?

In any case, the code looks like this:

 public void test() throws AxisFault {
throw  new AxisFault(new QName("http://test.org";, "FaultCode",
"test"), "FaultReason", new Exception("This is a test Exception"));
 }

On the server, the trace looks like this:

FaultReason; nested exception is:
java.lang.Exception: This is a test Exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
[much deleted]

Caused by: org.apache.axis2.AxisFault: FaultReason; nested exception is:
java.lang.Exception: This is a test Exception
at com.myco.Service.test(Service.java:45)
... 48 more
Caused by: java.lang.Exception: This is a test Exception
... 49 more
DEBUG 16:24:37,843 org.apache.axis2.AxisFault: FaultReason; nested
exception is:
java.lang.Exception: This is a test Exception
DEBUG 16:24:37,843 isReplyRedirected: FaultTo is null. Returning
isReplyRedirected
DEBUG 16:24:37,843 isReplyRedirected: ReplyTo is null. Returning false

On 4/3/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote:

See http://wso2.org/library/171.

On 4/3/07, Chan, Herman <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi all:
>
>
>
> I am relatively new to Axis 2 and web services in general, so please bear
> with me if I ask any stupid questions.
>
>
>
> I am writing a very simple web service that would return a list of
> directories on a server.  However, if certain directories does not exists,
> I'd like a throw an error back to the calling client.
>
>
>
> I am using the POJO approach to create web services using axis2, so is it
> good enough for me to throw a plain Exception or do I have to do more?  What
> is the best practice in doing error handling in web services?
>
>
>
> Thanks in advance.
>
>
>
> Herman Chan
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]