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.
8 replies Latest Post - ‏2013-04-21T11:45:29Z by sunnytech
Rabee
Rabee
6 Posts
ACCEPTED ANSWER

Pinned topic SOAP Request Node Dynamic WS URL

‏2013-03-23T15:16:56Z |
Dears,

I'm calling a web service using SOAPRequest Node, when I import the URL the default end point will be as the imported WSDL file, when I want to move to staging or production how can I change the end point without the need to regenerate the wsdl again from the new environment. Can I use the Configurable services for that and if so how?

Thanks in advance,
Updated on 2013-04-05T03:04:14Z at 2013-04-05T03:04:14Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    4179 Posts
    ACCEPTED ANSWER

    Re: SOAP Request Node Dynamic WS URL

    ‏2013-03-24T17:56:34Z  in response to Rabee
    Hi, Rabee!
    You can override the soap URL by using this variable:
    OutputLocalEnvironment.Destination.SOAP.Request.Transport.HTTP.WebServiceURL

    (more information you'll find here: http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fac56190_.htm )

    If you want to define the Endpoint url by using configurable service, you'll need to use UserDefined configurable service and some Java code to access the properties (see here: http://publib.boulder.ibm.com/infocenter/wmbhelp/v7r0m0/index.jsp?topic=%2Fcom.ibm.etools.mft.doc%2Fbe43730_.htm )
    And no, currently those userDefined configurable services can not be accessed through ESQL.

    Cheers,
    Nikolay
  • SystemAdmin
    SystemAdmin
    4179 Posts
    ACCEPTED ANSWER

    Re: SOAP Request Node Dynamic WS URL

    ‏2013-04-05T03:04:14Z  in response to Rabee
    As suggested earlier, you can make use of User Defined Properties which are referred inside the ESQL.

    Also, override the node properties using mqsioverride command during build i.e mqsicreatebar command. This is the ideal way of changing the environment specific properties before deployment.
    • Rabee
      Rabee
      6 Posts
      ACCEPTED ANSWER

      Re: SOAP Request Node Dynamic WS URL

      ‏2013-04-18T05:10:43Z  in response to SystemAdmin

      Thank you sbhupa, this was so helpful , but I'm facing a little problem. Since I used Java Compute to get the Configurable Service Properties , I tried to verride the soap URL by using Java Compute also using the following snippets

       

      // Here I was able to get the port from the Configurable service successfully

      ConfigurableService myUDCS = b.getConfigurableService("UserDefined", "EGAComplaintsSystemConfig");
      String port = myUDCS.getProperties().getProperty("COMPLAINT_PROCESS_WS_PORT");

      // But Changing the port using the java compute is not working

      MbElement destinationElement = inAssembly.getLocalEnvironment().getRootElement().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(port);

      So can I pass the port which I read from the Configurable Service using Java compute to be set by the ESQL Compute and if so how can I pass the port parameter.?

  • Rabee
    Rabee
    6 Posts
    ACCEPTED ANSWER

    Re: SOAP Request Node Dynamic WS URL

    ‏2013-04-17T19:17:23Z  in response to Rabee

    Thank you sbhupa, this was so helpful , but I'm facing a little problem. Since I used Java Compute to get the Configurable Service Properties , I tried to verride the soap URL by using Java Compute also using the following snippets

     

    // Here I was able to get the port from the Configurable service successfully

    ConfigurableService myUDCS = b.getConfigurableService("UserDefined", "EGAComplaintsSystemConfig");
    String port = myUDCS.getProperties().getProperty("COMPLAINT_PROCESS_WS_PORT");

    // But Changing the port using the java compute is not working

    MbElement destinationElement = inAssembly.getLocalEnvironment().getRootElement().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(port);

    So can I pass the port which I read from the Configurable Service using Java compute to be set by the ESQL Compute and if so how can I pass the port parameter.?

     

    Thanks in advanced,

    Rabee'

    • sunnytech
      sunnytech
      11 Posts
      ACCEPTED ANSWER

      Re: SOAP Request Node Dynamic WS URL

      ‏2013-04-18T13:00:12Z  in response to Rabee

      try this:

       

      getRootElement().evaluateXPath("?Destination/?SOAP/?Request/?Transport/?HTTP/?WebServiceURL[set-value('"+URL+"')]");

       

      this technique is used in WebServiceGateWaySample.

      • Rabee
        Rabee
        6 Posts
        ACCEPTED ANSWER

        Re: SOAP Request Node Dynamic WS URL

        ‏2013-04-20T13:26:01Z  in response to sunnytech

        Still the same, no effect for overriding the URL in Java compute

        • sunnytech
          sunnytech
          11 Posts
          ACCEPTED ANSWER

          Re: SOAP Request Node Dynamic WS URL

          ‏2013-04-21T11:45:29Z  in response to Rabee

          This works fine to me, are you using any compute node after java compute node? can u debug the output of java compute node and see the local environment values, also u can share the sample flow and i can assist to resolve ur problem.

          Regards

  • sunnytech
    sunnytech
    11 Posts
    ACCEPTED ANSWER

    Re: SOAP Request Node Dynamic WS URL

    ‏2013-04-18T13:02:42Z  in response to Rabee

    try this:

     

    inAssembly.getLocalEnvironment().getRootElement().evaluateXPath("?Destination/?SOAP/?Request/?Transport/?HTTP/?WebServiceURL[set-value('"+URL+"')]");

     

    this technique is used in WebServiceGateWaySample.