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 "John G. Norman" <jo...@7fff.com> on 2007/05/23 23:34:17 UTC

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

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: Axis2 1.2 sanity check: Can generated POJO service/client handle 0-length array?

Posted by Jarek Kucypera <jk...@mikrozet.wroc.pl>.
Davanum Srinivas wrote:

> When you get a chance, please let us know what breaks or does not work 
> via JIRA.

Sure, in a week or two I plan to have it analysed.

J.K.

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


Client stubs

Posted by Demetris G <de...@ece.neu.edu>.
Hi all,

    I noticed this in one of my generated client stubs:

   public void Service_546F48A04E5(long Id) throws 
java.rmi.RemoteException {
        if (super.cachedEndpoint == null) {
            throw new org.apache.axis.NoEndPointException();
        }
        org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[2]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new 
javax.xml.namespace.QName("http://soapobject.org", 
"Service_1_0_1_0_a546f48a04e5"));


Why is the name of the service in uppercase but the QName string service 
name in lower case ? This causes
some issues at execution time. Any ideas ? The WSDL has the service name 
in lower case.

Thanks much


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


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

Posted by Davanum Srinivas <da...@gmail.com>.
Jarek,

Could you please upload your patch for the RPCMessageReceiver for AXIS2-1754?

thanks,
dims

On 6/6/07, Jarek Kucypera <jk...@mikrozet.wroc.pl> wrote:
>
> >>
> >> Fortunately axis2 guys improve the POJO deployment, they fixed some
> >> things in 1.2 (also added some
> >> annotations support), but it still requires somo work to be fully
> >> functional.
> >
> > Jarek,
> >
> > When you get a chance, please let us know what breaks or does not work
> > via JIRA.
>
> See 2603 and 1754. As a result, I'm unable to deploy any service that
> throws exceptions, as
> the generated wsdl is invalid (inheritance) and even if it wasn't, the
> exceptions wouldn't be wired (propagated to
> clients) properly.
>
> J.K.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


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

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


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

Posted by Jarek Kucypera <jk...@mikrozet.wroc.pl>.
>>
>> Fortunately axis2 guys improve the POJO deployment, they fixed some
>> things in 1.2 (also added some
>> annotations support), but it still requires somo work to be fully
>> functional.
>
> Jarek,
>
> When you get a chance, please let us know what breaks or does not work 
> via JIRA.

See 2603 and 1754. As a result, I'm unable to deploy any service that 
throws exceptions, as
the generated wsdl is invalid (inheritance) and even if it wasn't, the 
exceptions wouldn't be wired (propagated to
clients) properly.

J.K.

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


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

Posted by Davanum Srinivas <da...@gmail.com>.
Jarek,

When you get a chance, please let us know what breaks or does not work via JIRA.

thanks,
dims

On 5/25/07, Jarek Kucypera <jk...@mikrozet.wroc.pl> wrote:
> Glen Mazza wrote:
>
> >I believe that's called "contract last" development
> >
> No, IMO it depends on how you (miss)use the concept of "contract" or
> interface,
> not on which language you use to write the contract. I would be very
> glad to be able to write the contract in Java and expose it as wsdl via
> axis2 :)
>
> >(JAX-WS and JAXB) has an excellent implementation in that regard, just
> >by using annotations you can specify which methods are to become web
> >services.
> >
> Fortunately axis2 guys improve the POJO deployment, they fixed some
> things in 1.2 (also added some
> annotations support), but it still requires somo work to be fully
> functional.
>
> J.K.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


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

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


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

Posted by Jarek Kucypera <jk...@mikrozet.wroc.pl>.
Glen Mazza wrote:

>I believe that's called "contract last" development
>
No, IMO it depends on how you (miss)use the concept of "contract" or 
interface,
not on which language you use to write the contract. I would be very
glad to be able to write the contract in Java and expose it as wsdl via
axis2 :)

>(JAX-WS and JAXB) has an excellent implementation in that regard, just
>by using annotations you can specify which methods are to become web
>services.  
>
Fortunately axis2 guys improve the POJO deployment, they fixed some 
things in 1.2 (also added some
annotations support), but it still requires somo work to be fully 
functional.

J.K.

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


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

Posted by Glen Mazza <gr...@verizon.net>.
Am Freitag, den 25.05.2007, 12:31 +0200 schrieb Jarek Kucypera:

> Dennis Sosnoski wrote:
> 
> > 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. 
> 
> With all respect, xml here is the tool, not the purpose. I would like to 
> expose my serwice without any knowlege of wsdl and xml and focus just on 
> the bussiness logic, even for the price of not utilizng all the features 
> of xml. Even with axis2 1.2 it's hardly possible.
> 

I believe that's called "contract last" development--Sun/NetBeans
(JAX-WS and JAXB) has an excellent implementation in that regard, just
by using annotations you can specify which methods are to become web
services.  This philosophy may be better suited for you.  Here are links
I collected:

http://www.jroller.com/page/gmazza?entry=web_services_using_glassfish_and
http://www.jroller.com/page/gmazza?entry=sun_resources_on_jax_ws

Stay away from Spring-WS, however, they're very much contract-first:
http://static.springframework.org/spring-ws/site/reference/html/why-contract-first.html

Glen


> J.K.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 


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


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

Posted by Anne Thomas Manes <at...@gmail.com>.
If you have two different services that expose an entity called
"customer", how do you ensure that both services expose the same
schema type to represent this thing called "customer"? When the next
developer comes along that needs to implement a service that exposes
an entity called "customer", how do you ensure that this third service
also uses the same schema type to represent this thing called
"customer"?

I understand your perspective and your preference in using Java to
define your interfaces, but the issue is that when a consuming
application retrieves the service interface, it gets a WSDL with
schema declarations, not a Java interface.

Even though you separate the Java interface from its implementation,
you're still using a code-first development model.

Anne

On 6/12/07, Jarek Kucypera <jk...@mikrozet.wroc.pl> wrote:
> Anne Thomas Manes wrote:
>
> > If your goal is point-to-point integration between a single client and
> > server, then the code-first development model is fine. But if your
> > goal is to implement a service-oriented system, enable reuse of
> > capabilities, reduce redundancy, and increase flexibility and agility,
> > then the code-first development model is a bad practice.
>
> Actually we used contract first approach, but it just happened, that
> we could afford to write the contract in Java.
>
> > Service-oriented systems require governance of data types and
> > semantics. I'm sure you've noticed that if you use the code-first
> > approach, then Axis will generate a unique set of types and namespaces
> > for your application. Proliferation of schema types will make reuse
> > extremely challenging, resulting in reduced flexibility and agility,
> > and a complete failure of a SOA initiative.
>
>
> As we wrote separate interface layer, we could give (and we gave)
> descriptive names and namespaces, not reflecting  the guts of our apps.
> We just used java instead of wsdl to write interfaces to our apps.
>
> J.K.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


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

Posted by Jarek Kucypera <jk...@mikrozet.wroc.pl>.
Anne Thomas Manes wrote:

> If your goal is point-to-point integration between a single client and
> server, then the code-first development model is fine. But if your
> goal is to implement a service-oriented system, enable reuse of
> capabilities, reduce redundancy, and increase flexibility and agility,
> then the code-first development model is a bad practice.

Actually we used contract first approach, but it just happened, that
we could afford to write the contract in Java.

> Service-oriented systems require governance of data types and
> semantics. I'm sure you've noticed that if you use the code-first
> approach, then Axis will generate a unique set of types and namespaces
> for your application. Proliferation of schema types will make reuse
> extremely challenging, resulting in reduced flexibility and agility,
> and a complete failure of a SOA initiative.


As we wrote separate interface layer, we could give (and we gave)
descriptive names and namespaces, not reflecting  the guts of our apps.
We just used java instead of wsdl to write interfaces to our apps.

J.K.


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


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

Posted by Anne Thomas Manes <at...@gmail.com>.
If your goal is point-to-point integration between a single client and
server, then the code-first development model is fine. But if your
goal is to implement a service-oriented system, enable reuse of
capabilities, reduce redundancy, and increase flexibility and agility,
then the code-first development model is a bad practice.

Service-oriented systems require governance of data types and
semantics. I'm sure you've noticed that if you use the code-first
approach, then Axis will generate a unique set of types and namespaces
for your application. Proliferation of schema types will make reuse
extremely challenging, resulting in reduced flexibility and agility,
and a complete failure of a SOA initiative.

Saving a little bit of time during development sometimes results in
massive longterm headaches.

Anne

On 6/12/07, Jarek Kucypera <jk...@mikrozet.wroc.pl> wrote:
> Anne Thomas Manes wrote:
>
> > I trust you recognize
> > the value of clean separation between your application object model
> > and a database data model and the DAO design pattern.
>
> Of course I do. My point is that I wanna write the interface layer
> of my system in Java, not int WSDL, of course for the price of not using
> all of the wsdl/schema/xml features.
> Actually we are doing it in our current project: we created
> core engine for the business logic and a separate,thin interface layer.
> The interface is simple enaugh to write it as a set of
> of beans and service classes whose only task is to translate params/
> results and call the core. Due to simplicity of the interface and the fact
> we don't need any of  additional ws features like addressing,
> reasonable POJO support just fits this scenario.
>
> > There is an impedance mismatch between XML data structures and Java
> > object models, just as there is an impedance mismatch between SQL data
> > models and Java object models. In many cases the mismatch is
> > insignificant, but it's a bad idea to assume that it doesn't exist.
> >
> Noone does assume that. And in those "many cases" it's worth to pay the
> price
> of simplicity to avoid diving into wsdl.
>
> > I agree that Axis2 could handle POJO deployment better, but even if it
> > were the best that it could be, I seriously doubt that it could handle
> > everything automatically.
>
> I don't  expect POJO to handle everything,.
> But reasonable propagation of exceptions is a minimum for it to be usable.
>
> J.K.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


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

Posted by Jarek Kucypera <jk...@mikrozet.wroc.pl>.
Anne Thomas Manes wrote:

> I trust you recognize
> the value of clean separation between your application object model
> and a database data model and the DAO design pattern. 

Of course I do. My point is that I wanna write the interface layer
of my system in Java, not int WSDL, of course for the price of not using
all of the wsdl/schema/xml features.
Actually we are doing it in our current project: we created
core engine for the business logic and a separate,thin interface layer.
The interface is simple enaugh to write it as a set of
of beans and service classes whose only task is to translate params/
results and call the core. Due to simplicity of the interface and the fact
we don't need any of  additional ws features like addressing,
reasonable POJO support just fits this scenario.

> There is an impedance mismatch between XML data structures and Java
> object models, just as there is an impedance mismatch between SQL data
> models and Java object models. In many cases the mismatch is
> insignificant, but it's a bad idea to assume that it doesn't exist.
>
Noone does assume that. And in those "many cases" it's worth to pay the 
price
of simplicity to avoid diving into wsdl.

> I agree that Axis2 could handle POJO deployment better, but even if it
> were the best that it could be, I seriously doubt that it could handle
> everything automatically.

I don't  expect POJO to handle everything,.
But reasonable propagation of exceptions is a minimum for it to be usable.

J.K.

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


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

Posted by Anne Thomas Manes <at...@gmail.com>.
I have to disagree with you -- at least if your goal is
interoperability. XML is the external interface to your service, and
it's a useful practice to maintain a clean separation of concern
between your interface and your implementation. I trust you recognize
the value of clean separation between your application object model
and a database data model and the DAO design pattern. The same
benefits exist when maintaining the separation between your externally
facing XML model and your internal object model.

