curl-and-php
Re: Sending a XML using Curl
Date: Wed, 12 Nov 2008 23:19:44 +0200
"try disabling verify_host to false or 0"
didnt work
they have no XSD or DTD. they gave me an example XML (even if send it it
says INVALID XML, it should have said invalid merchant or something.).
because of that i am sure there is something at the curl part. Maybe
because the xml fil has no header but i dont know how to sen id with xml
header. Thanks Hatun Ahmed.
haroon ahmad yazm?s,:
> validate your xml with service provider XSD or DTD. You are getting
> response from their server means your script is working. Your xml
> schema is wrong. You must validate your xml packat with their XSD or
> DTD. For more information check / consult the service provider. They
> always give out their XSD. Even you can use PHP to validate your xml
> against their xsd.
>
>
> I was working with Ebay Motors Pro API recently and I used the
> following code for validation
>
> function libxml_display_error($error)
> {
> $return = "<br/>\n";
> switch ($error->level) {
> case LIBXML_ERR_WARNING:
> $return .= "<b>Warning $error->code</b>: ";
> break;
> case LIBXML_ERR_ERROR:
> $return .= "<b>Error $error->code</b>: ";
> break;
> case LIBXML_ERR_FATAL:
> $return .= "<b>Fatal Error $error->code</b>: ";
> break;
> }
> $return .= trim($error->message);
> if ($error->file) {
> $return .= " in <b>$error->file</b>";
> }
> $return .= " on line <b>$error->line</b>\n";
>
> return $return;
> }
>
> function libxml_display_errors() {
> $errors = libxml_get_errors();
> foreach ($errors as $error) {
> print libxml_display_error($error);
> }
> libxml_clear_errors();
> }
>
> // Enable user error handling
> libxml_use_internal_errors(true);
>
> $xml = new DOMDocument();
> $xml->load('i1-13s.xml');
>
> if (!$xml->schemaValidate('schema.xsd')) {
> print '<b>DOMDocument::schemaValidate() Generated Errors!</b>';
> libxml_display_errors();
> }
> else {
> echo "validated";
> }
>
>
> Haroon Ahmad
> PHP Web Developer
> www.haroonahmad.co.uk <http://www.haroonahmad.co.uk>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-11-12