Posts

Showing posts from 2015

log

Log.logger.info("Check election Id in add candidate Action : "+candidateBean.getElectionID()); import org.apache.log4j.*; public class Log {     public static Logger logger;     static {         logger = Logger.getLogger(Log.class);         SimpleLayout simpleLayout = new SimpleLayout();         FileAppender fileAppender = null;         try {             fileAppender = new FileAppender(simpleLayout,             "D:\\Workspace-Eclipse\\Voting\\WebContent\\VotingLog.txt", true);         } catch (Exception e) {}         logger.addAppender(fileAppender);     } }

log4j impl

package com.evs.util; import java.io.FileOutputStream; import org.apache.log4j.*; public class Log { public static Logger logger; static{ logger = Logger.getLogger(Log.class); //Generate pattern string for pattern layout /* String pattern = "%n%nClassname of caller: %C %n"; pattern += "Date : %d{ISO8601} %n"; pattern += "Location : %l %n"; pattern += "Log Message: %m %n %n"; */ /* String pattern = " %n%nClassname of caller: %C %n "; pattern += " Date : %d{ISO8601} %n "; pattern += " Location : %l %n "; pattern += " Log Message: %m %n %n "; */ /* String pattern = " %n%nClassname of caller: %C %n "; pattern += " Date : %d{ISO8601} %n "; pattern += "Location : %l %n "; pattern += "Log Message: %m %n %n "; */ /* String pattern = " Msg %m %n %n "; pattern ...

axis 1.6.3 webclient access

 // TODO Auto-generated method stub         String END_POINT = "http://localhost:8080/axis2/services/MyService";         StockQuoteStub stub = new StockQuoteStub();         StockQuoteStub.GetQuote getQuote = new StockQuoteStub.GetQuote();         getQuote.setSymbol("10");         try {             StockQuoteStub.GetQuoteResponse resp = stub.getQuote(getQuote);             System.out.println("result :: " + resp);         } catch (RemoteException e) {             // TODO Auto-generated catch block e.printStackTrace         }

axiom secure https webservices access

http://blog.facilelogin.com/2008/11/secure-your-service-with-http-basic.html

working with custom soap headers

http://wso2.com/library/3156/

Axiom API Soap Header Addition

http://charithaka.blogspot.in/2008/10/how-to-add-custom-soap-header-to.html

Apache Axis Direct API

https://today.java.net/article/2006/12/08/invoking-web-services-using-apache-axis2%20

Calling Direct API

/** * */ package net.webservicex.www; import java.rmi.RemoteException; import org.apache.axiom.om.*; import org.apache.axis2.client.*; import org.apache.axis2.addressing.*; import org.apache.axis2.AxisFault; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; import org.apache.axis2.Constants; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; import org.apache.axis2.client.ServiceClient; import org.apache.axis2.client.OperationClient; import org.apache.axiom.soap.SOAP12Constants; import org.apache.axiom.soap.SOAPFactory; import org.apache.axiom.soap.SOAPEnvelope; import org.apache.axis2.context.MessageContext; import javax.xml.namespace.QName; import org.apache.axis2.AxisFault; import org.apache.axis2.wsdl.WSDLConstants; /** * @author Bala * */ public class TestWS { /** * @param args * @throws AxisFault */     public static v...

Calling direct webservice method using axis2 API in Scripts

https://scn.sap.com/thread/3504220

http://tutorial-wizard.blogspot.in/

http://tutorial-wizard.blogspot.in/

apache axis web service - tutorial 1

//ADD.JAVA  package addition; public class add{ public int add(int a,int b){ return a+b; } }  //inside your service package place that add.class file  //services dir -addition dir-add.class  //SERVICES.XML addition program addition.add //services dir--addition dir--META-INF dir- services.xml / //test the your web services http://localhost:8080/axis2/services/arithmatic  //the previous links show wsdl file means your service working file...  //if it show fault services means your services have some problem..  //the error may be services.xml syntax problem(so careful in writing services.xml)  //CLIENT PROGRAM  import org.apache.axiom.om.OMFactory;  import org.apache.axiom.om.OMAbstractFactory;  import org.apache.axiom.om.OMElement;  import org.apache.axiom.om.OMNamespace;  import org.apache.axiom.om.OMText;  import org.apache.axis2.client.Options;  import org.apache.axis2.client.ServiceClient;  import org...

apache axis web service tutorial2

//ADDITION.JAVA package additionService; import java.util.Iterator; import org.apache.axiom.om.*; public class addition { public addition() { } public OMElement add(OMElement omelement) { OMFactory omfactory = OMAbstractFactory.getOMFactory(); org.apache.axiom.om.OMNamespace omnamespace = omfactory.createOMNamespace("http://www.example.org/additionService/", "additionService"); OMElement omelement1 = omfactory.createOMElement("sum", omnamespace); Iterator iterator = omelement.getChildren(); int i = Integer.parseInt(((OMElement)iterator.next()).getText()) + Integer.parseInt(((OMElement)iterator.next()).getText()); omelement1.addChild(omfactory.createOMText((new StringBuilder()).append("").append(i).toString())); return omelement1; } } //SERVICES.XML additionService.addition http://localhost:8080/axis2/services/additionService //CLIENT.JAVA import java.io.S...

Apache axis wsdl2java with specified package Command

E:\Softwares\Developer Tools\Java\axis2-1.6.3-bin\axis2-1.6.3\bin>wsdl2java.bat -uri http://www.webservicex.net/stockquote.asmx?WSDL -d adb -o cl ient -p com.org.citi

example of apache axis2 service client consumption

http://briansjavablog.blogspot.in/2013/01/axis2-web-service-client-tutorial.html 1: package com.org.samples.webservices.client; 2: import java.rmi.RemoteException; 3: import com.org.webservices.client.AccountDetailsServicesStub; 4: import com.org.webservices.client.AccountDetailsServicesStub.AccountDetailsRequest; 5: import com.org.webservices.client.AccountDetailsServicesStub.AccountDetailsResponse; 6: public class SynchronousWebServiceClientTest 7: { 8: public static void main (String [] args) throws RemoteException 9: { 10: AccountDetailsServicesStub servicesStub = new AccountDetailsServicesStub(WebServiceCientUtils.SERVICE_ENDPOINT); 11: AccountDetailsRequest accountDetailsRequest = new AccountDetailsRequest(); 12: accountDetailsRequest.setAccountNumber("12345"); 13: AccountDetailsResponse accountDetailsResponse = servicesStub.accountDetails(accountDetailsRequest); 14: Web...

changing the end point in axis client java

String END_POINT = "http://localhost:8080/axis2/services/MyService";  StockQuoteStub stub = new StockQuoteStub(END_POINT);

Axis2 Eclipse plugin configuration

Axis2 Eclipse plugin runtime configuration Referance Blog

Command to generate wsdl2java in Apache axis

Pre requisites: set path for java set JAVA_HOME -> java jdk location set AXIS_HOME -> Axis location// command inside axis bin folder then axis home not needed wsdl2java.bat -uri http://www.webservicex.net/stockquote.asmx?WSDL -d adb -o com.citi.crm.service create one java project import the java service stub client files in the project and use import all the jars from axis bin folder to remove compilation issue /** * */ package net.webservicex.www; import java.rmi.RemoteException; import org.apache.axis2.AxisFault; /** * @author Bala * */ public class TestWS { /** * @param args * @throws AxisFault */ public static void main(String[] args) throws AxisFault { // TODO Auto-generated method stub StockQuoteStub stub = new StockQuoteStub(); StockQuoteStub.GetQuote getQuote = new StockQuoteStub.GetQuote() ; getQuote.setSymbol("10"); try { StockQuoteStub.GetQuoteResponse resp = stub.getQuote(getQuote); System.out.println("result :...

apache axis web service...

1. create server code 2. create client code first download axis2.war and then apache tomcat webapps directory... it will deploy automatically... produce axis2 directory first create the class file... package arith; public class arithint { public arithint() { } public int add(int i, int j) { return i + j; } } F:\tomcat7\webapps\axis2\WEB-INF\services\arith place the class file inside this arith folder.... F:\tomcat7\webapps\axis2\WEB-INF\services\arith\META-INF create the meta inf folder inside that add service configuration file..