You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Douglas Bitting <Do...@agile.com> on 2002/10/18 22:46:56 UTC

WSDL2Java patch...

Hi.

I put together my own GeneratorFactory to use with WSDL2Java.  However, I simply wanted to subclass JavaGeneratorFactory, which wasn't working since
the current behavior calls the noarg constructor.  This patch ensures that custom GeneratorFactories are initialized with an Emitter if they have a
constructor which accepts and Emitter.

If need be, I'll post this patch to Bugzilla, but figured I'd start here.  See below for patch...

Cheers,
--Doug

Doug Bitting
Agile Software
1 Almaden Blvd
San Jose, CA  95113
(408) 999-7120

---- snip here ----
Index: wsdl/toJava/Emitter.java
===================================================================
RCS file: /home/cvspublic/xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
retrieving revision 1.50
diff -r1.50 Emitter.java
60a61,62
> import java.lang.reflect.Constructor;
> 
285,286c287,299
<             setFactory((GeneratorFactory)
<                        ClassUtils.forName(factory).newInstance());
---
>             Class clazz = ClassUtils.forName(factory);
>             GeneratorFactory genFac = null;
> 
>             try {
>                 Constructor ctor = 
>                     clazz.getConstructor(new Class[] { getClass() });
>                 genFac = (GeneratorFactory) 
>                     ctor.newInstance(new Object[] { this });
>             } catch (NoSuchMethodException ex) {
>                 genFac = (GeneratorFactory) clazz.newInstance();
>             }
> 
>             setFactory(genFac);


RE: WSDL2Java patch...

Posted by Marios Karagiannopoulos <mk...@teiath.gr>.
Dear Davanum,
	I just saw you are the author of JSSESocketFactory class.
Where can I find an example of using this class? The documentation
of Axis doesn't help at all.

Thanks
Marios


Re: WSDL2Java patch...

Posted by Davanum Srinivas <di...@yahoo.com>.
Doug,

Please post this to bugzilla.

Thanks,
dims

--- Douglas Bitting <Do...@agile.com> wrote:
> Hi.
> 
> I put together my own GeneratorFactory to use with WSDL2Java.  However, I simply wanted to
> subclass JavaGeneratorFactory, which wasn't working since
> the current behavior calls the noarg constructor.  This patch ensures that custom
> GeneratorFactories are initialized with an Emitter if they have a
> constructor which accepts and Emitter.
> 
> If need be, I'll post this patch to Bugzilla, but figured I'd start here.  See below for
> patch...
> 
> Cheers,
> --Doug
> 
> Doug Bitting
> Agile Software
> 1 Almaden Blvd
> San Jose, CA  95113
> (408) 999-7120
> 
> ---- snip here ----
> Index: wsdl/toJava/Emitter.java
> ===================================================================
> RCS file: /home/cvspublic/xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
> retrieving revision 1.50
> diff -r1.50 Emitter.java
> 60a61,62
> > import java.lang.reflect.Constructor;
> > 
> 285,286c287,299
> <             setFactory((GeneratorFactory)
> <                        ClassUtils.forName(factory).newInstance());
> ---
> >             Class clazz = ClassUtils.forName(factory);
> >             GeneratorFactory genFac = null;
> > 
> >             try {
> >                 Constructor ctor = 
> >                     clazz.getConstructor(new Class[] { getClass() });
> >                 genFac = (GeneratorFactory) 
> >                     ctor.newInstance(new Object[] { this });
> >             } catch (NoSuchMethodException ex) {
> >                 genFac = (GeneratorFactory) clazz.newInstance();
> >             }
> > 
> >             setFactory(genFac);
> 


=====
Davanum Srinivas - http://xml.apache.org/~dims/

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

JSSESocketFactory example???

Posted by Marios Karagiannopoulos <mk...@teiath.gr>.
Where can I get a JSSESocketFactory example? I need to send 
SOAP calls to a gSOAP server over SSL !!!

Thanks
Marios