Layer7 API Management

Expand all | Collapse all

How to Expose SOAP Service USING LAC?

Jump to Best Answer
  • 1.  How to Expose SOAP Service USING LAC?

    Posted 06-19-2018 08:55 AM

    Hi All,

     

    can we expose SOAP service using LAC? How? I've got WSDL & service URL with me.

    #soapservice #liveapicreatorlac



  • 2.  Re: How to Expose SOAP Service USING LAC?
    Best Answer

    Broadcom Employee
    Posted 06-21-2018 01:37 PM

    LAC does not have any built-in SOAP capabilities, but that does not mean that it cannot talk to SOAP -- it just means that you'll have to do the work yourself, or use something like the CA API Gateway, which can do some translation between SOAP and REST.

     

    One way to have LAC talk to a SOAP API is simply to add a Java library for said SOAP API (usually generated from the WSDL) to your classpath (e.g. Tomcat/lib or whatever) and make calls to that library from your LAC logic (rules, events, etc...). It would typically look something like:

     

    var DefaultWebService = Java.type("com.acme.service1.soap.DefaultWebService");

    var defaultWebService = new DefaultWebService();
    var res = defaultWebService.getDefaultWebServiceHttpSoap11Endpoint().login("webservice","dadsadasdasd");

    etc...

     

    You can also use the standard Java SOAP API, something like:

     

    var SOAPConnectionFactory = Java.type("javax.xml.soap.SOAPConnectionFactory");

    var soapConnectionFactory = SOAPConnectionFactory.newInstance();

    var MessageFactory = Java.type("javax.xml.soap.MessageFactory");

    var messageFactory = MessageFactory.newInstance();

    var soapMessage = messageFactory.createMessage();

    etc...

     

    There are lots of examples available on the web, and they're trivial to translate to JavaScript.

     



  • 3.  Re: How to Expose SOAP Service USING LAC?

    Posted 06-25-2018 02:15 AM

    Hi, tarma thanks for the response. I'm trying to include few JAVA libraries into LAC. 

    as per documentation i've included it in lib/ext  and have restarted the LAC, but still i don't see that library anywhere in LAC.

    anything i might be missing ?

    One of the library is javax.xml.soap



  • 4.  Re: How to Expose SOAP Service USING LAC?

    Broadcom Employee
    Posted 06-25-2018 03:06 AM

    Java libraries are not shown anywhere. If they are in the classpath, then you can use them from any JavaScript code, such as the one in my previous answer.



  • 5.  Re: How to Expose SOAP Service USING LAC?

    Posted 06-28-2018 03:29 AM

    Thanks for the help.