purushottaman dwarkanathan

Greenhorn
+ Follow
since Apr 26, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by purushottaman dwarkanathan

Go for Struts in Action by Ted Husted thats the best book to start off
Hi,

ESB is primarily used for integration of heterogenous applications. It is more like an integration infrastructure.

An ESB supports governance, message translation, routing. It incorporates the JBI (the java business integration spec)


ESB is a key feature of the SOA stack. Where you have rich UI communicating to web services, you have a BPEL engine for orchestrating the web services. The message routing and translation between the source and the target application will be handled by the ESB.

mule is a good open source ESB. You can check out the site mule.org to download and work on samples.

check out this link it will be helpful

http://www.oracle.com/technology/tech/soa/mastering-soa-series/index.html

Purushottaman
16 years ago
Hi,

If you have used ant to generate the artifacts and the deployment process, check your build.xml , where you are using the deploy task. You will be able to include a variable to get the system path for recognizing the automatic deployment
16 years ago
check out this site

www.xmethods.net -- This site has some published web services. In order to call a web service, you need to have the URL of the wsdl. This wsdl will be tied up with a key in the UDDI.

You will be able to know some sample keys and the URL's from the xmethods.net
16 years ago
I had done a sample web service project in eclipse europa with the glassfish server integrated. This program invokes a web service via Java

Since it is using the new spec JAX-WS and not the AXIS java2WSDL and WSDL2Java conversion, the implementation is slightly different.

Since, it seems that you have been able to deploy and run the project, your main concern was about generating the artifacts from the eclipse.

Here are a few suggestions, which will assist you...

You need to write a build file. Open it from the ant view in eclipse .

goto menu window ---> show view --other --ANT

Run the tasks and the wsimport and wsgen will run and place the files in the respective folders.

I am pasting a sample build file, you can modify that according to your needs

My src directory name is fromjava.

This is how my deploy-targets.xml looks like

<project>
<property environment="env"/>

<property name="as.home" value="${env.AS_HOME}"/>
<property name="lib.home" value="${env.JAXWS_HOME}/lib"/>
<property name="lib.sample.home" value="${basedir}/../lib"/>
<property name="build.home" value="${basedir}/build"/>
<property name="build.war.home" value="${build.home}/war"/>
<property name="build.classes.home" value="${build.home}/classes"/>

<property name="domain" value="domain1"/>

<target name="deploy" depends="deploy-tomcat, deploy-appserver"/>

<target name="deploy-appserver" unless="tomcat">
<copy file="${build.war.home}/jaxws-${ant.project.name}.war"
todir="${as.home}/domains/${domain}/autodeploy"/>
</target>

<target name="deploy-tomcat" if="tomcat">
<copy file="${build.war.home}/jaxws-${ant.project.name}.war"
todir="${env.CATALINA_HOME}/webapps"/>
</target>
</project>

THis is the build.xml file

<?xml version="1.0" encoding="UTF-8"?>

<project basedir="." default="help" name="fromjava">

<import file="etc/deploy-targets.xml"/>

<path id="jaxws.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<pathelement location="${lib.sample.home}/jaxwsSampleUtils.jar"/>
<fileset dir="${lib.home}">
<include name="*.jar"/>
<exclude name="j2ee.jar"/>
</fileset>
</path>


<taskdef name="apt" classname="com.sun.tools.ws.ant.Apt">
<classpath refid="jaxws.classpath"/>
</taskdef>

<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
<classpath refid="jaxws.classpath"/>
</taskdef>


<target name="setup">
<mkdir dir="${build.home}"/>
<mkdir dir="${build.classes.home}"/>
<mkdir dir="${build.war.home}"/>
</target>

<target name="build-server-java" depends="setup">
<apt
fork="true"
debug="true"
verbose="${verbose}"
destdir="${build.classes.home}"
sourcedestdir="${build.classes.home}"
sourcepath="${basedir}/src">
<classpath>
<path refid="jaxws.classpath"/>
<pathelement location="${basedir}/src"/>
</classpath>
<option key="r" value="${build.home}"/>
<source dir="${basedir}/src">
<include name="**/server/*.java"/>
<include name="**/common/*.java"/>
</source>
</apt>
<!-- copy handlers descriptor file -->
<copy todir="${build.classes.home}">
<fileset dir="${basedir}/src">
<include name="**/server/**/*.xml"/>
</fileset>
</copy>
</target>

<target name="clean">
<delete dir="${build.home}" includeEmptyDirs="true"/>
</target>

<target name="create-war">
<war warfile="${build.war.home}/jaxws-${ant.project.name}.war" webxml="etc/web.xml">
<webinf dir="${basedir}/etc" includes="sun-jaxws.xml"/>
<zipfileset
dir="${basedir}/etc"
includes="*.wsdl, *.xsd"
prefix="WEB-INF/wsdl"/>
<classes dir="${build.classes.home}"/>
</war>
</target>

<target name="generate-client" depends="setup">
<wsimport
debug="true"
verbose="${verbose}"
keep="true"
destdir="${build.classes.home}"
package="fromjava.client"
wsdl="http://localhost:8080/jaxws-fromjava/addnumbers?wsdl">
</wsimport>
</target>

