WSDL FILE

download WSDL FILE

of 7

Transcript of WSDL FILE

  • 7/31/2019 WSDL FILE

    1/7

    WSDL FILE

    This XML file does not appear to have any style information associated with it. Thedocument tree is shown below.

  • 7/31/2019 WSDL FILE

    2/7

  • 7/31/2019 WSDL FILE

    3/7

    Temperature Example

    package pack1;

    import javax.jws.WebService;

    import javax.jws.WebMethod;

    import javax.jws.WebParam;

    /**

    *

    * @author mind_freak

    */

    @WebService(serviceName = "MyWebService")

    public class MyWebService {

    /**

    * Web service operation

    */

    @WebMethod(operationName = "Fahrenheit")

  • 7/31/2019 WSDL FILE

    4/7

    public String Fahrenheit(@WebParam(name = "Fahr")

    int Fahr) {

    int cel=(Fahr-32)/9*5;

    String str= Integer.toString(cel);

    return "Celsius: " +str+ "!";

    }

    }

    Palindrome.java

    /*

    * To change this template, choose Tools | Templates

    * and open the template in the editor.

    */

    package pack2;

    import javax.jws.WebService;

    import javax.jws.WebMethod;

    import javax.jws.WebParam;

    /**

    *

    * @author mind_freak

    */

    @WebService(serviceName = "MyWebService1")

    public class MyWebService1 {

  • 7/31/2019 WSDL FILE

    5/7

    /**

    * Web service operation

    */

    @WebMethod(operationName = "palindrome")

    public String palindrome(@WebParam(name = "mystring")

    String mystring) {

    String original, reverse="";

    original=mystring;

    int length=original.length();

    for ( int i = length - 1 ; i >= 0 ; i-- )

    reverse = reverse + original.charAt(i);

    if (original.equals(reverse))

    return "String is Palindrom";

    else

    return "Entered String is not palindrome";

    }

    }

    Square_root.java

    /*

    * To change this template, choose Tools | Templates

    * and open the template in the editor.

    */

    package pack3;

  • 7/31/2019 WSDL FILE

    6/7

    import javax.jws.WebService;

    import javax.jws.WebMethod;

    import javax.jws.WebParam;

    /**

    *

    * @author mind_freak

    */

    @WebService(serviceName = "MyWebService2")

    public class MyWebService2 {

    /**

    * Web service operation

    */

    @WebMethod(operationName = "square_root")

    public String square_root(@WebParam(name = "number")

    String number) {

    //TODO write your implementation code here:

    double c=Double.parseDouble(number);

    double epsilon=1e-15;

    double t=c;

    while (Math.abs(t - c/t) > epsilon*t) {

    t = (c/t + t) / 2.0;

    }

  • 7/31/2019 WSDL FILE

    7/7

    String s= Double.toString(t);

    return "Square Root: "+s+"!!";

    }

    }

    WSDL FILE IS SAME FOR ALL THE THREE PROGRAMS ,ITS JUST I HAVE MADE THREE DIFFERENT

    PROGRMA FOR THREE OF US.

    Paste this program with WDSL in three of ours file with screenshots I am sending you.