IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  WebMethodsJava

    Posted 07/24/02 04:13 AM

    How to invoke webservice from a java servlet?


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: WebMethodsJava

    Posted 08/30/02 01:30 PM

    Here you go…

    // Make http connection to the webMethods b2b Server
    URL url = new URL (“http://B2B_IP:Port_No/invoke/Interface_Name/Flow_Name?$xmldata=”);
    URLConnection conn = url.openConnection();
    conn.setDoOutput(true);
    conn.setDoInput(true);
    conn.setUseCaches(false);
    conn.setRequestProperty(“content type”,“application/x-www-form-urlencoded”);

        // Send the POST data to the B2B server 
    

    DataOutputStream Out = new DataOutputStream(conn.getOutputStream());
    Out.writeBytes(“$xmldata=” + URLEncoder.encode(exchg));
    Out.flush();
    Out.close();

    Hope this solves your problem…


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods