Search code examples
soapibm-mobilefirstworklight-adapters

How to create SOAPAdater using IBM worklight 6.2?


I am trying to create Soap Adapter using IBM Work light but I am not able to get web services methods to work light projects Services folder. When I am running my project after deployment of adapter it will not showing proper output. Let me know if anyone had made demo or some good Links related to it.


Solution

  • Finally I have successfully consume weather Soap service.

    Below given is main function which should call after successful connection.

    function loadContactSuccess(result){
    
      WL.Logger.debug("Device is connected to WL server");
      WL.Logger.info("Inside loadContactSuccess" );
    
      var list = result.invocationResult.Envelope.Body.GetWeatherInformationResponse.GetWeatherInformationResult.WeatherDescription;
      console.log("list detail ..." + list);
    
      sessionStorage.setItem("WeatherDescription", JSON.stringify(result.invocationResult.Envelope.Body.GetWeatherInformationResponse.GetWeatherInformationResult.WeatherDescription));
    
      WL.Logger.debug("WeatherDescription list :: ", JSON.parse(sessionStorage.getItem("WeatherDescription")));
    
      var tempValue = JSON.parse(sessionStorage.getItem("WeatherDescription"));
    
      console.log("Inside loadContactSuccess ..." + tempValue.length);
      text = "";
      var i;
      for (i = 0; i < tempValue.length; i++) { 
            text += tempValue[i].WeatherID +"      "+"<img src="+  tempValue[i].PictureURL +">" + "<br>";
        }     
      document.getElementById("demo").innerHTML = text ;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
    
    }
    

    You can also download demo example create by me from URL.Click Here