SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Soap and complex typs

    Hello

    I'm working a lot with Webservices provided by an ASP.NET application. Everything works fine, but I have one annoying thing concerning the transport of objects.

    An example of an object design:

    Code:
    Order Object(
    	ID
    	Period
    	Customer => Customer Object(
    		ID
    		Name
    		FirstName
    	)
    
    	Domains => Array(
    			Domain Object(
    				DomainName
    				Period
    			)
    	)
    )
    This is the object I pass to my webservice, this works fine.

    But the objects returned from the webservice (interpreted by PHP) looks like this:

    Code:
    stdClass Object(
    	ID
    	Period
    	Customer => stdClass Object(
    		ID
    		Name
    		FirstName
    	)
    
    	Domains => stdClass Object(
    		[Domain] = Array(
    			stdClass Object(
    				DomainName
    				Period
    		)
    	)
    }
    You see, I can't talk to the object the way I can talk to my first object. Everything is put in a stdClass Object, Is there a way to make this a nice looking object like my first?
    In my opinion it's useless to write a mapper class for objects returned from my webservice.

    I'm using PHP5 built in Soap support. I already tried to pass a classmap via the options array, but that didn't help.

    Any ideas?

  2. #2
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Same Problem. Going to Use Mapper

    Hi,

    Im migrating a PHP4 soap client to PHP5 and have run into this exact same problem. Being on a time limit it looks like im going to have to write a Mapper.

    Have you had any futher luck with this?

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Further to my last response, a friend of mine just pointed to the following reference:

    http://bugs.php.net/bug.php?id=31869

    I havnt tried it yet, but it looks like a solution to the problem.

  4. #4
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just tested this with PHP-5.0.3 and latest CVS versions. Works fine for me.
    I'm working with version PHP 5.1.6, and I still have the problem...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •