Re: SoapVar and Encoding

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

 



Thanks for the reply, it helps but dont quite solve the problem that I
have. Though it was a reply to solve the precise layout I had written
down. The scenario is a bit more complex though and I will do a better
job to explain it this time.

The XML snippet was a part of the message I am trying to pass and not
the complete message.

The complete part have a layout like this.

-----
<ns1:whatWeWannaDo>
  <baseOne>
    ... cut some stuff
  </baseOne>

  <baseTwo>
    <information>SomeInfo</information>
    <date>SomeDate</date>
    <time>SomeTime</time>
         <lineItem> -- 1 to n amount of lineItems
      <name>A</name>
      <type>B</type>
      <form>C</form>
    </lineItem>
         <lineItem>
      <name>A</name>
      <type>B</type>
      <form>C</form>
    </lineItem>
         <lineItem>
      <name>A</name>
      <type>B</type>
      <form>C</form>
    </lineItem>
  </baseTwo>
</whatWeWannaDo>

As you can see there can be 1 to n amount of lineItems and then I have
created classes for this in the following fashion. Only writing down the
variables with names and not the creating functions.

class whatWeWannaDo
{
  $baseOne
  $baseTwo
}

class baseOne
{
  ... some stuff
}

class baseTwo
{
  $information
  $date
  $time
  $lineItem = array();
}

class lineItem
{
  $name
  $type
  $form
}

And when instantiating this I use

$bOne = new baseOne();
$bOne->setVals(... vals);

$bTwo = new baseTwo();
...

while(-- we have more lineItems -- )
{
  $item = new lineItem()
  $item->setValues(A, B, C);
  bTwo->lineItem[] = new SoapVar($item, SOAP_ENC_OBJECT, '', '');
}


$bOne = new SoapVar($bOne, SOAP_ENC_OBJECT, '', '');
$bTwo = new SoapVar($bTwo, SOAP_ENC_OBJECT, '', '');

$whatWeWanna = new whatWeWannaDo($bOne, $bTwo)
$whatWeWannaDo = new soapVar($whatWeWannaDo, SOAP_ENC_OBJECT,
'whatWeWannaDo', 'namespace');

$soapClient->whatWeWannaDo($whatWeWannaDo);

-----
As you can see from the above snippet/stub there should be no
specifically set namespace on the parts below <ns1:whatWeWannaDo>.

And the problem I get with this is that instead of getting the layout as
described above I get the following.

-----
<ns1:whatWeWannaDo>
  <baseOne>
    ... cut some stuff
  </baseOne>

  <baseTwo>
    <information>SomeInfo</information>
    <date>SomeDate</date>
    <time>SomeTime</time>
         <lineItem> -- 1 to n amount of lineItems
      <SOAP-ENC:STRUCT>
        <name>A</name>
        <type>B</type>
        <form>C</form>
      </SOAP-ENC:STRUCT>
      <SOAP-ENC:STRUCT>
        <name>A</name>
        <type>B</type>
        <form>C</form>
      </SOAP-ENC:STRUCT>
      <SOAP-ENC:STRUCT>
        <name>A</name>
        <type>B</type>
        <form>C</form>
      </SOAP-ENC:STRUCT>
    </lineItem>
  </baseTwo>
</whatWeWannaDo>
-----
This do more detailed describe my problem. Where I do not know how to
store the 1 to n amount of lineItems in another way then an array to get
them all stored. And the array aint translated into lineItem parts but
one part with SOAP-ENC:STRUCT parts below it.

Any suggestions on how to solve this?

And the WSDL that demands this format is out of my control and
automagically generated by JBoss.

All any any suggestions on how to solve this issue is appreciated. Did a
try with nusoap aswell, which worked to the extent that it put the
structure correct but lost the namespace instead.

And since it was time to upgrade from php4 to php5 this looked like a
good solution for it. Though having some kinx as you can see.

/Roine Edmundsson

-- 
View this message in context: http://www.nabble.com/Re%3A-SoapVar-and-Encoding-tp12254344p15200694.html
Sent from the Php - Soap mailing list archive at Nabble.com.

-- 
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