There is an impedance mismatch between XML data structures and Java
object models, just as there is an impedance mismatch between SQL data
models and Java object models. In many cases the mismatch is
insignificant, but it's a bad idea to assume that it doesn't exist.

I agree that Axis2 could handle POJO deployment better, but even if it
were the best that it could be, I seriously doubt that it could handle
everything automatically.

Anne

On 5/25/07, Jarek Kucypera <jk...@mikrozet.wroc.pl> wrote:
> Dennis Sosnoski wrote:
>
> > 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.
>
> With all respect, xml here is the tool, not the purpose. I would like to
> expose my serwice without any knowlege of wsdl and xml and focus just on
> the bussiness logic, even for the price of not utilizng all the features
> of xml. Even with axis2 1.2 it's hardly possible.
>
> J.K.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


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

Posted by Jarek Kucypera <jk...@mikrozet.wroc.pl>.
Dennis Sosnoski wrote:

>  But generally the idea of deploying POJOs directly is a very limited 
> approach, at best only suitable for small applications, and if you're 
> doing anything substantial you're probably going to need to start 
> controlling the XML conversions at some point. 


No, why ? Do you really want to have detailed control over bytecode 
emitted by the java compiler you use ? Of course not, even when you work 
on large applications.
I think the analogy suits to pojo deployment. With sound pojo support I 
don't see necessity for digging in xml.

J.K.

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


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

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Jarek Kucypera wrote:
> Dennis Sosnoski wrote:
>
>> 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. 
>
> With all respect, xml here is the tool, not the purpose. I would like 
> to expose my serwice without any knowlege of wsdl and xml and focus 
> just on the bussiness logic, even for the price of not utilizng all 
> the features of xml. Even with axis2 1.2 it's hardly possible.

I understand your goal and I'm not unsympathetic. Certainly the POJO 
support in Axis2 could do a better job than it apparently does of 
handling some of these cases (such as the 0-length array example which 
was the topic of this thread). But generally the idea of deploying POJOs 
directly is a very limited approach, at best only suitable for small 
applications, and if you're doing anything substantial you're probably 
going to need to start controlling the XML conversions at some point. 
That's where either JiBX or JAXB 2.0 can help, since they both allow 
basically POJO objects to be converted to and from XML without the 
limitations of direct-from-POJO approaches.

If you're really determined to work directly with POJOs and don't care 
about the XML and WSDL, the original Axis may be a better alternative 
for you than Axis2. Axis supports the rpc/enc style which provides the 
best support for direct use of POJOs in web services. But note that 
you'll lose interoperability by going with rpc/enc, which pretty much 
defeats the whole idea of making something a web service. This style has 
been deprecated in newer frameworks largely due to the limitations, and 
Axis2 does not support rpc/enc at all.

  - 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


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

Posted by Jarek Kucypera <jk...@mikrozet.wroc.pl>.
Dennis Sosnoski wrote:

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

With all respect, xml here is the tool, not the purpose. I would like to 
expose my serwice without any knowlege of wsdl and xml and focus just on 
the bussiness logic, even for the price of not utilizng all the features 
of xml. Even with axis2 1.2 it's hardly possible.

J.K.

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


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

Posted by "John G. Norman" <jo...@7fff.com>.
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 <dm...@sosnoski.com> 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 <da...@gmail.com> 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 <jo...@7fff.com> 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 <da...@gmail.com> 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 < john@7fff.com> 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:
> >> > axis-user-unsubscribe@ws.apache.org
> >> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> >> > >
> >> > >
> >> >
> >> >
> >>
> >>
> >> --
> >> Davanum Srinivas :: http://davanum.wordpress.com
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-user-help@ws.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


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

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
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 <da...@gmail.com> 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 <jo...@7fff.com> 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 <da...@gmail.com> 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 < john@7fff.com> 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:
>> > axis-user-unsubscribe@ws.apache.org
>> > > For additional commands, e-mail: axis-user-help@ws.apache.org
>> > >
>> > >
>> >
>> >
>>
>>
>> -- 
>> Davanum Srinivas :: http://davanum.wordpress.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>

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


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

