ptoki
Bo sie chlastam z jednym problemem.
Kod wyglada tak:
$soap= SOAP::Lite
-> proxy('http://webserwis')
-> uri('')
-> doSelect(
SOAP::Data->name(where=> 'serial_number like \'costam%\''),
SOAP::Data->name(maxRows => '10'),
SOAP::Data->name("attributes" =>
\SOAP::Data->value(
SOAP::Data->name("string" => 'serial_number'),
SOAP::Data->name("string" => 'name')
)
));
if ($soap->fault) {
print $soap->faultcode, " ", $soap->faultstring, "\n";
}
print "-------------------------------------------\n";
if ( $soap->match('//Attributes')){
print "cos\n";
} else {
print "soc\n";
}
Zwracany jest taki xml:
<?xml version="1.0" encoding="UTF-8"?>
<UDSObjectList>
<UDSObject>
<Handle>nr:949CEB8F07B4AE4A8202CB2F614ED862</Handle>
<Attributes>
<Attribute DataType="2002">
<AttrName>serial_number</AttrName>
<AttrValue>costam1</AttrValue>
</Attribute>
<Attribute DataType="2002">
<AttrName>name</AttrName>
<AttrValue>ble1</AttrValue>
</Attribute>
</Attributes>
</UDSObject>
</UDSObjectList>
No i teraz:
print $soap->faultcode, " ", $soap->faultstring, "\n";
Dziala ok.
if ( $soap->match('//Attributes')){
print "cos\n";
} else {
print "soc\n";
}
Caly czas ewaluowane jest na false (wykonywane jest else).
Jak zrobie print $soap->result; to dostaje wydruk calego xml-a ale ref() twierdzi ze to HASH.
Robie proste testy z tutoriali i nie dzialaja.
A co mi potrzeba?
Ano to ze ten xml potrzebuje zamienic na tabelke i miec dostep do parek serial_number, name.
Chcialem to zrobic "normalnie" jakims iteratorem napisanym wlasnorecznie ale nie mam pewnosci ze ten XML zawsze bedzie taki elegancki.
Ma ktos pod reka dzialajacy przyklad takiego kodu?
Kod wyglada tak:
$soap= SOAP::Lite
-> proxy('http://webserwis')
-> uri('')
-> doSelect(
SOAP::Data->name(where=> 'serial_number like \'costam%\''),
SOAP::Data->name(maxRows => '10'),
SOAP::Data->name("attributes" =>
\SOAP::Data->value(
SOAP::Data->name("string" => 'serial_number'),
SOAP::Data->name("string" => 'name')
)
));
if ($soap->fault) {
print $soap->faultcode, " ", $soap->faultstring, "\n";
}
print "-------------------------------------------\n";
if ( $soap->match('//Attributes')){
print "cos\n";
} else {
print "soc\n";
}
Zwracany jest taki xml:
<?xml version="1.0" encoding="UTF-8"?>
<UDSObjectList>
<UDSObject>
<Handle>nr:949CEB8F07B4AE4A8202CB2F614ED862</Handle>
<Attributes>
<Attribute DataType="2002">
<AttrName>serial_number</AttrName>
<AttrValue>costam1</AttrValue>
</Attribute>
<Attribute DataType="2002">
<AttrName>name</AttrName>
<AttrValue>ble1</AttrValue>
</Attribute>
</Attributes>
</UDSObject>
</UDSObjectList>
No i teraz:
print $soap->faultcode, " ", $soap->faultstring, "\n";
Dziala ok.
if ( $soap->match('//Attributes')){
print "cos\n";
} else {
print "soc\n";
}
Caly czas ewaluowane jest na false (wykonywane jest else).
Jak zrobie print $soap->result; to dostaje wydruk calego xml-a ale ref() twierdzi ze to HASH.
Robie proste testy z tutoriali i nie dzialaja.
A co mi potrzeba?
Ano to ze ten xml potrzebuje zamienic na tabelke i miec dostep do parek serial_number, name.
Chcialem to zrobic "normalnie" jakims iteratorem napisanym wlasnorecznie ale nie mam pewnosci ze ten XML zawsze bedzie taki elegancki.
Ma ktos pod reka dzialajacy przyklad takiego kodu?