<target name="client" depends="generate-client">
<javac
fork="true"
srcdir="${basedir}/src"
destdir="${build.classes.home}"
includes="**/client/**,**/common/**">
<classpath refid="jaxws.classpath"/>
</javac>
</target>

<target name="run">
<java fork="true" classname="fromjava.client.AddNumbersClient">
<classpath>
<path refid="jaxws.classpath"/>
<pathelement location="${build.classes.home}"/>
<pathelement location="${basedir}/etc"/>
</classpath>
</java>
</target>

<target name="help">
<echo message="server: Builds and deploy the service endpoint WAR"/>
<echo message="client: Builds the client"/>
<echo message="run: Runs the client"/>
<echo message="server-j2se: Builds and deploy the Endpoint API based service"/>
<echo message="server-j2se-stop: Stops Endpoint API based service"/>

</target>

<target name="server" depends="setup">

<antcall target="clean"/>

<antcall target="build-server-java"/>

<antcall target="create-war"/>

<antcall target="deploy"/>
</target>

<target name="server-j2se" depends="setup">
<antcall target="clean"/>

<antcall target="build-server-java"/>

<echo message="Starting endpoint... To stop: ant server-j2se-stop "/>

<java fork="true" classname="fromjava.server.AddWebservice">
<classpath>
<path refid="jaxws.classpath"/>
<pathelement location="${build.classes.home}"/>
</classpath>
</java>
</target>

<target name="server-j2se-stop" depends="setup">
<get src="http://localhost:9090/stop" dest="stop.status"/>
</target>



</project>

You also need to have the following files

This is the sun-jaxws.xml

<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0'>
<endpoint
name='fromjava'
implementation='fromjava.server.AddNumbersImpl'
url-pattern='/addnumbers'/>
</endpoints>

This is the web.xml file

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<description>fromjava</description>
<display-name>fromjava</display-name>
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
<description>JAX-WS endpoint - fromjava</description>
<display-name>fromjava</display-name>
<servlet-name>fromjava</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>fromjava</servlet-name>
<url-pattern>/addnumbers</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>
For EJB 3 , you can download this book from this location

http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss by Ed Roman. You can also refer to Articles on onjava.com which gives extensive overview on the same.
you can use the service locator design pattern to get a handle to remote service, which you would have binded with the JNDI name. Once you get a handle to the proxy, you will be able to call all the business methods.
html ptions can take a java collection as an input for example a hash map, where as for the html ption you can do it with a java bean.
16 years ago
The action form will contain the bean representation of the form that you have submitted for processing. Check whether the object type you are trying to access, is explicitly put in the request or not.
16 years ago
nothing much difference between an action error and an action message. The action error has been deprecated after 1.1. From 1.2 onwards its advised to use the action message.
16 years ago
validation.xml will take care of the validation for common fields that can appear in a form and also based on the data types that is involved.

Normally since we are going for DynaActionForms these days, we do not need any implementation of the validate method.
16 years ago
action classes are basically the controller in the MVC.

They will delegate to the respective action class which will render the JSP or the action class which will handle the request action.

The LookUp dispatch action is more suited for the event based actions. Basically if you have buttons on your screen, it can do the conditional navigation based on the action performed.
16 years ago
ideally i think that you should have all the server side errors logged on top of the page, instead of showing it below each and every field.

When ever you build up errors using the action messages, you can have tiles configured to include a errorPage to get it invoked.
16 years ago
Hi All,

I was able to solve this issue.. I did a search based on the sAMAccountName and listed the attributes I was searching for.

I was able to successfully fetch all the information of the

a sample snippet:

//the attribute id to fetch
String[] attributeIDs = {"member"};
//create an instance of the search control
SearchControls ctls = new SearchControls();
//set the attribute id to be expected in the result
ctls.setReturningAttributes(attributeIDs);
//set the search scope to all the levels below the base entry
ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
// filter sAMAccountName corresponds to the CN name ITDevelopment
String filter = "(&(sAMAccountName=ITDevelopment)( objectclass=group))";
//gives a handle to the naming enumeration of the directory structure
NamingEnumeration contentsEnum = context.search("", filter, ctls);

Thought this will be helpful for other members, if such a situation arises.
Hi All,

I have an issue searching the following directory structure
dc = corsolutions
|
|
|
ou =groups
|
|
below groups we have the following three groups
1.Distribution Groups
2.RemoteForward
3. Security Groups - ACL

I am interested in this particular group
ou - Security Groups - ACL
|
|
CN = ITDevelopment
|
|
below this contained name we have the following attributes
objectclass =group
member = CN=Miller\Scott,OU=Information Technology etc

when i search in this specific fashion

String[] attrIDs = {"member"};
SearchControls ctls = new SearchControls();
ctls.setReturningAttributes(attrIDs);
ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);


String filter = "(&(cn=ITDevelopment,ou=groups, ou=Security Groups - ACL ")(objectClass=group))";


NamingEnumeration answer = ctx.search("dc=corsolutions,dc=com", filter, ctls);

I am getting the name not found exception for this group

Security Groups - ACL

however if i just list till the group level in this fashion
context.list("ou=groups");

I am able to see all the groups below it

1.Distribution Groups
2.RemoteForward
3. Security Groups - ACL

Kindly give some suggestions. I think it is not able to resolve the spaces existing in the groups.