I had gone through lost of taturial about how to configure axis1 or axis2 then add your projetcs to Axisp.but there is no taturial that tells about “how to add Axis1 into running projetc” instead of adding projetc to Axis..so i have made this short taturial for it..its v simple

Simply follow these smal steps..

1-Downlaod Axis1.*  and put somewhere in your computer.

2-copy all jar files from Axis lib folder to your application lib folder(fir example in my case its HOMEPATH/axis-1_4\lib, the real Path is     D:\axis-1_4\lib)

3-copy All servcila mappings from web.xml of Axis1.4(D:\axis-1_4\webapps\axis\WEB-INF\web.xl) to your projetc web.xml

4-set Folwing path in your seysetn Enviorment Veriables.

AXIS_HOME=D:\axis-1_4

AXIS_LIB=%AXIS_HOME%\lib

AXISCLASSPATH=%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery-0.2.jar;%AXIS_LIB%\commons-logging-1.0.4.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\xml-apis.jar;%AXIS_LIB%\xercesImpl.jar

5-Then Simple open command prompt and us any of follwing command to depoly the web servcie

 

java -cp %AXISCLASSPATH% org.apache.axis.client.AdminClient -1http://localhost:8081/HyperCupSample/servlet/AxisServlet deploy.wsdd

or

D:\axis-1_4\lib>java -cp activation.jar:axis-ant.jar:axis.jar:axis-schema.jar:commons-discovery-0.2.jar:commons-logging-1.0.4.jar:jaxrpc.jar:log4j-1.2.8.jar:saaj.jar:wsdl4j-1.5.1.jar:. org.apache.axis.client.AdminClient -1http://localhost:8080/HyperCupSample/servlet/AxisServlet deploy.wsdd

 

Enjoyyyyyyyyyyyyyy!!!!

if you find some problem then simply email me and if your like this short taturail then please comment something.thanks

i have used this javascript calendare on my web pag..its good

check this link to follow

http://ui.jquery.com/repository/latest/demos/functional/#ui.datepicker

http://docs.jquery.com/UI/Datepicker

if you want to get path where calss is located ..here is code

URL url =getClass().getProtectionDomain().getCodeSource().getLocation();

hop its helpfull

write here if you feel its helpful

cherrrrrrrrrrzzzzzzzzzzzzz

How to add veriable/enviorment variabls in web application.these are the variable you can access anywhere in project

here is solution

addfollwing tag to web xm…and given values of your own choics

<env-entry>
    <env-entry-name>webmasterEmail</env-entry-name>
    <env-entry-value>admin@domain.com</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

you can access in a code by this

// Get a handle to the JNDI environment naming context
Context env = (Context)new InitialContext().lookup("java:comp/env");
// Get a single value
String webmasterEmail = (String)env.lookup("webmasterEmail");

thats It ...enjoyyyyyyyy

here is the helping uRL

http://wiki.metawerx.net/wiki/Web.xml.EnvEntry

comment here if it is useful for you ;) 

Q:how take server(tomcat, Jboss)context path for any work e:g file upload.

A:here is the solution
make a class of any name and implements ServletContextListener(its servlet calss)

write body of contextInitialized(ServletContextEvent event) method

like this

public void contextInitialized(ServletContextEvent event) {

yourUtilitiesClass.FILES_PATH = event.getServletContext().getRealPath(””) + File.separator + “files” + File.separator;
yourUtilitiesClass.IMAGES_FILES_PATH = event.getServletContext().getRealPath(””) + File.separator + “images” + File.separator;
yourUtilitiesClass.MY_RATES_XML_PATH = event.getServletContext().getRealPath(””) + File.separator + “flash” + File.separator;
}

add follwing tag in the web.xml of you web application and give your class name in the listener-class tag (that you write above)

<listener>
<listener-class>com.myproject.portal.utilities.ContextListener</listener-class>
</listener>

now what happend
on every event on your web application server.xml call the listen and set the paths in your static(calss level) variable so you can use any where in the project.

this is the sample calss

import java.io.File;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ContextListener implements ServletContextListener {

public ContextListener() {
super();
}

public void contextInitialized(ServletContextEvent event) {
yourUtilities.FILES_PATH = event.getServletContext().getRealPath(“”) + File.separator + “files” + File.separator;
yourUtilities.IMAGES_FILES_PATH = event.getServletContext().getRealPath(“”) + File.separator + “images” + File.separator;
yourUtilities.VOPIUM_RATES_XML_PATH = event.getServletContext().getRealPath(“”) + File.separator + “flash” + File.separator;
}

public void contextDestroyed(ServletContextEvent event) {

}

}

cheeerrrrrrrrs!!!

1.create your own context.xml file and put in Yourapp/META-INF/ location

its contents should be
<Context docBase=”Tracker” path=”/Tracker”>

<Resource name=”jdbc/tracker” scope=”Shareable” type=”javax.sql.DataSource”
factory=”org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory”
url=”jdbc:mysql://localhost:3306/tracker?autoReconnect=true”
driverClassName=”com.mysql.jdbc.Driver”
username=”root”
password=”admin”
maxIdle=”5″
maxActive=”50″

/>
2.Then make entry in web.xml
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/tracker</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

3.Then place mysql-connector-java-3.1.13.jar in TOMCAT_HOME/common/lib folder
4.place jstl.jar.standar,jar in TOMCAT_HOME/common/lib folder/

or

in you webInf/lib folder(this is optional stepp if u using jstl)

5. use any where with code
Context ctx = new InitialContext();
DataSource ds = (DataSource)ctx.lookup(“java:comp/env/jdbc/tracker”);
connection = ds.getConnection();

Note:

-download Connector/J 3.0.11-stable (the official JDBC Driver)

-Downlaod jstl lib(standard.jar, jstl.jar agian this is optional)

you can email me for jdbc connector and JStl lib at aijaza.b@gmail.com

for refrence also check that link

http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

Q.how to send an configration SMS(like mobile operators send GPRS setting, its an configration SMS)

A.configration SMS is not a simple text sms.you have to send your message using  Over The Air(OTA) or Open Mobile Alaince (OMA).

you can download OTA spacification document from there but first you have to make a login to nokia forum.open the link make you registration the download the pdf file

http://www.forum.nokia.com/info/sw.nokia.com/id/3377eb33-cb1d-490e-a1cb-8735d785e1d3/OTA_settings_general_7_0.pdf.html

you can also download OMA specification

http://www.forum.nokia.com/info/sw.nokia.com/id/8d85ad81-5a9b-40fe-bf2a-d567dfd755ec/Series_40_DP_2_0_OMA_Client_Provisioning_v1_3_en.pdf.html

-i wanna send configration sms for synch settings . for that i read the these above spacification(parameters required).
-then i create an xml according to OMA/OTA spacification.
-and concert this xml to wbxml

how convert xml to wbxml
there is two solution for that, you can find two APIs on the internet
-wbxml this is c++ library
can be downlaoded for here http://libwbxml.aymerick.com/
-kxml this is java library
can be donwlaod from here http://kxmlrpc.objectweb.org/software/downloads/

i converted my xml to wbxml using kxml api.here is code

package test.kxml;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.kxml.io.AbstractXmlWriter;
import org.kxml.kdom.Document;
import org.kxml.parser.XmlParser;
import org.kxml.wap.WbxmlWriter;

