473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

HELP: No POST data found from a ASPX Script HTTPWebRequest into a PHP Page

We are working with a vendor who is trying to post some some XML data
to us. They are using an ASPX script to post to a PHP page of ours.
The problem is that in the PHP page, I cannot find any kind of POST,
GET or REQUEST data at all. Is there something that they or we are
doing wrong? Is there somewhere else that PHP/Apache hide the data?
The one thing I see in the PHP global variables that I don't
understand is the HTTP_EXPECT=100-continue. What does that mean and
is it affecting anything?

This is the script that they are using:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.IO;
using System.Xml;
using System.Text;
using System.Net;
using System.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace WebServices
{
public class GwsXmlPost : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox xmlAmbitRequest;
protected System.Web.UI.WebControls.Button btnSubmit;

private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web
Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

private void InitializeComponent()
{
this.btnSubmit.Click += new
System.EventHandler(this.btnSubmit_Click);
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion

private void btnSubmit_Click(object sender, System.EventArgs
e)
{
StreamWriter myWriter = null;
string sUrlEncodeString = string.Empty;

sUrlEncodeString =
Server.UrlEncode(xmlAmbitRequest.Text.ToString());

HttpWebRequest webreq =
(HttpWebRequest)WebRequest.Create(ConfigurationSet tings.AppSettings["PostUrl"]);

webreq.ContentType =
"application/x-www-form-urlencoded";
webreq.Method = "POST";
webreq.ContentLength = sUrlEncodeString.Length;

try
{
myWriter = new
StreamWriter(webreq.GetRequestStream());
myWriter.Write(sUrlEncodeString);
}
catch (Exception ex)
{
ex = ex;
}
finally
{
myWriter.Close();
}

try
{
HttpWebResponse response =
(HttpWebResponse)webreq.GetResponse();
String ver = response.ProtocolVersion.ToString();
StreamReader reader = new
StreamReader(response.GetResponseStream() );
string str = reader.ReadToEnd();

xmlAmbitRequest.Text = str;
}
catch (Exception aEx)
{
aEx=aEx;
}
}
}
}
The $_POST, $_GET and $_REQUEST are blank arrays. This is $_SERVER
(minus some identifying information):

CONTENT_LENGTH=>3672
CONTENT_TYPE=>application/x-www-form-urlencoded
DOCUMENT_ROOT=>/usr/local/apache/htdocs
HTTP_EXPECT=>100-continue
HTTP_HOST=>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PATH=>/usr/sbin:/usr/bin:/export/home/sybase:/export/home/sybase/OCS-12_0/bin:/export/local/bin:/usr/ccs/bin:/export/local/lib
REMOTE_ADDR=>63.74.114.208
REMOTE_PORT=>4596
SCRIPT_FILENAME=>/usr/local/apache/htdocs/xml/index.php
SERVER_ADDR=>xxxxxxxxxxxxxx
SERVER_ADMIN=>xxxxxxxxxxxxxxxxxxxxx
SERVER_NAME=>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SERVER_PORT=>80
SERVER_SIGNATURE=><ADDRESS>Apache/1.3.28 Server at
xxxxxxxxxxxxxxxxxxxxxxxxx.com Port 80</ADDRESS>
SERVER_SOFTWARE=>Apache/1.3.28 (Unix) PHP/4.3.3
GATEWAY_INTERFACE=>CGI/1.1
SERVER_PROTOCOL=>HTTP/1.1
REQUEST_METHOD=>POST
QUERY_STRING=>
REQUEST_URI=>/xml/index.php
SCRIPT_NAME=>/xml/index.php
PATH_TRANSLATED=>/usr/local/apache/htdocs/xml/index.php
PHP_SELF=>/xml/index.php

This is getallheaders()

Content-Length=>3672
Content-Type=>application/x-www-form-urlencoded
Expect=>100-continue
Host=>xxxxxxxxxxxxxxxxxxxxxxxxxxxxx

If you are that way inclined, you can get 500 points on
experts-exchange.com for answering this:

http://www.experts-exchange.com/Web/..._20766981.html

Thanks
Jul 17 '05 #1
0 3193

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: someone | last post by:
I am in a situation where I need to package some information from Page1, submit it via POST to another server which will process the information and then send the user to another page on my server...
5
by: Chris | last post by:
Hi, I was following the article http://msdn.microsoft.com/msdnmag/issues/03/12/DesignPatterns/default.aspx I got everything working until I go the the Progress bar section. Here is where I am...
9
by: Denise | last post by:
I have posted a similar message in 2 other forums but got no response. I have spent more hours than I can count researching this. Can anyone provide some insight...? Our ASP.Net application...
1
by: logik3x | last post by:
I'm developping a program to automate the submisson of grades to a website called omnivox.ca (http://brebeuf.omnivox.ca). My problem is that I can't get the login working. I get the cookie right...
0
by: boxboy | last post by:
Hi, I'm writing a console application and am having a problem with HttpWebRequest when posting data to a webserver. A "System.Net.WebException: The server committed a protocol violation" is always...
3
by: Jeremy Chapman | last post by:
I've got a 2rd party API written in perl. We want to use it by converting to a c# .net assembly. Essentially it does HTTP posts to a web page to send/receive data. I've never done perl, and am...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
1
by: ERobishaw | last post by:
Using Winform app writing a HTTP Post using the following... on the server side, I get no form fields. Request.Form.AllKeys.Length = 0. If I put the field/value paris in the URL I can use...
5
by: mcfly1204 | last post by:
I am attempting to use WebRequest to access a page that requires a login/password to access. My last WebRequest continues to timeout. Any help or thoughts would be appreciated. namespace...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.