Posted by "John G. Norman" <jo...@7fff.com>.
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 <da...@gmail.com> 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 <jo...@7fff.com> 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 <da...@gmail.com> 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 < john@7fff.com> 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:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


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

Posted by "John G. Norman" <jo...@7fff.com>.
Here it is: https://issues.apache.org/jira/browse/AXIS2-2706

On 5/24/07, Davanum Srinivas <da...@gmail.com> wrote:
>
> Absolutely, please do log a JIRA.
>
> thanks,
> dims
>
> On 5/24/07, John G. Norman <jo...@7fff.com> 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:
> >
> > <xs:element name="getJobsLaunchedResponse">
> >     <xs:complexType>
> >     <xs:sequence>
> > <xs:element maxOccurs="unbounded" name="return" nillable="true"
> > type="ns:Job"/>
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> >
> > <wsdl:operation name="getJobsLaunched">
> > <wsdl:input message="axis2:getJobsLaunchedMessage"
> > wsaw:Action="urn:getJobsLaunched"/>
> > <wsdl:output message="axis2:getJobsLaunchedResponse"/>
> > <wsdl:fault message="axis2:getJobsLaunchedFault"
> > name="getJobsLaunchedFault"/>
> > </wsdl:operation>
> >
> > In the response that gets a client-side exception (exception trace
> below):
> >
> > <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> > xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/
> "><soapenv:Body><ns:getJobsLaunchedResponse
> > xmlns:ns="http://v00.services.exampleco.com/xsd"
> > /></soapenv:Body></soapenv:Envelope>
> >
> > An example of a good response:
> >
> > <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> > "><soapenv:Body><ns:getJobsLaunchedResponse
> > xmlns:ns="http://v00.services.exampleco.com/xsd"><ns:return><description
> > xmlns=" http://v00.services.exampleco.com/xsd">The
> > bottle-washer has many
> > responsibilities.</description><discontinued xmlns="
> > http://v00.services.exampleco.com/xsd">false</discontinued><fee
> > xmlns="http://v00.services.exampleco.com/xsd">300</fee><jid
> > xmlns="
> > http://v00.services.exampleco.com/xsd
> ">ZWEWprOZEZSCWLPndg4-vqD2xKI</jid><location
> > xmlns="http://v00.services.exampleco.com/xsd
> > ">Cambridge</location><name
> > xmlns="http://v00.services.exampleco.com/xsd
> ">bottle-washer</name><organization
> > xmlns="
> > http://v00.services.exampleco.com/xsd">exampleco.com
> </organization><payment
> > xmlns="http://v00.services.exampleco.com/xsd
> > ">5000</payment><reference
> > xmlns="http://v00.services.exampleco.com/xsd
> ">JOB-001</reference><referralId
> > xmlns="
> > http://v00.services.exampleco.com/xsd
> ">iQSF587mI9niSrA5E2C1kP4qTaQ</referralId></ns:return><ns:return><description
> > xmlns="http://v00.services.exampleco.com/xsd ">The
> > bottle-washer has many
> > responsibilities.</description><discontinued
> > xmlns="http://v00.services.exampleco.com/xsd">false</discontinued><fee
> > xmlns="
> > http://v00.services.exampleco.com/xsd">300</fee><jid
> > xmlns="http://v00.services.exampleco.com/xsd
> > ">gkQqnYvQ3wT48vbcWznqhds3Syo</jid><location
> > xmlns="http://v00.services.exampleco.com/xsd">Cambridge</location><name
> > xmlns="
> > http://v00.services.exampleco.com/xsd">bottle-washer</name><organization
> > xmlns="http://v00.services.exampleco.com/xsd">
> > exampleco.com</organization><payment
> > xmlns="http://v00.services.exampleco.com/xsd">5000</payment><reference
> > xmlns="
> > http://v00.services.exampleco.com/xsd">JOB-001</reference><referralId
> > xmlns="http://v00.services.exampleco.com/xsd
> ">f823FbOqFKoT7OrTNd238HO2lx0</referralId></ns:return></ns:getJobsLaunchedResponse></soapenv:Body></soapenv:Envelope>
> >
> >
> >
> > 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 <da...@gmail.com> 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 <jo...@7fff.com> 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 <davanum@gmail.com > 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 < john@7fff.com> 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:
> > > > axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Davanum Srinivas :: http://davanum.wordpress.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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

