cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Sending a XML using Curl

From: Quad is Activating <activate_at_quadraxas.com>
Date: Thu, 13 Nov 2008 14:24:36 +0200

it just says INVALID XML.

encoding part is ame as the sample XML they gave me. In fact even if i
try to send the exact same sample xml to them i get the same response.
(ıt should have said something like "wrong merch id")

   "access their service
curl_setopt($c, CURLOPT_USERPWD, 'user:pass');"

access is only allowed to spesific IP's. My ip is in the system, and no
password needed.

adeel shahid yazmış:
> is there just the INVALID XML message or is there any other message,
> their response codes or such stuff,
>
> try removing the encoding="ISO part sort of weird to remove it and
> test it for working but who know.
>
> try post the complete response more than INVALID XML as your XML is
> valid what i can foresee is that you might be missing some required or
> optional field that is required inside their xml parser otherwise
> there shouldn't be any problems
>
> try posting their sample xml file here and also the your xml file for
> comparison
>
> for the part before this when u send request to retrieve transaction
> id, which you have in the above document, if their system does'nt give
> an error on that part then there must be some configuration parameters
> that we are missing here.
>
> Also I tried
> accessing https://web.bankasya.com.tr/spos/iposnet/sposnet.aspx
> <https://web.bankasya.com.tr/spos/iposnet/sposnet.aspx>
> it using the browser but it's 403 forbidden, you have'nt
> listed CURLOPT_USERPWD option inside you code for setting options in
> CURL, you need to specify that to access their service
> curl_setopt($c, CURLOPT_USERPWD, 'user:pass');
>
> 2008/11/13 Quad is Activating <activate_at_quadraxas.com
> <mailto:activate_at_quadraxas.com>>
>
> "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ış:
>> 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
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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-13