POST request for WCF service over 3G

From my Windows Phone (HttpWebRequest object), I'm trying to access my WCF REST services deployed in IIS.

I get a successful response when I make a request over Wi-Fi. When I try to call the same services over 3G, I get this answer:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
  <card id="FEHLER" title="ERROR">
    <p>
      The requested item could not be loaded <br/>       Wrong MIME-Type
      <do type="prev" label="back">
        <prev/>
      </do>
    </p>
  </card>
</wml>

What do I need to fix to make everything work (client or server settings and server settings are difficult to change since I use hosting)?

+3
source share
2 answers

It turned out that I needed to delete the commented line below.

        HttpWebRequest hwrq = (HttpWebRequest)WebRequest.Create(url);
        //hwrq.Accept = "text/xml";   //this was causing problems (only on 3G)
        hwrq.Method = "POST";
+2
source

HTTP-, Wi-Fi 3G. 3G . .

0

All Articles