473,626 Members | 3,183 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.IO;
using System.Xml;
using System.Text;
using System.Net;
using System.Configur ation;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;

namespace WebServices
{
public class GwsXmlPost : System.Web.UI.P age
{
protected System.Web.UI.W ebControls.Text Box xmlAmbitRequest ;
protected System.Web.UI.W ebControls.Butt on btnSubmit;

private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
}

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

private void InitializeCompo nent()
{
this.btnSubmit. Click += new
System.EventHan dler(this.btnSu bmit_Click);
this.Load += new System.EventHan dler(this.Page_ Load);

}
#endregion

private void btnSubmit_Click (object sender, System.EventArg s
e)
{
StreamWriter myWriter = null;
string sUrlEncodeStrin g = string.Empty;

sUrlEncodeStrin g =
Server.UrlEncod e(xmlAmbitReque st.Text.ToStrin g());

HttpWebRequest webreq =
(HttpWebRequest )WebRequest.Cre ate(Configurati onSettings.AppS ettings["PostUrl"]);

webreq.ContentT ype =
"applicatio n/x-www-form-urlencoded";
webreq.Method = "POST";
webreq.ContentL ength = sUrlEncodeStrin g.Length;

try
{
myWriter = new
StreamWriter(we breq.GetRequest Stream());
myWriter.Write( sUrlEncodeStrin g);
}
catch (Exception ex)
{
ex = ex;
}
finally
{
myWriter.Close( );
}

try
{
HttpWebResponse response =
(HttpWebRespons e)webreq.GetRes ponse();
String ver = response.Protoc olVersion.ToStr ing();
StreamReader reader = new
StreamReader(re sponse.GetRespo nseStream() );
string str = reader.ReadToEn d();

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=>a pplication/x-www-form-urlencoded
DOCUMENT_ROOT=>/usr/local/apache/htdocs
HTTP_EXPECT=>10 0-continue
HTTP_HOST=>xxxx xxxxxxxxxxxxxxx xxxxxxxxxx
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=>45 96
SCRIPT_FILENAME =>/usr/local/apache/htdocs/xml/index.php
SERVER_ADDR=>xx xxxxxxxxxxxx
SERVER_ADMIN=>x xxxxxxxxxxxxxxx xxxxx
SERVER_NAME=>xx xxxxxxxxxxxxxxx xxxxxxxxxxxxx
SERVER_PORT=>80
SERVER_SIGNATUR E=><ADDRESS>Apa che/1.3.28 Server at
xxxxxxxxxxxxxxx xxxxxxxxxx.com Port 80</ADDRESS>
SERVER_SOFTWARE =>Apache/1.3.28 (Unix) PHP/4.3.3
GATEWAY_INTERFA CE=>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=>applicati on/x-www-form-urlencoded
Expect=>100-continue
Host=>xxxxxxxxx xxxxxxxxxxxxxxx xxxxx

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 3211

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

Similar topics

6
2068
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 (Page2). I have looked at HttpWebRequest on numerous coding websites but have not found a method that works. Does anyone have a solution for this or has seen an example that works for this situation? This is one very frustrating issue that I...
5
1703
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 stuck. This is the vb.net code for the wait.aspx page Public redirectPage As String = "" Public secondsToWait As String = "0"
9
1845
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 needs to transparently log a user on to a separate secure web site (PHP - not controlled by us). We want to save the user the step of typing in his username and password and having to press submit. I could accomplish this by using the <form...
1
3180
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 and the post data is corect. But when I sniff the http packet it contains not post data and he response is not the same. Here are the sniffed post packets. POST from IE6 (Request-Line):POST /Estd/Default.aspx?C=BRE&E=P&L=FRA&Ref=20051122161245...
0
1554
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 being thrown when getting the response from a specific host. I'm pretty sure the framework's implementation doesn't like the formating or status code of the returned response header. It throws the exception without giving me a way of handling it...
3
1377
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 hoping someone can help with conversion, particularly around the setup of the $UA variable and doing the post. use LWP::UserAgent; use HTTP::Request; use HTTP::Status; use HTTP::Cookies;
0
5557
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
1
3683
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 Request to retrieve the values, but POST doesn't work. There is NO Proxy... the only thing I can think is that ASP.NET is somehow filtering out the page because I'm obviously not posting the viewstate??? Seems like there was some setting for this,...
5
3194
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 FormsAuthTest { class Program { static void Main(string args) { HttpWebRequest request = null;
0
8265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7193
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2625
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1808
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.