Topic
  • 5 replies
  • Latest Post - ‏2013-01-16T08:09:35Z by fjb_saper
Powerss
Powerss
7 Posts

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
    125 Posts

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

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

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

    ‏2012-12-31T22:57:02Z  
    • fjb_saper
    • ‏2012-12-30T07:33:36Z
    What does the infocenter say are the override parameters from the local environment?
    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
    125 Posts

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

    ‏2013-01-02T01:08:47Z  
    • Powerss
    • ‏2012-12-31T22:57:02Z
    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.
    you start with MbElement mbe = Assembly.getLocalEnvironment().getRootElement(); and take it from there....
  • Powerss
    Powerss
    7 Posts

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

    ‏2013-01-15T16:52:00Z  
    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
    125 Posts

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

    ‏2013-01-16T08:09:35Z  
    • Powerss
    • ‏2013-01-15T16:52:00Z
    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
    Alternatively you can also use createMbElement(MbElement.TYPE_NAME,nodename, null) which is more parser agnostic.