• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to call SOAP based web service method using wslite

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I am using Grails 2.2.3.
I am not able to call a SOAP based JAVA web service with parameters from Grails. I am using wslite. We are able to call a SOAP based web service but when we are passing the parameter, at the server end always receiving as NULL.

My Groovy Code snippet is as follows:

package poc.service
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='0.8.0')
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;

import wslite.soap.SOAPClient
import wslite.http.HTTPRequest
import wslite.http.HTTPResponse

class LoginService {
static def checkUserData(def _userName12) {

def client = new SOAPClient('http://192.168.14.147:9090/SOAPServiceDemo/authenticate')
def userNameValue = _userName12

def response = client.send(SOAPAction:'\"http://example.service.com/checkUser\"'){
header{
}
body {
checkUser(xmlns:'http://example.service.com/') {
userName12(_userName12)
}
}
}
println "User Name = " + response.checkUserResponse.return
}

static main(args){
def status = checkUserData('123')
println status
}
}


Below is another example which is working fine. It is copied from google.

package poc.service

import wslite.soap.SOAPClient
import wslite.http.HTTPRequest
import wslite.http.HTTPResponse

class MothersDay {
static def checkMotherData(String _userName12) {

def client = new SOAPClient('http://www.holidaywebservice.com/Holidays/US/Dates/USHolidayDates.asmx')
def response = client.send(SOAPAction:'http://www.27seconds.com/Holidays/US/Dates/GetMothersDay') {
body {
GetMothersDay('xmlns':'http://www.27seconds.com/Holidays/US/Dates/') {
year(_userName12)
}
}
}
println "Result = " + response.GetMothersDayResponse.GetMothersDayResult.toString()
}

static main(args){
def status = checkMotherData("2018")
}
}

Please let me know if you have any idea where I am lacking.

Thanks
Ravi
 
reply
    Bookmark Topic Watch Topic
  • New Topic