Groovy SoapClient Post 500错误

Groovy SoapClient Post 500错误,soap,groovy,Soap,Groovy,我想在groovy中使用SoapClient发出soap请求。 我的代码: 请求XML: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header/> <soapenv:Body> <web:GetWeather xmlns:we

我想在groovy中使用SoapClient发出soap请求。 我的代码:

请求XML:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
    <web:GetWeather xmlns:web="http://www.webserviceX.NET">
       <web:CityName>Berlin</web:CityName>
       <web:CountryName>Germany</web:CountryName>
     </web:GetWeather>
  </soapenv:Body>
</soapenv:Envelope>
我总是有一个例外: ERROR errors.GrailExceptionResolver-处理请求时发生TransmissionException:

HTTP响应=[内部服务器错误]代码=[500]。跟踪如下: 消息:HTTP响应=[内部服务器错误]代码=[500] 直线法 ->>171 | org.reficio.ws.client.core.SoapClient中的executePost


我做错了什么?

考虑使用WSLite:这几乎是Groovy的标准SOAP客户端,IMHO

您正在使用哪个soap客户端?您好,org.reficio.ws.client.core.soapclient哪个库中?还有,什么版本?@Peter,我不知道为什么,但客户端发送的内容类型为text/html,这会导致错误。
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
    <web:GetWeather xmlns:web="http://www.webserviceX.NET">
       <web:CityName>Berlin</web:CityName>
       <web:CountryName>Germany</web:CountryName>
     </web:GetWeather>
  </soapenv:Body>
</soapenv:Envelope>