public class Converter {

public static void main(String args[]){

byte[] bytes=null;

try {
File file = new File(“D:\\xml\\OMA2.xml”);

InputStream is = new FileInputStream(file);

// Get the size of the file
long length = file.length();

// You cannot create an array using a long type.
// It needs to be an int type.
// Before converting to an int type, check
// to ensure that file is not larger than Integer.MAX_VALUE.
if (length > Integer.MAX_VALUE) {
// File is too large
}

// Create the byte array to hold the data
bytes = new byte[(int)length];

// Read in the bytes
int offset = 0;
int numRead = 0;
while (offset < bytes.length
&& (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
offset += numRead;
}

} catch (Exception e) {
// TODO: handle exception
}

try {
FileOutputStream fOutStream = new FileOutputStream(“D:\\xml\\OMA2.wbxml”);
// Construct an InputStreamReader on ByterArrayInputStream.
InputStreamReader in = new InputStreamReader(new ByteArrayInputStream(bytes));

// Make parser using this Reader.
XmlParser parser = new XmlParser(in);

// Construct a DOM Document to parse XML.
Document document = new Document ();
document.parse(parser);
in.close();

// Make an OutputStream on which WbxmlWriter can write.
ByteArrayOutputStream out = new ByteArrayOutputStream();
//AbstractXmlWriter writer = new WbxmlWriter(out);

AbstractXmlWriter writer = new WbxmlWriter(fOutStream);
document.write(writer);
writer.close();

System.out.println(“————-”+out.toString());
//out.writeTo(fOutStream);
// Get WBXML from this stream.
bytes = out.toString().getBytes();

out.close();

}//try
catch (Exception e) { e.printStackTrace(); }

}//End of MAin

}

i also have the exe file of wbxml lib(complied and convert to exe). you can run it on command promt.
place the xml file and related dll in a folder the open the command promt and point to that folder and the write that command
xml2wbxml.exe
then write this command
xml2wbxml -o output.wbxml input.xml
xml2wbxml -k -n -v 1.1 -o output.wbxml input.xml

then your file convertd to wbxml. for wbxml exe file you can email me at aijaz.a.b@gmail.com

wbxml is short form of xml mean all xml data converted to binary so file size get commpressed. when you convert the xml to wbxml you will see all tags are converted into binary form but the text will remain the same.
then convert it to Hexadecimal form and send it to your mobile.

downlaod hex-editor form that link http://www.brothersoft.com/free-hex-editor-download-40299.html, it will convert wbxml to hex.

how to send to the mobile you have to read your gate spacificatio. i am using unwire gateway so for that i set the “type” varibale to “raw” in the url and set the header.i didnt able to get sms on mobile therefor i contacted to my gateway provider but these all step really help to send the configration SMS.

the sms you will send it will have two parts
first is UDH head
what is UDH head read this link

http://dev.mobi/article/binary-sms-sending-rich-content-devices-using-sms

the samlple i send like this
(UDH header)Header1: 0B0504C34FC0020003B90201
(hexdecimal form of wbxml)Body1: 010604039481EA00010045C60601871245018713110331302E392E382E37000187146101872111032B333637303730303039323700018722700187231103766F6461776170000187241103766F646177617000018728730187296C0101C606018712410187131103323232000187146001871A11032B33363730393939363530
Header2: 0B0504C34FC0020003B90202

hope this all will help

also read this link .might be it will be helpful

http://dev.mobi/article/email-configuration-sms

this is the example that i tryied with some gatway

i used this url of my gateway provider to send sms on mobile

http://mobile.unwire.dk/java/servlet/smspush?user=test&password=test&to=92322111111&smsc=dk.tdc&udh=0605040B840000&text=02056A0045C60C037777772E6465762E6D6F62692F69735F66756E2E68746D6C0011033635333200070103446576446F744D6F62692069732046756E2021000101&phoneno=92322111111&mediacode=ijazcompnay&appnr=321&from=ijax&type=raw&

see type variable

cheeeeeeeeeeeeeeerz

 I would say that IOC and Dependency Injection are not the same thing. Both are design patterns. Inversion of Control is the more abstract notion. Dependency injection is more specific.

They overlap a lot – hence the confusion above. I would say this – “Dependency Injection is only one pattern which makes use of the IOC pattern”.

The IOC pattern simply says that objects are enabled for something else to configure/control them. This “something else” might be a framework or it might be another object – it is not necessarily a framework that is doing the configuring. In the most abstract sense a network of cooperating objects could mutually configure each other and all will be happy.

A perfect example of IOC that would *not* be dependency injection would be a piece of Java code which wanted to display a calendar widget within a GUI. The code creates a calendar widget object, then calls methods in the calendar widget instance and sets a few parameters like background color. Then the Panel widget is called (another example of IOC) and told to add the calendar widget instance to the panel in the upper left hand corner. The panel and calendar widgets are allowing themselves to be configured via IOC – but the calling code (in control) is just another piece of Java code and not particularly a “framework”.

Martin Fowler’s coining of the terms IOC 1,2,3 really were talking about the interaction between a framework and a component working within the framework. Perhaps a better way to title Martin’s work would be “Three different ways that frameworks use the IOC pattern”. Dependency Injection is best described as “What Spring Does”. Spring (a framework) feeds an object (a component) configuration values and classes (implementations) for requested APIs (Interfaces) using the IOC pattern.

Another way to look at this from a Java perspective – the notion of setters is the most basic form of IOC. Martin’s work took the setter pattern and suggested that the best way for a component to find its dependencies was through the setter pattern (i.e. IOC is the best way for a component to get its dependencies from a framework).

The Sakai framework component approach are based on this notion of Dependency injection. Sakai uses classic IOC throughout tools, presentation layer, etc etc.

There are places in Sakai where IOC/Dependency Injection is not practical or quite inconvienent and so different patterns are used. That is a different fun debate when IOC purists meet the real world.

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Blog Stats

  • 792 hits

 

December 2009
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  

Flickr Photos

iris

More Photos