客户端发现响应内容类型为 'text/html;charset=iso-8859-1',但预期为 'text/xml' [英] Client found response content type of 'text/html; charset=iso-8859-1', but expected 'text/xml'

查看:66
本文介绍了客户端发现响应内容类型为 'text/html;charset=iso-8859-1',但预期为 'text/xml'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调用网络服务的网络方法.当我在本地机器上运行它时,它工作正常,但是从我的虚拟机执行相同的 webmethod 时它不起作用并在

I am invoking the web method of Web Serivce. When I ran this in my local machine it is working fine but while executing the same webmethod from my virtual machine it is not working and throwing the below exception at

NDFDWeatherForecast.ndfdXML objNDFD = new NDFDWeatherForecast.ndfdXML();
string strCurrent = objNDFD.GmlLatLonList(latlng, DateTime.Now, NDFDWeatherForecast.featureTypeType.Forecast_Gml2Point, Param);

异常信息:

Client found response content type of 'text/html; charset=iso-8859-1', but expected 'text/xml'.
The request failed with the error message:
--
<?xml version="1.0" encoding="UTF-8"?>
<ExceptionReport xmlns="http://www.opengis.net/ows"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd"
version="1.0.0" language="en">
<Exception exceptionCode="InvalidParameterValue" locator="TIME"><ExceptionText>REQUEST values 2011-06-22T23:17:32.7201156-07:00 and/or 2011-06-22T23:17:32.7201156-07:00 are outside data window</ExceptionText></Exception>
</ExceptionReport>

注意:我正在开发一个 .net 网络应用程序.

有人对此有答案吗?

推荐答案

似乎您正在调用的 Web 服务不喜欢您的日期字符串 2011-06-22T23:17:32.7201156-07:00 可以是:

Seems like web service you are calling doesn't like you date string 2011-06-22T23:17:32.7201156-07:00 which can be:

  1. 对某项服务无效(例如将来);
  2. 格式无效(需要采用 UTC 或其他字符串格式,您是否在本地和 VM 上使用相同的文化?).

这篇关于客户端发现响应内容类型为 'text/html;charset=iso-8859-1',但预期为 'text/xml'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