【问题标题】:GRAILS SOAP CLIENT WSLITE PARAMETERSGRAILS SOAP 客户端 WSLITE 参数
【发布时间】:2013-04-23 11:35:05
【问题描述】:

我有一个带有 Wslite 插件的 SOAP 客户端,它工作正常,但参数没有以最佳方式发送。

def calcClient(Integer n1, Integer n2) throws Exception {
    def response
    try {
        soapClient.serviceURL = "http://localhost:8080/SISAP/services/sendMail?wsdl"

        response = soapClient.send() {
            soapNamespacePrefix "soap"
            envelopeAttributes "xmlns:util":"http://util.unime.edu.br/"
            body {
                calc{
                    //is not the best way           
                    mkp.yieldUnescaped "<util:number1>$n1</util:number1>"
                    mkp.yieldUnescaped "<util:number2>$n2</util:number2>"
                }
            }
        }
    } catch (Exception exception) {
        log.error(exception.message)
        throw exception
    }

    println response.body.calculaResponse.return
    return
}

它工作正常,但是当我尝试时:

calc{
   number1(n1)
   number2(n2)
}

或者

calc{
   "util:number1($n1)"
   "util:number2($n2)"
}

或者

calc{
   "{util}number1($n1)"
   "{util}number2($n2)"
}

Web 服务抛出异常,但未发送任何参数。

我做错了什么? :(

谢谢

【问题讨论】:

    标签: web-services grails grails-plugin


    【解决方案1】:

    我认为你需要输入

     mkp.yieldUnescaped.number1('xmlns':'util',n1)
     mkp.yieldUnescaped.number2('xmlns':'util',n2)
    

    使这项工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多