Posted by Davanum Srinivas <da...@gmail.com>.
Absolutely, please do log a JIRA.

thanks,
dims

On 5/24/07, John G. Norman <jo...@7fff.com> 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:
>
> <xs:element name="getJobsLaunchedResponse">
>     <xs:complexType>
>     <xs:sequence>
> <xs:element maxOccurs="unbounded" name="return" nillable="true"
> type="ns:Job"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> <wsdl:operation name="getJobsLaunched">
> <wsdl:input message="axis2:getJobsLaunchedMessage"
> wsaw:Action="urn:getJobsLaunched"/>
> <wsdl:output message="axis2:getJobsLaunchedResponse"/>
> <wsdl:fault message="axis2:getJobsLaunchedFault"
> name="getJobsLaunchedFault"/>
> </wsdl:operation>
>
> In the response that gets a client-side exception (exception trace below):
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getJobsLaunchedResponse
> xmlns:ns="http://v00.services.exampleco.com/xsd"
> /></soapenv:Body></soapenv:Envelope>
>
> An example of a good response:
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> "><soapenv:Body><ns:getJobsLaunchedResponse
> xmlns:ns="http://v00.services.exampleco.com/xsd"><ns:return><description
> xmlns=" http://v00.services.exampleco.com/xsd">The
> bottle-washer has many
> responsibilities.</description><discontinued xmlns="
> http://v00.services.exampleco.com/xsd">false</discontinued><fee
> xmlns="http://v00.services.exampleco.com/xsd">300</fee><jid
> xmlns="
> http://v00.services.exampleco.com/xsd">ZWEWprOZEZSCWLPndg4-vqD2xKI</jid><location
> xmlns="http://v00.services.exampleco.com/xsd
> ">Cambridge</location><name
> xmlns="http://v00.services.exampleco.com/xsd">bottle-washer</name><organization
> xmlns="
> http://v00.services.exampleco.com/xsd">exampleco.com</organization><payment
> xmlns="http://v00.services.exampleco.com/xsd
> ">5000</payment><reference
> xmlns="http://v00.services.exampleco.com/xsd">JOB-001</reference><referralId
> xmlns="
> http://v00.services.exampleco.com/xsd">iQSF587mI9niSrA5E2C1kP4qTaQ</referralId></ns:return><ns:return><description
> xmlns="http://v00.services.exampleco.com/xsd ">The
> bottle-washer has many
> responsibilities.</description><discontinued
> xmlns="http://v00.services.exampleco.com/xsd">false</discontinued><fee
> xmlns="
> http://v00.services.exampleco.com/xsd">300</fee><jid
> xmlns="http://v00.services.exampleco.com/xsd
> ">gkQqnYvQ3wT48vbcWznqhds3Syo</jid><location
> xmlns="http://v00.services.exampleco.com/xsd">Cambridge</location><name
> xmlns="
> http://v00.services.exampleco.com/xsd">bottle-washer</name><organization
> xmlns="http://v00.services.exampleco.com/xsd">
> exampleco.com</organization><payment
> xmlns="http://v00.services.exampleco.com/xsd">5000</payment><reference
> xmlns="
> http://v00.services.exampleco.com/xsd">JOB-001</reference><referralId
> xmlns="http://v00.services.exampleco.com/xsd">f823FbOqFKoT7OrTNd238HO2lx0</referralId></ns:return></ns:getJobsLaunchedResponse></soapenv:Body></soapenv:Envelope>
>
>
>
> 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 <da...@gmail.com> 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 <jo...@7fff.com> 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 <davanum@gmail.com > 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 < john@7fff.com> 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:
> > > axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> > >
> >
> >
> > --
> > Davanum Srinivas :: http://davanum.wordpress.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>


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

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


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

