Solved: file_get_contents issue

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

cpscdave

Thread Starter
Joined
Feb 25, 2004
Messages
445
So here is the basic code that I am using
PHP:
        $request = "https://someserver.com";
	$request.="?".urlencode($xml_string);
	$aContext= array(
					'http' => array(
									'request_fulluri'=>True
									)
					);
	

	$cxContext	= stream_context_create($aContext);
	
	$xmlText	= file_get_contents($request,FALSE,$cxContext);
The problem is the server that I am making the request to is returning an error saying:

Code:
<txn>
<errorCode>6042</errorCode>
<errorName>Invalid Request Format</errorName>
<errorMessage>XML request is not well-formed or request is incomplete.</errorMessage>
</txn>
But whats odd is if I output $request and put that into my web browser the server I'm making the request to accepts the inputs and is fine.

Any idea why this is happening???

Edit: If I do a redirect to $request the server again accepts the input, it only seems to error on the get_file_contents
 

cpscdave

Thread Starter
Joined
Feb 25, 2004
Messages
445
Figured it out.... well kinda
I retyped out $xml_string as far as I can see exactly the same as before... but now it works..... /shrug
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Top