#PERL: testing.maventa.com ser ut att fungera opålitligt..
|
|
Hej, Jag testar som bäst med perls SOAP::Lite, och försöker få er “Hello world!” test att fungera. Av någon orsak får jag bara ett lyckat svar efter 20 misslyckade försök. Misslyckanden för med sig följande meddelanden: test-koden som jag använder se ut så här: maventa_test.pl
#!/usr/bin/perl -w Jag har testat med olika versioner av SOAP::Lite 0.69 och 0.71, och resultaten är… h. René |
|
|
Hej. Något underligt med SOAP::Lite skulle jag påstå. Fungerar helt på random? Jag har gjort enl. följande: Installerat CPAN Moduler: SOAP::Lite
RESPONSE FAILS:
SOAP::Transport::HTTP::Client::send_receive: POST <a href="https://testing.maventa.com/api/api">https://testing.maventa.com/api/api</a> HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 525
Content-Type: text/xml; charset=utf-8
SOAPAction: "/api/api/hello_world"
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:typens="urn:ActionWebService" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><typens:hello_world><c-gensym3 xsi:type="xsd:string" /></typens:hello_world></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: 500 Connect failed: connect: Connection refused; Connection refused
Content-Type: text/plain
Client-Date: Tue, 17 Mar 2009 10:14:43 GMT
Client-Warning: Internal response
500 Connect failed: connect: Connection refused; Connection refused
500 Connect failed: connect: Connection refused; Connection refused at mav_test.pl line 4
at /Library/Perl/5.8.8/SOAP/Lite.pm line 3482
SOAP::Lite::__ANON__[/Library/Perl/5.8.8/SOAP/Lite.pm:3482]('Service=HASH(0xb5f974)', '\x{a}syntax error at line 1, column 0, byte 0 at /System/Library/...') called at /Library/Perl/5.8.8/SOAP/Lite.pm line 3670
SOAP::Lite::call('Service=HASH(0xb5f974)', 'hello_world', '') called at (eval 99)[/Library/Perl/5.8.8/SOAP/Lite.pm:3170] line 423
Service::_call('Service=HASH(0xb5f974)', 'hello_world', '') called at (eval 99)[/Library/Perl/5.8.8/SOAP/Lite.pm:3170] line 453
Service::__ANON__[(eval 99)[/Library/Perl/5.8.8/SOAP/Lite.pm:3170]:454]('Service=HASH(0xb5f974)', '') called at mav_test.pl line 4
RESPONSE SUCCESS:
SOAP::Transport::HTTP::Client::send_receive: POST <a href="https://testing.maventa.com/api/api">https://testing.maventa.com/api/api</a> HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 525
Content-Type: text/xml; charset=utf-8
SOAPAction: "/api/api/hello_world"
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:typens="urn:ActionWebService" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><typens:hello_world><c-gensym3 xsi:type="xsd:string" /></typens:hello_world></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Cache-Control: private
Connection: keep-alive
Date: Tue, 17 Mar 2009 10:16:37 GMT
ETag: "99802561097c0cb156b13c86f032f9a1"
Server: nginx/0.4.13
Content-Length: 477
Content-Type: text/xml; charset=UTF-8
Client-Date: Tue, 17 Mar 2009 10:16:37 GMT
Client-Peer: 83.150.87.210:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /C=US/O=Equifax Secure Inc./CN=Equifax Secure Global eBusiness CA-1
Client-SSL-Cert-Subject: /C=FI/O=*.maventa.com/OU=GT91953765/OU=See <a href="http://www.rapidssl.com/resources/cps">www.rapidssl.com/resources/cps</a> (c)08/OU=Domain Control Validated - RapidSSL(R)/CN=*.maventa.com
Client-SSL-Cipher: AES256-SHA
Client-SSL-Warning: Peer certificate not verified
Content-Disposition: inline
Content-Transfer-Encoding: binary
Status: 200 OK
X-Runtime: 0.02168
<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:hello_worldResponse xmlns:n1="urn:ActionWebService"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="xsd:string">Hello world!</return>
</n1:hello_worldResponse>
</env:Body>
</env:Envelope>
|
|
|
Hej igen! Okej, problemet identifierat och fixat. Det var så, att det var ett server-side problem. Av någon anledning svarade inte två av noderna i klustret, som orsakade “Connection refused”. Nu är det åtgärdat och testningarna kan fortsätta. Tack ska du ha René :) |
|
|
Hej Kim, Fint att felet är fixat! Jag som först misstänkte att felet var i SOAP::Lite.. Tack igen för att ni fixade felet! h. René |
|
|
Hej igen, Det ser fortfarande ut att vara nåt strul med SOAP-förbindelsen. När jag kör den här hello_worl script, får jag 16.000 rader av debug-information. Skripten i sig själv får rätt svar, men 16.000 onödiga anrop är lite väl mycket.. maventa_test.pl #!/usr/bin/perl -w Ni kan kolla debug-loggen här: Kan det månne bero på nån proxy som ni har mellan webservern och era noder? h. René |
|
|
Helt normalt. Först tar ju skriptet in WSDL-filen och generar bindningarna till api metoderna (SOAP::Data::new: ()) som du kan direkt använda i ditt skript. När skriptet avslutas så töms SOAP::Lite objektet och bindingarna försvinner (SOAP::Data::DESTROY: ()). Detta beror på att du använder “service”.
my $soap = SOAP::Lite -> service('https://testing.maventa.com/api_net/wsdl/');
print $soap -> hello_world(%api_keys), ”\n”;
Om du byter om till att använda “proxy” i stället, så laddas inte WSDL:n ner, utan du anropar metoderna manuellt.
my $soap = SOAP::Lite -> proxy('https://testing.maventa.com/api_net/api_net/');
print $soap -> hello_world(%api_keys), ”\n”;
WSDL-filen tas in bara en gång och metoderna kan användas så länge du har ditt SOAP::Lite objekt i minnet (dvs, tills skriptet avslutas). |