Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
5 replies Latest Post - ‏2013-01-16T08:09:35Z by fjb_saper
Powerss
Powerss
7 Posts
ACCEPTED ANSWER

Pinned topic How to Set Webservice URL Dynamically from Java Compute Node

‏2012-12-28T22:48:06Z |
Hi, i'm using "SOAP Request node" in WMBT 6.1, and i want to change the "web service url" property of the SOAP node dynamically in my JavaCompute Node. Can you give your suggestion on how to use it.

Thanks
Updated on 2013-01-16T08:09:35Z at 2013-01-16T08:09:35Z by fjb_saper
  • fjb_saper
    fjb_saper
    122 Posts
    ACCEPTED ANSWER

    Re: How to Set Webservice URL Dynamically from Java Compute Node

    ‏2012-12-30T07:33:36Z  in response to Powerss
    What does the infocenter say are the override parameters from the local environment?
    • Powerss
      Powerss
      7 Posts
      ACCEPTED ANSWER

      Re: How to Set Webservice URL Dynamically from Java Compute Node

      ‏2012-12-31T22:57:02Z  in response to fjb_saper
      Hi, Yes ! i would like to know if there is any way to override the variable so that i can get the URL some where from the property file. I found the solution for overriding the URL from ESQL in one of the threads but dont knw how to do it in Java Compute node. Thanks.
      • fjb_saper
        fjb_saper
        122 Posts
        ACCEPTED ANSWER

        Re: How to Set Webservice URL Dynamically from Java Compute Node

        ‏2013-01-02T01:08:47Z  in response to Powerss
        you start with MbElement mbe = Assembly.getLocalEnvironment().getRootElement(); and take it from there....
  • Powerss
    Powerss
    7 Posts
    ACCEPTED ANSWER

    Re: How to Set Webservice URL Dynamically from Java Compute Node

    ‏2013-01-15T16:52:00Z  in response to Powerss
    Check below. this is how we need to set the "Destination URL" for Webservice in Java compute Node.

    destinationElement = localEnv.createElementAsLastChild(MbXMLNSC.FOLDER,"Destination",null);
    MbElement soapElement = destinationElement.createElementAsLastChild(MbXMLNSC.FOLDER,"SOAP",null);
    MbElement requestElement = soapElement.createElementAsLastChild(MbXMLNSC.FOLDER,"Request",null);
    MbElement transportElement = requestElement.createElementAsLastChild(MbXMLNSC.FOLDER,"Transport",null);
    MbElement httpElement = transportElement.createElementAsLastChild(MbXMLNSC.FOLDER,"HTTP",null);
    MbElement WebServiceURLElement = httpElement.createElementAsLastChild(MbXMLNSC.FOLDER,"WebServiceURL",null);
    WebServiceURLElement.setValue("http://www.abc:4045");

    Thanks
    • fjb_saper
      fjb_saper
      122 Posts
      ACCEPTED ANSWER

      Re: How to Set Webservice URL Dynamically from Java Compute Node

      ‏2013-01-16T08:09:35Z  in response to Powerss
      Alternatively you can also use createMbElement(MbElement.TYPE_NAME,nodename, null) which is more parser agnostic.