On Fri, Jan 27, 2012 at 4:10 PM, Lucio Crusca <lu...@sulweb.org> wrote:

> Hello *,
>
> I'm trying to generate client code for a webservice with wsdl2java.
> Unfortunately I'm not allowd to post the wsdl file here nor the service
> address, but I'll try to describe the problem.
>
> The webservice is running zend framework. The generated WSDL file is
> correctly
> understood by wsdl2java, using ADB. However the generated code raises an
> exception when run:
>
> Exception in thread "main" org.apache.axis2.AxisFault:
> org.apache.axis2.databinding.ADBException: Unexpected subelement return
>
> Googling that error I've found this:
>
> http://blog.mpathirage.com/2009/08/04/reasons-for-unexpected-subelement-
> exception-in-axis2-data-bindingadb/<http://blog.mpathirage.com/2009/08/04/reasons-for-unexpected-subelement-%0Aexception-in-axis2-data-bindingadb/>
>
> and I think I've pinned the problem down to the lack of the minOccurs
> attribute in the WSDL.
>
> My customer (which is the web service provider), has proposed, as
> solution, to
> use "-d none" in the wsdl2java invocation and, consequently, to call the
> webservice by handwriting java code that uses Axiom classes
> OMAbstractFactory,
> OMElement, OMNamespace, OMAttribute,...
>
> Since I managed to use axis in the past and never needed to handwrite such
> binding code, but I'm not an axis expert by any means, I ask for your
> opinions
> so that I get a feel about what's common sense while using axis. My
> question
> is wether my customer proposed solution can be regarded, on average, as a
> reasonable one or not.


That can be a valid option to me. BTW from Axis2 1.7.0 onwards you can
instruct ADB to ignore unexpected element in client side by using "-Eiu"
open. You can provide "-Eiu" option to WSDL2JAVA tool. At the moment there
is no proper documentation but HTH [1]  you can test this behavior using
Axis2 1.7.0-SNAPSHOT versions.

[1] - https://issues.apache.org/jira/browse/AXIS2-4859

Thanks !




> How often does it happen that the best solution is to
> use "-d none" and write binding code by hand? How often are you forced to
> use
> "-d none" if the wsdl file is correct? Most important: is it reasonable to
> sell
> such solution to a third party under the name "demo axis2 client"?
>
> Thanks in advance for your opinions.
> Lucio.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
> For additional commands, e-mail: java-user-h...@axis.apache.org
>
>


-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara

Reply via email to