2016-06-02 4 views
0

Ich bin neu zu groovy WSlite und ich versuche eine Seife Anfrage in WSLite zu schreiben.schreiben eine Seife Anfrage in groovywslite

Meine Seife Anfrage in xml is-

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:get="http://WSA.francetelecom.com/types/GetSoftPhoneInfos"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <get:getClientSOFTPHONEInfo> 
     <get:businessUnit>${#TestSuite#BU_FR}</get:businessUnit> 
     <get:cpeType>${#TestSuite#CPETYPE}</get:cpeType> 
     <get:customerId> 
      <!--Optional:--> 
      <get:type>${#TestSuite#ID_TYPE_NDIP}</get:type> 
      <!--Optional:--> 
      <get:value>${#TestSuite#NDIP_Nominal}</get:value> 
     </get:customerId> 
     </get:getClientSOFTPHONEInfo> 
    </soapenv:Body> 
</soapenv:Envelope> 

und groovy Skript bei mir läuft wie unten-

import wslite.soap.* 
import wslite.http.auth.* 
import groovy.xml.XmlUtil 

def client = new SOAPClient('http://10.170.194.214:1080/PapyrusSAV/services/GetSoftPhoneInfos-v2?wsdl') 
client.authorization = new HTTPBasicAuthorization("papyihm", "papypapyihm") 
def response = client.send(SOAPAction:'') 
body{ 
getClientSOFTPHONEInfo('xmlns':'http://WSA.francetelecom.com/types/GetSoftPhoneInfos'){ 
     businessUnit('FR') 
     cpeType('SOFTPHONE') 
     customerId('xmlns':'http://WSA.francetelecom.com/types/GetSoftPhoneInfos'){ 
      type('NDIP') 
      value('+33155886791') 
     } 
    } 
} 
println XmlUtil.serialize(response.getClientSOFTPHONEInfo) 

Wenn ich meine groovy ausführen ich Fehler bekommen

groovy.lang.MissingMethodException: No signature of method: wslite.soap.SOAPClient.send() is applicable for argument types: (java.util.LinkedHashMap) values: [[SOAPAction:]] 
Possible solutions: send(groovy.lang.Closure), send(java.lang.String), send(java.util.Map, groovy.lang.Closure), send(java.util.Map, java.lang.String), send(wslite.soap.SOAPVersion, java.lang.String), find() 

was mache ich falsch.

PS: Soapaction ist "" in der WSDL-Datei, die ich verwende

+0

Warum ist Ihre SOAPAction leer ?? –

Antwort

0

Sie benötigen einen Schließungsanfrage zu senden, wie folgt: -

def response = client.send(SOAPAction:'') { 
    body { 
      getClientSOFTPHONEInfo('xmlns':'http://WSA.francetelecom.com/types/GetSoftPhoneInfos'){ 
      businessUnit('FR') 
      cpeType('SOFTPHONE') 
      customerId('xmlns':'http://WSA.francetelecom.com/types/GetSoftPhoneInfos') { 
       type('NDIP') 
       value('+33155886791') 
      } 
      } 
     } 
    } 

Hoffe, es wird Ihnen helfen .. :)

+1

@ Saurabh Gaur: Danke.Es hat geholfen –