problem sending text in complexType with mixed=true attribute

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

 



Hello,

The definition of the type from the wsdl is:

<s:complexType name="LocalizedProductText">
  <s:annotation>
    <s:documentation>
      One locale's descriptions and marketing info for a product.
    </s:documentation>
  </s:annotation>
  <s:sequence maxOccurs="1" minOccurs="1">
    <s:element name="descriptions" type="tns:CustomDescriptions"/>
    <s:element name="marketingDescription" type="tns:MarketingDescription"/>
  </s:sequence>
  <s:attribute name="language" type="s:string" use="required"/>
  <s:attribute name="country" type="s:string" use="required"/>
</s:complexType>

<s:complexType name="CustomDescriptions">
  <s:annotation>
    <s:documentation>A collection of descriptions for the 
      product.
    </s:documentation>
  </s:annotation>
  <s:sequence>
    <s:element maxOccurs="unbounded" minOccurs="0" name="description" 
type="tns:CustomDescription"/>
  </s:sequence>
</s:complexType>

<s:complexType mixed="true" name="CustomDescription">
  <s:annotation>
    <s:documentation>
	One of several possible descriptions for this product. A product description 	
	has a type and a text description. The text is in the	body of this element.
    </s:documentation>
  </s:annotation>
  <s:attribute name="type" type="s:int">
    <s:annotation>
      <s:documentation>Product types like 1, 2, 3, etc.</s:documentation>
    </s:annotation>
  </s:attribute>
</s:complexType>

<s:complexType mixed="true" name="MarketingDescription">
  <s:annotation>
    <s:documentation>HTML text that describes the product's 
features.</s:documentation>
  </s:annotation>
</s:complexType>

If I have $data = array(
  'language' => 'en',
  'country' => 'us',
  'description's => array(
    0 => array(
      'type' => 2,
      'text here'
    )
  ),
  'marketingDescription' => 'description goes here'
);

I am ending up with the following in the request:

<ns1:locale language="en" country="us"><ns1:descriptions><ns1:description 
type="2"/></ns1:descriptions><ns1:marketingDescription/></ns1:locale>

However, it should look like:
<ns1:locale language="en" country="us"><ns1:descriptions><ns1:description 
type="2">text 
here</ns1:description></ns1:descriptions><ns1:marketingDescription>description 
goes here</ns1:marketingDescription></ns1:locale>

As you can see, marketingDescription is empty, and for the other description 
the type is pulled in, but not the text.  How do I need to stucture the 
request get it to work right?

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

  Powered by Linux