Posted by "John G. Norman" <jo...@7fff.com>.
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:

<xs:element name="getJobsLaunchedResponse">
    <xs:complexType>
    <xs:sequence>
<xs:element maxOccurs="unbounded" name="return" nillable="true"
type="ns:Job"/>
</xs:sequence>
</xs:complexType>
</xs:element>

<wsdl:operation name="getJobsLaunched">
<wsdl:input message="axis2:getJobsLaunchedMessage"
wsaw:Action="urn:getJobsLaunched"/>
<wsdl:output message="axis2:getJobsLaunchedResponse"/>
<wsdl:fault message="axis2:getJobsLaunchedFault"
name="getJobsLaunchedFault"/>
</wsdl:operation>

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

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getJobsLaunchedResponse
xmlns:ns="http://v00.services.exampleco.com/xsd"
/></soapenv:Body></soapenv:Envelope>

An example of a good response:

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:getJobsLaunchedResponse
xmlns:ns="http://v00.services.exampleco.com/xsd"><ns:return><description
xmlns="http://v00.services.exampleco.com/xsd">The bottle-washer has many
responsibilities.</description><discontinued xmlns="
http://v00.services.exampleco.com/xsd">false</discontinued><fee xmlns="
http://v00.services.exampleco.com/xsd">300</fee><jid xmlns="
http://v00.services.exampleco.com/xsd">ZWEWprOZEZSCWLPndg4-vqD2xKI</jid><location
xmlns="http://v00.services.exampleco.com/xsd">Cambridge</location><name
xmlns="http://v00.services.exampleco.com/xsd">bottle-washer</name><organization
xmlns="http://v00.services.exampleco.com/xsd">exampleco.com</organization><payment
xmlns="http://v00.services.exampleco.com/xsd">5000</payment><reference
xmlns="http://v00.services.exampleco.com/xsd">JOB-001</reference><referralId
xmlns="http://v00.services.exampleco.com/xsd">iQSF587mI9niSrA5E2C1kP4qTaQ</referralId></ns:return><ns:return><description
xmlns="http://v00.services.exampleco.com/xsd">The bottle-washer has many
responsibilities.</description><discontinued xmlns="
http://v00.services.exampleco.com/xsd">false</discontinued><fee xmlns="
http://v00.services.exampleco.com/xsd">300</fee><jid xmlns="
http://v00.services.exampleco.com/xsd">gkQqnYvQ3wT48vbcWznqhds3Syo</jid><location
xmlns="http://v00.services.exampleco.com/xsd">Cambridge</location><name
xmlns="http://v00.services.exampleco.com/xsd">bottle-washer</name><organization
xmlns="http://v00.services.exampleco.com/xsd">exampleco.com</organization><payment
xmlns="http://v00.services.exampleco.com/xsd">5000</payment><reference
xmlns="http://v00.services.exampleco.com/xsd">JOB-001</reference><referralId
xmlns="http://v00.services.exampleco.com/xsd
">f823FbOqFKoT7OrTNd238HO2lx0</referralId></ns:return></ns:getJobsLaunchedResponse></soapenv:Body></soapenv:Envelope>



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 <da...@gmail.com> 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 <jo...@7fff.com> 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 <da...@gmail.com> 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 < john@7fff.com> 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:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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

Posted by Davanum Srinivas <da...@gmail.com>.
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 <jo...@7fff.com> 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 <da...@gmail.com> 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 < john@7fff.com> 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:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>


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

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


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

Posted by "John G. Norman" <jo...@7fff.com>.
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 <da...@gmail.com> 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 <jo...@7fff.com> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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

Posted by Davanum Srinivas <da...@gmail.com>.
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 <jo...@7fff.com> 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org