Best way to add a function to an existing Axis 2 service

2009-05-01 Thread Richard Hu
Hi everyone,

 

This may be a silly question but what's the best way to add a function
to an existing Axis 2 service?  I wrote an Axis 2 service from scratch
that has over a 100 functions by first creating the WSDL and then
running WSDL2Java and implementing the business logic in the Skeleton
class.  Now I want to add a function.  If I add it to the WSDL and
re-run WSDL2Java, then at best, I'll have to copy and paste code from
the old Skeleton class to the new one, which is unwieldy.

 

What's the best way of adding a function to an existing Axis 2 service
that was written from scratch using WSDL2Java?

 

Thanks,

Richard



Schema generation error in POJO

2009-04-28 Thread Richard Hu
Hi everyone,

 

Is there any sort of explanation to the exceptions in deployment in Axis
2?  When I deploy a simple service in POJO, I get the following error:

 

ERROR [ServiceDeployer.java:96:deploy()] The PromoPlanner service, which
is not

valid, caused The following error occurred during schema generation: 7

org.apache.axis2.deployment.DeploymentException: The following error
occurred du

ring schema generation: 7

at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBui

lder.java:431)

at
org.apache.axis2.deployment.repository.util.ArchiveReader.buildServic

eGroup(ArchiveReader.java:102)

at
org.apache.axis2.deployment.repository.util.ArchiveReader.processServ

iceGroup(ArchiveReader.java:179)

at
org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.ja

va:81)

at
org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy

(DeploymentFileData.java:136)

at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngin

e.java:597)

at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoL

ist.java:144)

at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListe

ner.java:330)

at
org.apache.axis2.deployment.RepositoryListener.checkServices(Reposito

ryListener.java:227)

at
org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentE

ngine.java:131)

at
org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(War

BasedAxisConfigurator.java:284)

at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurat

ionContext(ConfigurationContextFactory.java:82)

at
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisSer

vlet.java:516)

at
org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436

)

at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.

java:1161)

at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:98

1)

at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex

t.java:4045)

at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4

351)

at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:791)

at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77

1)

at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)

 

at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav

a:920)

at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j

ava:883)

at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492

)

at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)

at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java

:311)

at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl

eSupport.java:117)

at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

 

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

 

at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443

)

at
org.apache.catalina.core.StandardService.start(StandardService.java:5

16)

at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710

)

at org.apache.catalina.startup.Catalina.start(Catalina.java:566)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:39)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Caused by: org.apache.axis2.deployment.DeploymentException: The
following error

occurred during schema generation: 7

at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBui

lder.java:394)

... 39 more

Caused by: java.lang.ArrayIndexOutOfBoundsException: 7

at
org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.process

Methods(DefaultSchemaGenerator.java:374)

at
org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.generat

eSchema(DefaultSchemaGenerator.java:280)

at
org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:537

)

at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBui

lder.java:386)

... 39 more

 

Why would schema generator have an array out of bounds exception when
generating a wsdl for a POJO deployment?

 

Thanks,

Richard

richard...@jda.c

[POJO] In only access problem

2009-04-22 Thread Richard Hu
Hi everyone,

 

I intermittently encounter this error on the client when I deploy a
simple POJO service on Axis 2.  The error is "ERROR
[AxisServlet.java:172:doPost()] An access occurred that is not valid."  

 

I am running the following code:

 

SimpleServiceStub service = new SimpleServiceStub
("http://localhost:8090/axis2/services/SimpleService/";);

service.login("rhu", "rhu");

 

It seems like Axis 2 is complaining that the operation is not valid or
it can't be found, but I've explicitly spelled out the operation in the
services.xml file as follows:

 





PromoPlanner POJO source





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"/>



SimpleService

http://www.w3.org/2004/08/wsdl/in-only";
/>



 

Does anyone have any advice or clues as to why this may be happening?
I've had it working intermittently but every so often it pops back up.

 

Thanks,

Richard

 

Here is the complete error: 

 

ERROR [AxisServlet.java:172:doPost()] An access occurred that is not
valid.

java.lang.UnsupportedOperationException: An access occurred that is not
valid.

at
org.apache.axis2.description.InOnlyAxisOperation.getMessage(InOnlyAxi

sOperation.java:109)

at
org.apache.axis2.util.MessageContextBuilder.createOutMessageContext(M

essageContextBuilder.java:190)

at
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusines

sLogic(AbstractInOutMessageReceiver.java:37)

at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe

ssageReceiver.java:100)

at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)

at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq

uest(HTTPTransportUtils.java:275)

at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1

33)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:290)

at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:206)

at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

alve.java:233)

at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextV

alve.java:175)

at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j

ava:128)

at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j

ava:102)

at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal

ve.java:109)

at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav

a:263)

at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java

:844)

at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce

ss(Http11Protocol.java:584)

at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44

7)

at java.lang.Thread.run(Thread.java:619)

 

 



[POJO] Conflicting WSDL files

2009-04-21 Thread Richard Hu
Hi everyone,

 

I successfully deployed a POJO service in Axis 2 but I'm running into a
small inconsistency that is causing an issue when I try to run the
client.  In order to generate the WSDL, I use the Java2WSDL utility that
comes with Axis 2 to create a file  that I then
place in "services\SimpleService\META-INF".  However, when I start up
Tomcat and then go to
"http://localhost:8080/axis2/services/SimpleService?wsdl, the wsdl is
different.

 

This inconsistency is causing an issue in the generation of the stub
since certain classes in the WSDL that is available through Tomcat do
not have all the correct fields visible.  

 

Does anyone know how POJO generates the WSDL that it displays or does
anyone know how to set the WSDL that POJO displays?

 

Thank you.

 

Richard Hu

richard...@jda.com



Location of constants

2009-02-26 Thread Richard Hu
Hi,

 

I'm looking for some constants that previously were accessible in Axis
and even earlier versions of Axis 2 and was wondering if anyone happen
to know where they are located in the new API or if they have been
renamed.  So far, I have been unable to find them.

 

Specifically, I am looking for Constants.MC_HOME_DIR and
MessageContext.AUTHUSER.

 

Also, how do I get the username and password from the message context in
Axis 2?  

 

Thanks,

Richard



RE: Bug in "Code Generator Wizard - Eclipse Plug-in"

2009-02-23 Thread Richard Hu
Put the stax jar in \plug-ins\\lib.

Also, I'm not sure changing the extension to jar is the right solution.
It's probably better to just download the jar from findjar.com.  This is
the link I used:
http://mirrors.ibiblio.org/pub/mirrors/maven/stax/jars/stax-api-1.0.1.ja
r




-Original Message-
From: Car Toper [mailto:carto...@gmail.com] 
Sent: Monday, February 23, 2009 9:18 PM
To: axis-user@ws.apache.org
Subject: Re: Bug in "Code Generator Wizard - Eclipse Plug-in"

2009/2/23 TomazM :
> Look hare for solution:
>
>
http://blogiterox.wordpress.com/2008/10/24/exploring-apache-axis2-and-ec
lipse-plug-in-development/

Yep,  That is the bug!  I don't follow the fix, exactly.  Partly due
to the fact that Java is not my primary language, I am a C/C++
developer for the most part.  The link said:

"This lead to stax-api-1.0.1.jar. I downloaded this jar file and added
it to the \lib directory of the plug-in residing in the dropins
directory of your Eclipse installation."

When I look in the dropins folder under the eclipse folder, it is
empty.  Where should I be putting stax-api-1.0.1.jar?  (Also what I
downloaded is stax-api-1.0.1.zip, I am assuming that I simply need to
change the extention to jar, correct?)

Cartoper


RE: Axis2 Code Generator Problem

2009-02-23 Thread Richard Hu
This is a known bug.  Here is the solution with explanation:
http://blogiterox.wordpress.com/2008/10/24/exploring-apache-axis2-and-ec
lipse-plug-in-development/

 

Solution: Copy the jar for stax and for backport to the plug-in
directory (\plug-ins\\lib) and then add
the backport jar to the plugin.xml file.

 



From: Michael [mailto:mtarullo...@optonline.net] 
Sent: Monday, February 23, 2009 9:10 PM
To: axis-user@ws.apache.org
Subject: Axis2 Code Generator Problem

 

I'm developing a bottom up web service and now that I have got it
working using the code I developed and the client stub generated when I
created the web service from Eclipse I now want to create a WSDL file.

 

When I launch the Axis2 Code Generator (v1.3.0) Wizard, enter the fully
qualified class name and the location of the class file and then select
the button to test loading the class I keep getting a
java.lang.ClassNotFoundException.

 

Is this a bug or am I doing something wrong?



[Axis2] Generated stubs and locator class

2009-02-21 Thread Richard Hu
Hi everyone,

 

I'm trying to migrate a client side application from Axis to Axis 2.
The application also supports connection through RMI so previously, we
abstracted away the connection by using the stub and the locator file.
For example, we did something like the following:

 

AddFunctionLocator locator = new AddFunctionLocator ();

 

AddFunction api = (AddFunctionSoapBindingStub) locator.getAddFunction()

 

api.addInt(5, 3);

 

And this worked because the locator class would return the stub class,
which in addition to extending org.apache.axis.client.Stub, also
implemented the AddFunction interface class.  

 

However, in Axis 2, using WSDL2Java, I cannot figure out if this
arrangement is possible since neither the locator class is generated nor
does the Stub class implement the original AddFunction interface class.
Does anyone have any advice on either the proper options to use with
WSDL2Java or another way that I implement so I can keep this abstraction
in our client code?

 

Thanks,

Richard

richard...@jda.com



How to prevent WSDL2Java from creating java.io.IOException

2009-02-03 Thread Richard Hu
Hi,

 

Is there a way to prevent WSDL2Java from creating its own version of
java.io.IOException and other basic exceptions?  It creates these basic
java exception classes but they don't implement java.lang.Throwable so
they aren't valid exceptions.  

 

Thanks,

Richard

richard...@jda.com



[Axis2] Specifying files generated by WSDL2Java

2009-02-02 Thread Richard Hu
To Whom It May Concern:

 

I'm upgrading from Axis to Axis 2 and previously in Axis, we were able
to use WSDL2Java to create client stubs for just the data types that
were either parameters or return types of functions from the web
service's primary class.  In Axis 2, the WSDL2Java command-line tool
does not seem to allow this.  Whenever it generates the client stubs for
the data types, it also creates stubs for the function calls as well.
Is this expected?

 

Thanks,

Richard Hu

richard...@jda.com