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 =开发者_如何学C 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?
Seems like web service you are calling doesn't like you date string 2011-06-22T23:17:32.7201156-07:00
which can be:
- Invalid for a service (in the future, for example);
- In invalid format (need to be in UTC, or in other string format, are you using same cultures on local and VM?).
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
精彩评论