karthik k
karthik k

Reputation: 3981

Client found response content type of 'text/html; charset=iso-8859-1', but expected 'text/xml'

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

Exception Message:

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>

Note: I am developing a .net webapplication.

Anybody has answer for this?

Upvotes: 0

Views: 7525

Answers (2)

I have Same problem but by below suggestion being solved:

add a "Web Reference " instead of a "Service Reference". this will generate code based on .Net Framework 2.0 Web Services Technology.

so, in visual studio:

follow steps by Image tutorial

Upvotes: 0

pabdulin
pabdulin

Reputation: 35219

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. Invalid for a service (in the future, for example);
  2. In invalid format (need to be in UTC, or in other string format, are you using same cultures on local and VM?).

Upvotes: 1

Related Questions