EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
Expand all | Collapse all

Dynamic webservice address

Discussion Topic

Discussion TopicTue November 15, 2016 08:48 AM

Discussion Topic

Discussion TopicThu November 17, 2016 11:41 PM

Discussion Topic

Discussion TopicFri December 09, 2016 10:09 AM

  • 1.  Dynamic webservice address

    Posted Tue November 08, 2016 11:31 AM

    Hi all,


    I imported a WSDL for my project and created the Egl Client Interface, tested and worked well in the development environment.
    However I would like to know if it is possible or how I do it to make the webservice address dynamic mode, because the URL address of this WSDL in production will be different. I want to avoid the work of manually changing the URL to generate and export the application.

     

    Regards,

    Arakaki

     

     

    Arakaki


  • 2.  Re: Dynamic webservice address

    Posted Thu November 10, 2016 02:25 AM

    Hi Arakaki

    we are building EGL web transactions - using jsp as user interface. We have added this code, that may give you an idea of how do solve your problem.

    I guess you can do similar coding in EGL or java. The use of the "setEndpoint" is the way to use dynamic webservice address.

    We have added this to a JSP:

    myProxy proxy = new myProxy();

    proxy._getDescriptor().setEndpoint(myURL.getTextValue() + "/" + myEndpoint.getTextValue());

     

    hope this helps

    Morten Hansen, IBM Denmark

    mohaIBMDK


  • 3.  Re: Dynamic webservice address

    Posted Fri November 11, 2016 12:18 PM

    Hi Morten,

    Thank you for responding and sharing your experience with us.
    Your solution is valid, so I understood, you are invoking your service via external Java program.
    In our case, we are migration Vagen Cobol aplications to Java, keeping the use Text user interface(TUI). 
    We are calling the webservice via Java generated by EGL deployement descriptor, in "service bindings configurations" option,  by WSDL imported.
    In this EGL java generated, I found the setEndpoint instruction that you mentioned, but the program setting the URL webservice address in hardcode.
    Maybe we need search more. Thanks for your help!

    Regards,
    Arakaki

    Arakaki


  • 4.  Re: Dynamic webservice address

    Posted Tue November 15, 2016 08:48 AM

    Hi Arakaki,

     

    In EGL it will be something like this:

    // Declare serviceserviceObject TheirService{@WebBinding {wsdlLocation = "EGLSource/wsdl/service.wsdl", wsdlService = "operation1", wsdlPort = "operation1Port"}};// Set endpoint depending on environmentlocation string;case(environment)   when("TST")     location = "http://testserver.com:9080/adapter/service/theservice";   otherwise     location = "http://prodserver.com:9080/adapter/service/theservice";   endServiceLib.setWebServiceLocation(serviceObject, location);

    Ortwin

    Ortwin


  • 5.  Re: Dynamic webservice address

    Posted Thu November 17, 2016 11:41 PM

    Hi Ortwin,

     

    Thanks for your tip.

    Best regards!

     

     

    Arakaki


  • 6.  Re: Dynamic webservice address

    Posted Fri December 09, 2016 10:09 AM

    Hi Ortwin,

     

    Thanks a lot for you tips.

     

    Hsieh

    Hsieh


  • 7.  Re: Dynamic webservice address

    Posted Fri December 09, 2016 10:08 AM

    Hi Morten,

     

    We got a solution after joinning the tips of Ortwin  and more a function, 

              

    First:  Create a new parameter in runnunit.properties, example:

    dataexpress.service.location=http://dataexpress/CallCobol/CallCobol.asmx

    Second:  in egl source code

     

    CallCobolSoap CallCobolSoap{@BindService{bindingKey = "CallCobolSoap12"}};

    ServiceLocation string = sysLib.getProperty("dataexpress.service.location");

    ServiceLib.setWebServiceLocation(CallCobolSoap, ServiceLocation);

    CallCobolSoap.invokeWithId(arg_1, arg_2);

    Then edit runnunit.properties if we need change a new url location.

     

    regards,

    Hsieh

    Hsieh