You are not logged in.

  • Login

1

Wednesday, July 25th 2007, 8:24am

WSDL Webservice: Undefined property: stdClass

Hi zusammen,

Ich möchte aus dem Webservice gerne etwas auslesen, hier der Teil der WSDL dazu:

XML Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetAllOutboundUsersResponse xmlns="DIENST">
      <OutboundUser_x005B__x005D_>
        <FirstName>string</FirstName>
        <LastName>string</LastName>
        <TelephoneNumber>string</TelephoneNumber>
        <MobilePhoneNumber>string</MobilePhoneNumber>
        <EmailAddress>string</EmailAddress>
        <AccountingCode>string</AccountingCode>
        <CoverPage>string</CoverPage>
        <Culture>string</Culture>
        <OnSuccessReplyTo>string</OnSuccessReplyTo>
        <OnFailureReplyTo>string</OnFailureReplyTo>
        <Archiving>boolean</Archiving>
        <FaxHeader>string</FaxHeader>
        <Custom1>string</Custom1>
        <Custom2>string</Custom2>
      </OutboundUser_x005B__x005D_>
      <OutboundUser_x005B__x005D_>
        <FirstName>string</FirstName>
        <LastName>string</LastName>
        <TelephoneNumber>string</TelephoneNumber>
        <MobilePhoneNumber>string</MobilePhoneNumber>
        <EmailAddress>string</EmailAddress>
        <AccountingCode>string</AccountingCode>
        <CoverPage>string</CoverPage>
        <Culture>string</Culture>
        <OnSuccessReplyTo>string</OnSuccessReplyTo>
        <OnFailureReplyTo>string</OnFailureReplyTo>
        <Archiving>boolean</Archiving>
        <FaxHeader>string</FaxHeader>
        <Custom1>string</Custom1>
        <Custom2>string</Custom2>
      </OutboundUser_x005B__x005D_>
    </GetAllOutboundUsersResponse>
  </soap:Body>
</soap:Envelope>


Hier mein Code:

PHP Quellcode

1
2
3
4
5
6
7
8
<?php
ini_set (display_errors,"1");
$client = new SoapClient( "DIENST/Service.asmx?WSDL",array("trace" => 1, "exceptions" => 1));
$send->securityToken = $TheToken;
$myres = $client->GetAllOutboundUsers($send);
$result = $myres->GetAllOutboundUsersResponse->OutboundUser_x005B__x005D_;
print_r($result);
 ?>


Und hier die Rückgabe:


HTML Code

1
2
3
Notice: Undefined property: stdClass::$GetAllOutboundUsersResponse in /srv/www/web2/html/provisioning/show_allinbound.php on line 9
 
Notice: Trying to get property of non-object in /srv/www/web2/html/provisioning/show_allinbound.php on line 9


Kann mir jemand weiterhelfen?

Grüße,
Matthias

P.S. Ich glaube ich habe wieder einen Denkfehler wenn es darum geht ein Array auszulesen ... irgendwie check ich das nie :(

3

Wednesday, July 25th 2007, 4:21pm

Hi!

Das bringt mich schon ein Stück weiter. Hier der HTML Code der Ausgabe von var_dump:

HTML Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<b>Notice</b>:  Undefined property:  stdClass::$GetAllOutboundUsersResponse in <b>/srv/www/web2/html/provisioning/show_allinbound.php</b> on line <b>9</b><br />
object(stdClass)#3 (1) {
  ["OutboundUser_x005B__x005D_"]=>
  array(2) {
    [0]=>
    object(stdClass)#4 (14) {
      ["FirstName"]=>
      string(0) ""
      ["LastName"]=>
      string(0) ""
      ["TelephoneNumber"]=>
      string(10) "0000000000"
      ["MobilePhoneNumber"]=>
      string(0) ""
      ["EmailAddress"]=>
      string(26) "matthias.orczak@venali.com"
      ["AccountingCode"]=>
      string(0) ""
      ["CoverPage"]=>
      string(15) "Generica German"
      ["Culture"]=>
      string(0) ""
      ["OnSuccessReplyTo"]=>
      string(0) ""
      ["OnFailureReplyTo"]=>
      string(0) ""
      ["Archiving"]=>
      bool(false)
      ["FaxHeader"]=>
      string(0) ""
      ["Custom1"]=>
      string(0) ""
      ["Custom2"]=>
      string(0) ""
    }
    [1]=>
    object(stdClass)#5 (14) {
      ["FirstName"]=>
      string(6) "Andriy"
      ["LastName"]=>
      string(11) "Kalinovskyy"
      ["TelephoneNumber"]=>
      string(13) "(305)123-4567"
      ["MobilePhoneNumber"]=>
      string(13) "(305)765-4321"
      ["EmailAddress"]=>
      string(22) "matthias.orczak@web.de"
      ["AccountingCode"]=>
      string(19) "Some AccountingCode"
      ["CoverPage"]=>
      string(16) "Generica English"
      ["Culture"]=>
      string(2) "de"
      ["OnSuccessReplyTo"]=>
      string(24) "test_kalina_s@venali.com"
      ["OnFailureReplyTo"]=>
      string(24) "test_kalina_f@venali.com"
      ["Archiving"]=>
      bool(false)
      ["FaxHeader"]=>
      string(13) "%some header%"
      ["Custom1"]=>
      string(19) "Some Custom field 1"
      ["Custom2"]=>
      string(19) "Some Custom field 2"
    }
  }
}


Matthias

P.S. Also dreiminensionales array, richtig? Aber wieso komm ich nicht an die Werte? *doofschau*

4

Wednesday, July 25th 2007, 5:02pm

naja, was willst du alles haben?

PHP Quellcode

1
2
3
4
5
6
7
8
foreach($myres as $users) {
	//OutboundUser_x005B__x005D_
	foreach($outbounds as $users) {
		foreach($users as $key => $value) {
			printf('<b>%s</b>: %s%<br />', $key, $value);
		}
	}
}


Hier übrigens unsere saubere SOAP Server Implementierung: PHP SOAP Server mit WSDL und API Schlüssel

5

Wednesday, July 25th 2007, 11:26pm

Hi!

Hier nun mein "funktionierender" Code :)

PHP Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<table width="100%" border="0" align="center">
<?php
 
ini_set (display_errors,"1");
$client = new SoapClient( "http://DIENST/Service.asmx?WSDL",array("trace" => 1, "exceptions" => 1));
 
$send->securityToken = $TheToken;
$myres = $client->GetAllOutboundUsers($send);
$result = $myres->OutboundUser_x005B__x005D_;
 
$count = count($result);
echo "<table width=\"800\" border=\"1\" align=\"center\">";
for($i=0; $i < $count; $i++) {
echo "<tr>";
echo "<td>".$result[$i]->LastName." ".$result[$i]->FirstName."</td>";
echo "<td>".$result[$i]->EmailAddress . "</td>";
echo "</tr>";
 
}
echo "</table>";
 
?>
<center> Es wurden <?php echo $count; ?> Datensätze gefunden </center>

Similar threads

Social bookmarks