axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hehl, Thomas" <Thomas.H...@acs-inc.com>
Subject RE: I don't get it
Date Thu, 13 May 2010 13:33:56 GMT
I want all application to share the same resources, especially the database connection pool.
That's why we're having our server side controller go through the web service.

 

Please advise if you can recommend a better way. This is a relatively new experience for me.

 

________________________________

From: Caristi, Joe [mailto:jcaristi@whisolutions.com] 
Sent: Thursday, May 13, 2010 9:21 AM
To: java-user@axis.apache.org
Subject: RE: I don't get it

 

Wsdl2Java does seem to still have an ANT task (we're not using it yet):  http://ws.apache.org/axis2/tools/1_2/CodegenToolReference.html#ant

 

Wsdl2Java can generate both server and client side code.  We use both.  Here is a good explanation
of the options:  http://wso2.org/library/tutorials/reference-guide-axis2-code-generation-parameters-part-1.
 Note that in both cases for us it is a combination of JiBX generated classes (since we started
with WSDL) and Wsdl2Java generated classes (callback handler, message receiver, endpoint stubs,
service class shell).  In order to understand this, you should run through a couple of simple
tutorials.

 

I'm not sure why you want to have your server-side controller call your web-service.  We have
the following layers:

 

Service ->  Business -> Persistence

 

Our service class receives the request, delegates to a Business Façade and creates the response.
 The Business Façade contains all the business logic and does all the work by orchestrating
persistence classes, etc.

________________________________

From: Hehl, Thomas [mailto:Thomas.Hehl@acs-inc.com] 
Sent: Thursday, May 13, 2010 8:41 AM
To: java-user@axis.apache.org
Subject: RE: I don't get it

 

Sorry, had to pull aside to take care of critical issues.

 

OK, it sounds like JiBX will work for us too. So let's talk this through.

 

We have a web 2.0 application that we now need to provide functionality to voice response,
kiosks, other applications, etc. Heterogeneous clients needing access to my webapp led me
to select SOAP as a candidate.

 

We have a standalone webapp backed by a database over JDBC/Hibernate. We have separate jars
for model, data access and services to provide separation between services and controller,
so I thought I could use Axis2 to generate WSDLs from my existing services API that each of
the client apps could use, then want to build client java code from the WSDLs so that my controllers
can use them too.

 

I have modified my ant build to create the WSDL files using the Java2WSDL task and that appears
to be working fine. Now I need to turn the WSDLs into client code so my servlet/controller
can access it. This is the part I'm having a hard time getting my head around.

 

It looks like:

 

1)       WSDL2Java no longer has an ant task

2)       You're not using WSDL2Java below to build your client.

 

Are these true?

 

 

________________________________

From: Caristi, Joe [mailto:jcaristi@whisolutions.com] 
Sent: Thursday, May 06, 2010 9:28 AM
To: java-user@axis.apache.org
Subject: RE: I don't get it

 

With JiBX, Axis2 can't do everything that needs to be done.  You either have to create a binding
file yourself, or you can use JiBX CodeGen to do it for you.  Here's the link to the CodeGen
page: http://jibx.sourceforge.net/fromschema/codegen.html.  There is also one more step, which
is the binding compiler.  This adds the marshalling code to the Java classes (using the binding
file).  Here's a link:  http://jibx.sourceforge.net/bindcomp.html

 

Here is how we do it:

 

1.	We started with WSDL. 
2.	We use JiBX CodeGen to generate the binding and Java files (if you want to keep your original
Java files, you would write the binding manually).  We do this every time our WSDL changes.

3.	We set up our Eclipse development environment to run the binding compiler automatically,
using Maven: 

 

                  <plugin>

                        <groupId>org.jibx</groupId>

                        <artifactId>maven-jibx-plugin</artifactId>

                        <version>1.2.1</version>

                        <configuration>

                              <directory>src/main/config</directory>

                              <includes>

                                    <includes>*binding.xml</includes>

                              </includes>

                              <verbose>false</verbose>

                        </configuration>

                        <executions>

                              <execution>

                                    <phase>process-classes</phase>

                                    <goals>

                                          <goal>bind</goal>

                                    </goals>

                              </execution>

                        </executions>

                  </plugin>

 

 

4.	We run wsdl2java, pointing to the binding file that was produced by CodeGen.  We only do
this when a WSDL change would affect Axis2, such as a new operation. 

 

Here is a link to two tutorials that provide a good overview of the process:  http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=jibx+1.2

________________________________

From: Hehl, Thomas [mailto:Thomas.Hehl@acs-inc.com] 
Sent: Thursday, May 06, 2010 8:20 AM
To: java-user@axis.apache.org
Subject: RE: I don't get it

 

Thanks for your help, Joe.

 

I have run the following command against my WSDL:

 

D:\agile\repository\wsdl>d:\javatools\axis2-1.5.1\bin\wsdl2java -d jibx -s -uri .\ValidationCodeService.wsdl

Using AXIS2_HOME:   D:\javatools\axis2-1.5.1

Using JAVA_HOME:    d:\java\jdk

Retrieving document at '.\ValidationCodeService.wsdl'.

Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException

: java.lang.RuntimeException: JiBX wrapped support requires a binding definition

 to be provided using the -Ebindingfile {file-path} parameter

        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener

ationEngine.java:271)

        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)

Caused by: java.lang.RuntimeException: JiBX wrapped support requires a binding d

efinition to be provided using the -Ebindingfile {file-path} parameter

        at org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtil

ity.java:233)

        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.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExte

nsion.java:77)

        at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGener

ationEngine.java:224)

        ... 2 more

 

It appears to want a binding document. I read the article that you sent me and the section
of the Axis manual and found references to binding document, but no examples of how one looks.
Can you help?

 

Thanks!

 

________________________________

From: Caristi, Joe [mailto:jcaristi@whisolutions.com] 
Sent: Wednesday, May 05, 2010 11:05 AM
To: java-user@axis.apache.org
Subject: RE: I don't get it

 

The missing piece is that somehow Axis2 needs to be able to translate between XML (the Soap
or Rest message on the wire) and Java classes (in your application).   This is known as data
binding, and consists of code to marshall and unmarshall the XML data.  This code usually
gets generated (in one way or another) and needs to be incorporated into your application.

 

Look at this article, which explains the three available choices in detail: http://www.ibm.com/developerworks/webservices/library/ws-java3/.
 The summary at the end of the article is a good starting point for making a choice between
the frameworks.  We have had great success with JiBX.  We originally used ADB, but switched
to JiBX for performance and flexibility.

________________________________

From: Hehl, Thomas [mailto:Thomas.Hehl@acs-inc.com] 
Sent: Wednesday, May 05, 2010 10:27 AM
To: java-user@axis.apache.org
Subject: I don't get it

 

OK, I've used Axis once before briefly and now I'm trying to use Axis2. The problem I'm having
is that the documents don't appear to be written for me. I need some advice on how to proceed.

 

My situation is that after building a web application, it turns out that we need to have heterogeneous
clients accessing our application. No problem, I thought, because I created a services layer
behind the controller. I can use axis2 to generate a WSDL for my services layer and expose
the API that way to the other clients that need to access it and our controllers as well.


 

My intent had been simply to run java2wsdl on the classes in my services jar, then wsdl2java
on the resulting wsdl to build the client. Then I'd patch these pieces together and let the
web services do the communication.

 

As I'm reading through the documentation, though, it talks a lot about ADB and JiBX and AXIOM
and XML beans, but doesn't appear to explain any of them. Evidently, I'm supposed to know
which of these I'm using before selecting Axis2 as a tool.

 

So now I'm sort of stuck. Will someone kindly take a moment and shine a little light, please?

 

Thom Hehl

Senior Development Specialist

Public Safety & Justice

Affiliated Computer Services, Inc.

A Xerox Company

1733 Harrodsburg Road

Lexington, KY 40504-3617

Tel 859.277.8800 x 144

Fax 859.277.2300

 

 

________________________________

STATEMENT OF CONFIDENTIALITY:



The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify WHI Solutions immediately at gc@whisolutions.com,
and destroy all copies of this message and any attachments.

 

________________________________

STATEMENT OF CONFIDENTIALITY:



The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify WHI Solutions immediately at gc@whisolutions.com,
and destroy all copies of this message and any attachments.

 

________________________________

STATEMENT OF CONFIDENTIALITY:



The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain confidential or privileged information. If you are not the intended
recipient, please notify WHI Solutions immediately at gc@whisolutions.com,
and destroy all copies of this message and any attachments.


Mime
View raw message