Complex Objects over SOAPP (PHP to Java)-> newbie

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

As my first tries with webservices were finally successful, 
I am now trying to get my conception working. 

The Web Services had to be the smallest part in that (just for transporting)
but they already became the biggest problem in my whole work.

I am working on a Wrapper(built in PHP)-Mediator(built in
Java)-Wrapper(built in PHP) Connection. 
The Source-Wrapper and the Mediator have to offer the Services, while the
Destination Wrapper is only client. The Mediator - in the first rudimentary
version - does nothing but simply pass the requests of the client
(dest-wrapper) to the source-wrapper ('source' means source for courses,
which flow to the other direction). This whole thing should make it possible
to send requests from one LMS to some others (over a mediator) and receive
Binaries (Courses) over the connection by request. 

I have already successfully established a WS-connection between one Wrapper
as Client and the Mediator (Java on Tomcat) as a test, but beside the
problem that the connection PHP-Java-PHP is not working the whole line up,
yet, I've got the feeling (because of some part of the strange SOAP/SAX
Faults), my PHP Objects are not accepted by the Java-Implementation. So
maybe, I have not transfered them rightly. 

I've found poor informations about this in the internet. In Java you can
build Stubs for the access automatically, which includes the Objects to keep
your hands clean from the dirty work. I know about the ability of PHP to
generate some code right from the WSDL, but it is possible to get the needed
objectstructure, too ?

In my tests, I've already received the object from Java, that I now want to
pass in the other direction. I've made a print_r and var_dump and received
pretty good information, how to work with it and to extract the information
out of it. 

In Java, the object (I named it PropertyObject) is a Java-Class which simply
includes some Strings and Arrays of two other objects, AuthorObject and
CategoryObject (I need this to specify the courses). When I receive this (it
s an Array of Property Object), PHP classifies it as a complex combination
of std_objects and arrays. Well, there s no problem for me to work with
that.

The other direction works indeed less well than this. I made a PHP class
'PropertyObject', 'AuthorObject' and 'CategoryObject' (Parameternames inside
were the same as specified in the WSDL File) and combinated all like it was
demanded by the WSDL (PropertyObject holds Strings and arrays for each of
the other two objects). Now I wrote this code to pass one PropertyObject
over SOAP to the (Java-)Mediator :



$wsdlUrl = 'http://<my-mediator-serviceaddress>?wsdl';
$WSDL               = new SOAP_WSDL($wsdlUrl); 
$soapClient   = $WSDL->getProxy();  
$sessionID = "999";    // not important, yet
	
$params = array(
       "sessionID"  => $sessionID,   // simple string
       "categoryID" => $categoryID,  // simple string
       "query"      => $searchPO,    // this is a property-object object ,

                                     // straight as it was defined,
                                     // instanciated from its class in PHP
                                     // and filled with values for a search
        );                 	    	            

// the result is an array of property objects
$PropertyObjectArray = $soapClient->searchCourses($params); 


Well, it was not working, when I passed the values as one array, because the
fault message told me, there were parameter two and three missing. So I
changed the last line of the code to : 

$PropertyObjectArray = $soapClient->searchCourses($sessionID, $categoryID,
$searchPO);

This seemed to be better, because missing parameters were not a problem
anymore. Regardless of this, the Fault told me, that there were a problem
analysing the Object, because it was not recognized and couldn't be parsed
by SAX (well, something like this). 

Please, if there has to be another proceeding to have a successful
transmission of my PropertyObject, please let me know, I need this.
(I wish, I would not be sticked to that, but my whole works depends on a
successful implementation :(     )

Thanx for help !
Thanx in advance !!

Regards, Arne

(P.S. It is late now, but if anyone wants the whole SOAP Fault, I will
reproduce the error tomorrow (almost 2 o'clock ... well, in the morning) and
send it by request to the list)

-- 
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux