Re: [SOAP] parsing question

From: Date: Tue, 26 Nov 2002 18:25:12 +0000
Subject: Re: [SOAP] parsing question
References: 1  Groups: php.soap 
Request: Send a blank email to php-soap+get-313@lists.php.net to get a copy of this message
--- Paul Faulkner <paul.faulkner@wcom.com> wrote: > This is the contents of the socket after the request. > > HTTP/1.1 200 OK > Content-Type: text/xml; charset="utf-8" > Content-Length: 225 > Content-Length: 225 > SOAPAction: "" > Date: Tue, 26 Nov 2002 18:07:58 GMT > Content-Type: text/xml; charset="utf-8" > Server: J2EE SDK/1.3.1 (HTTP/1.1 Connector) > > <?xml version="1.0" encoding="UTF-8"?> ... > When I try to Parse this I get "document is not well-formed". I > assume it's because of all the garbage at the top before the xml > starts? Yes, well that is not garbage, it is part of a proper HTTP response. It looks like you are manually performing the HTTP client operations, so you have to behave like an HTTP client. The content of the response is the SOAP envelope, and this is what you want to parse, not the entire HTTP message. If you have this entire response in a variable called $http_response, you can separate the headers from the content doing something like this: list($http_headers, $http_content) = explode("\r\n\r\n", $http_response); Hope that helps. Chris

« previous php.soap (#313) next »