NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
dmitri (site admin)? New member need help on attributes


Joined: 16 Jan 2007
Posts: 3
Reply with quote
Hello everyone,

New member and first post to any forum. I am not sure who to ask, so dmitri must be the one. I am using nusoap and don't know how to add attributes using addComplexType. I search everywhere and can't get any answers. It is possible using addComplexType for this xml document:

<Property>
<Identification type="house" rentalType="">
<Address></Address>
<City></City>
</Identification>
</Property>

The addComplexType below work without type="house" rentalType="":

$server->wsdl->addComplexType(
'Property',
'complexType',
'struct',
'all',
'',
array(
'Identification' => array(
'Address' => array('name' => 'Address', 'type' => 'xsd:string'),
'City' => array('name' => 'City', 'type' => 'xsd:string')
)
)
);

Again, how do you add the type="house" rentalType="" to the <Identification> above? Please help if you can.

Many thanks
View user's profileFind all posts by kellyp2424Send private message


Joined: 16 Jan 2007
Posts: 3
Reply with quote
I guess is not possible? Anyone? Help....?
View user's profileFind all posts by kellyp2424Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
normally, you won't see any tag attributes in the soap envelopes except namespaces and types. I know no way on how to handle custom attributes like in your case. Perhaps, you'll have to write envelope in php yourself, instead of relying on soapclient->call() method.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Thanks dmitri. What is your point of view?


Joined: 16 Jan 2007
Posts: 3
Reply with quote
Thanks dmitri for the quit reply. I would like to know how you would go about returning a XML Document to a client. The remote client expect a xml document like this:

<Property>
<Identification type="house" rentalType="">
<Address></Address>
<City></City>
</Identification>
</Property>

Are there other ways beside writing my own envelope(I will look into this)? I just want to know what is the correct and most efficient way of doing this.

Thanks agin
View user's profileFind all posts by kellyp2424Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
You can easily trace how SOAP envelope is created and transmitted to the far end using any working sample posted in this forum and debugging them in NuSphere PhpED. Start with ->call() method call and see what it does around arguments and WSDL tree parsed earlier.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Apr 2008
Posts: 10
Reply with quote
Hi,

I am not sure if you are asking for this, just have a look.

Code:

$server->wsdl->addComplexType
    (
        'Property',,
        'complexType',
        'array',
        'sequence',
        '',
        array
        (
            'Identification' => array
            (
                'type'           => 'house',
                'rentalType' => ''
            ),
            .....
        )
    );


Regards,

Dave
View user's profileFind all posts by naimish_hitSend private message
dmitri (site admin)? New member need help on attributes
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic