How to call webservice using standalone application

Hi,
Actually i am trying to connect with one free webservice using client. but i am uanble to get the result and it is throwing the Exception.Exception is Execution failed. Exception: java.net.ConnectException: Connection timed out: connection reset
i am using the following code.
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import javax.xml.namespace.QName;
import java.io.*;
public class AddFunctionClient {
public static void main(String [] args) {
try {
     String endpoint = "http://www.startvbdotnet.com/web/sample2.asmx?wsdl";
     System.setProperty("http.proxyHost", proxyHost);
          System.setProperty("http.proxyPort", portNumber);
     Service service = new Service();
     Call call = (Call) service.createCall();
     call.setTargetEndpointAddress( new java.net.URL(endpoint) );
     call.setOperationName(new QName(endpoint, "add"));
          System.out.println("connected");
          System.out.println("value is"+call.invoke(new Object[]{new Integer(10),new Integer(20)}));
     } catch (Exception e) {
     System.err.println("Execution failed. Exception: " + e);
can any one help on this

Hi,
If your  JAVA Application is Web based application, you can expose it as Webservice.
JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
So we can Use SOAP Adapter or HTTP in XI..
If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
If you are dealing with the Webservice and SAP Applications means check this
Walkthrough - SOAP  XI  RFC/BAPI
REgards
Seshagiri

Similar Messages

  • How to call webservice using jdev9i

    Hi gurus and experts,
    i need to consume a webservice using oaf. with great effort finally i created stub using axis s/w.
    now i dont know how to use the stub in jdev.where to write the code and what to write.iam strucked :-( .
    since there were no sample tutorial about how to call webservice from jdev9i, iam struggling to make.iam jus a starter.
    and while googling i came to know that stubs can be created using jdev9i .but when i see new-->webservices--web service stub it is greyed out.
    i have 2 questions now:
    1)if stub created using axis can it be used in jdev9i? if yes ,please tell me how? any tutorial links also helps me.
    2)if the stubs should be created only by jdev9i so that webservices can be called using jdev,then please guide me how to make it.
    i need some helping hands from u guys.
    Thanks a lot
    Edited by: 881533 on Oct 25, 2011 2:34 AM
    Edited by: 881533 on Oct 25, 2011 2:37 AM

    Hello sir,
    i got following reply:
    <returnRecordResponse  xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <returnResult>Error_request</returnResult>
    </returnRecordResponse>
    but correct response is
    <returnRecordResponse  xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <returnResult>Success</returnResult>
    </returnRecordResponse>
    can you tell me correction in the code which i have put on the forum?or tell me other way to call webservice?

  • How to call webservice using flex?

    Hello,
    i want to call webservice in flex.i tryied following code.but it is not giving correct response.what is wrong with this code?
    can anybody tell me ,how to call webservice in flex?
    Code:
    <mx:Script>
            <![CDATA[
    public function button1_clickHandler(event):void
         ws.returnRecord(para1,para2);//i am sending two parameter to returnRecord service here
    public function remotingCFCHandler(event:ResultEvent):void
    trace(event.result);
    ]]>
    </mx:Script>
    <mx:WebService
         id="ws"
         wsdl="http://localhost:8500/flexapp/returnusers.cfc?wsdl">
        <mx:operation name="returnRecords" resultFormat="object"
         fault="mx.controls.Alert.show(event.fault.faultString)"
         result="remotingCFCHandler(event)"/>
    <mx:Button label="Go" fontWeight="bold" click="button1_clickHandler(event)"/>

    Hello sir,
    i got following reply:
    <returnRecordResponse  xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <returnResult>Error_request</returnResult>
    </returnRecordResponse>
    but correct response is
    <returnRecordResponse  xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <returnResult>Success</returnResult>
    </returnRecordResponse>
    can you tell me correction in the code which i have put on the forum?or tell me other way to call webservice?

  • How to call webservice from Java application

    Hi XI gurus
    Pls let me know how to call a webservice from Java application.
    I wanted to build synchronous interface from Java Application to SAP using SAP XI
    For example, i need to create Material master from Java application and the return message from SAP, should be seen in Java application
    Regards
    MD

    Hi,
    If your  JAVA Application is Web based application, you can expose it as Webservice.
    JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
    So we can Use SOAP Adapter or HTTP in XI..
    If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
    If you are dealing with the Webservice and SAP Applications means check this
    Walkthrough - SOAP  XI  RFC/BAPI
    REgards
    Seshagiri

  • How to call webservice using java client

    Hi,
    I am new to webservice related stuff.Can any body help me.
    How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
    Thanks
    venuj

    user10394151 wrote:
    Hi,
    I am new to webservice related stuff.Can any body help me.
    How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
    Thanks
    venujTry this simple webservice client.
    You will need apache-axis.jar in your classpath. The following client is apache axis based. A similiar client can be built also using the JAX-WS only[without apache-axis.jar].
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.namespace.QName;
    public class WEBSERVICE_CLIENT{
    public static void main(String [] args) {
    try {
    String endpoint ="<YOUR WS ENDPOINT>";
            Service  service = new Service();
            Call     call    = (Call) service.createCall();
            // YOU CAN SET VARIOUS PROPERTIES IN THE "CALL" OBJECT...LIKE
            // USERNAME,PASSWORD,PROPERTIES OF HTTP HEADER. SEE "CALL" OBJECT'S API FOR MORE PROPERTIES.
            call.setTargetEndpointAddress( new java.net.URL(endpoint) );
            call.setOperationName(new QName("<YOUR WS SERVICE NAMESPACE>", "<WS SERVICE TO BE INVOKED>"));
            String msg = (String) call.invoke( new Object[] { "data" } );
            System.out.println("RETURNED MESSAGE : "+msg);
          } catch (Exception e) {
            System.err.println(e.toString());
    }

  • How to call webservices using soap in xi

    Hello
    I am tring to work  on webserivces,bascially i am not having any knowledge on webservices,i have seen the documentation & i know how to configure soap adapter &  how to define webservice in integration directory.can any one please help me out how to work with webservices  & good documentation on webservices & soap.
    Thanks
    Rajesh

    Hi Rajesh,
    Use server(tomcat server) or plain html coding for defining webservices....
    check sample webservice coding
    Purchase Order Web Application
    dispDate(0)
    Purchase Order Input Parameters:
    Document Type:
    Standard PO
    Vendor Number:
              Purchase Order Date:
    Purchasing Material:
              Delivery Date:
    Quantity:
    NetPrice:
    Unit of Measurement:
    PCs
    PriceUnit:
    Results:
    /code
    And gothrough the following weblogs which will be useful...
    /people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
    /people/thomas.jung3/blog/2005/06/05/web-services-the-case-of-the-missing-soap-action-header
    /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
    Hope u get some idea...
    Regards,
    Sridhar
    Message was edited by: sridhar reddy kondam

  • How to Call Webservicer using Visuval composure Ce 7.1 server

    Hi ,
    We are created in ABAP , they r exposed in WSDL , if i have to call That web services using visuval composure please ASAP can u send , how to call WSDL In CE 7.1 Serve
    Thnks & Regards,
    Suresh

    Hi
    you can try this links:
    http://help.sap.com/saphelp_nwce10/helpdata/en/9f/9985f72084483cb316a3c2322fb090/content.htm
    (here look for the therm Creating Web Service Physical Destinations that points to :
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/635dd614d73bdbe10000000a1553f7/content.htm
    best regards,
    v s
    Edited by: v s on Dec 4, 2008 12:22 PM

  • How to call webservice?

    Hello,
    i am trying to call webservice.i tryed  following code for calling webservices via actionscript.it is givind the response.but it is not giving correct response.
    is this correct way to call webservice?is there other way to call webservice?can anybody tell me,how to call webservice?
    <mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”vertical” width=”420″ height=”380″ xmlns:net=”flash.net.*”>
    <mx:Script><![CDATA[
    import mx.rpc.soap.LoadEvent;
    import mx.rpc.AbstractOperation;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.soap.Operation;
    import mx.rpc.soap.WebService;
    private var serviceURL:String = "http://localhost:7080/icon-ws/services";
    private var wsdlURL:String = "http://localhost:7080/icon-ws/bulkUpload.wsdl";
    private function callWS():void {
    var service:WebService = new WebService(serviceURL, serviceURL);
    service.wsdl = wsdlURL;
    service.loadWSDL();
    var oper:Operation = service.getOperation("BulkUpload") as Operation;
    oper.addEventListener("result", resultHandler);
    oper.addEventListener("fault", faultHandler);
    oper.send();
    public function resultHandler(event:ResultEvent):void {
    Alert.show("Result returned"+ event.result.toString());
    public function faultHandler(event:FaultEvent):void {
    Alert.show("fault: "+ event.toString());
    ]]></mx:Script>
    <mx:Button id=”selectBut” label=”CALL webservice” click=”callWS()”/>
    </mx:Application>

    sorry for my english. I expect you understand me...
    I do that extended sp 
    Code Block
    use atdb_main_test
    Declare @Object as Int;
    Declare @ResponseText as Varchar(8000);
    DECLARE @login VARCHAR(50);
    DECLARE @user_passwd VARCHAR(50)
    Exec master..sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
    Exec master..sp_OAMethod @Object, 'open', NULL, 'get', 'http://172.xx.xx.xx:wwww/account.asmx?op=CreateEquipementMacAddress', 'false'
    EXEC master..sp_OASetProperty @Object, 'user_login', @login
    EXEC master..sp_OASetProperty @Object, 'user_passwd', @user_passwd
    EXEC master..sp_OASetProperty @Object, 'p_nb_poste', 1
    EXEC master..sp_OASetProperty @Object, 'p_id_site', 91400
    EXEC master..sp_OASetProperty @Object, 'p_id_type_poste', 83
    EXEC master..sp_OASetProperty @Object, 'p_adresse_mac', null
    EXEC master..sp_OASetProperty @Object, 'p_num_serie', null
    EXEC master..sp_OASetProperty @Object, 'login', null
    EXEC master..sp_OASetProperty @Object, 'passwd', null
    EXEC master..sp_OASetProperty @Object, 'default_gateway', null
    EXEC master..sp_OASetProperty @Object, 'ip', null
    EXEC master..sp_OASetProperty @Object, 'bCreateIPPhone', 'false'
    EXEC master..sp_OASetProperty @Object, 'vlanId', 0
    Exec master..sp_OAMethod @Object, 'send'
    Exec master..sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
    Select @ResponseText as ResponseText
    Exec master..sp_OADestroy @Object
    I use a SQL server 2000 and don't do anything else.
    But it doesn't work
    I don't know what to do ...
    the message is (1 row affected) but no tupple is written in my db...
    can you help me please ?

  • How to show busy cursor  when call webservice using as?

    I want to call webservice using script,but i don't know how
    to show busy cursor.please help me

    Show busy cursor:
    >>>
    CursorManager.setBusyCursor();
    <<<
    and hide it:
    >>>
    CursorManager.removeBusyCursor();
    <<<
    Don't forget to catch all events of the web-service to
    securely remove the busy cursor. Especially, you might wish to
    handle events of the 'results received' and the 'faults appeared'
    logical results.

  • How to Call Webservice in Portal Component?

    Hi Experts,
        Currently, I have a URL of WSDL file, how can I consume this webservice in portal component. I know that we can call webservice via webdynpro application/standalone proxy/deployable proxy, but it seems different in portal component.
       Thanks & Best Regards,
       James

    Accessing an External Web Services in Portal
    Accessing an External Web Services in Portal
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/ae1b9a5d2cef4ea4b579f19d902871/content.htm
    Consuming Web Service from ABAP
    Consuming Web Service from ABAP

  • How is call web method in application?.

    Hi,
    I have created java web application(Web Service).
    I want to call the setName() method in java application(GUI).
    how is call web method in application?.
    package sv;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    @WebService()
    public class MyService {
    @WebMethod(operationName = "setName")
    public String setName(@WebParam(name = "name")
    String name) {
    return "my string is "+ name;
    }

    The model layer should never depend on a specific view layer - this breaks reusability.
    What you need to do is expose a service method on your AM. Then your view can call this method and pass a parameter into the model layer.

  • How to call webservices in visuval composure CE 7.1 server

    Hi ,
    How to call webservices in visuval composure CE 7.1 server (WSDL) ,  please send step  by step process
    Thanks & Regards,
    Suresh

    I have exactly the same problem.
    Here is what I found out:
    In the browser based VC you have to use the Destination Template Managemet from NWA. The destinations are found during design time and can be called during runtime.
    The NWDS version seems to work differently. You cannot see the destinations you created in NWA. Instead there is a preferences setting (Destination configuration). Here you can define the destination using WSDLs.
    This works during design time.
    But during runtime the call throws an error like 'Destination not found'. To me, it seems like a bug.
    Does anybody have an idea how to solve this?
    Thanks,
    Michael

  • Need to find out how many users are using Siebel Application

    Hello all,
    I need to find out how many users are using Siebel Application?
    Is there a way I can find out?
    Thanks.
    yasun

    Hi,
    Read the following:
    http://docs.oracle.com/cd/B40099_02/books/SysDiag/SysDiagSysMonitor30.html
    http://docs.oracle.com/cd/B40099_02/books/SysDiag/SysDiagSysMonitor17.html
    For full information about server status and statistics red:
    http://docs.oracle.com/cd/B40099_02/books/SysDiag/SysDiagSysMonitor.html
    T.Abed

  • How to send attachments using java application and outlook

    Hi ,
    I created an application in java which is as
    on the Conference Tab i can schedule a conference and with the send command on page it map all the scheduled data to outlook(with all conference details) and using outlook send option the mails are send to appropriate user.
    but now i want to modify this application such as when i use the send command from my jsp page it should attach the file that is in .vcs or .ics format for auto updation of user calender.
    can any one know how to send attachment using java application .

    Last time I checked, SMS was a service between carriers and doing SMS yourself was really tricky. Some services existed to let you do it but as I recall they wanted non-trivial money.
    However, most phone carriers provide an email-to-SMS bridge of some kind.
    So the easiest thing is just to send an email.
    That's sending from a non-phone to a phone. There's a J2ME library to send/receive SMS from/to a phone.
    However, this is from memory, and a little out of date, so I could be entirely wrong. Hope it helps anyway.

  • How to call serlvet using ftp protocal

    Hai,
    How to call servlet using ftp protocal . if any one having please send that program . because generic servlet will receive any protocal request .

    The basics are to have your Server listen to port 21.
    You would then have to parse the request information to determine what is being asked for and generate an appropriate response.

Maybe you are looking for