0

私はグルーヴィーな wslite を初めて使用し、wslite で SOAP リクエストを作成しようとしています。

xml での私の SOAP リクエストは -

<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>

私が実行しているグルーヴィーなスクリプトは以下のとおりです-

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)

Groovyを実行するとエラーが発生します

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()

私は何を間違っていますか。

PS: SoapAction は、私が使用している wsdl の "" です

4

1 に答える 1

0

以下のようにリクエストを送信するには、クロージャが必要です:-

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')
             }
          }
       }
   }

それがあなたを助けることを願っています.. :)

于 2016-06-02T12:08:51.557 に答える