• Post Reply Bookmark Topic Watch Topic
  • New Topic

Eclipse SOAP message not generated as expected  RSS feed

 
Tony Peterman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have generated java classes to support a WS Client from a WSDL a portion of the WSDL is causing some issues on the output XML.

<s:complexType name="DataRecord">
                <s:sequence>
                    <s:element minOccurs="0" maxOccurs="1" name="Values" type="tns:ArrayOfAnyType" /><!-- Testing Array of String 8/29/2016  -->
                </s:sequence>
            </s:complexType>
            <s:complexType name="ArrayOfAnyType">
        <s:sequence>
          <s:element minOccurs="0" maxOccurs="unbounded" name="anyType" nillable="true" type="s:string" />
        </s:sequence>
the output from this looks as follows:

<DataRecord>
                <Values>
                  <anyType>1234</anyType>
                  <anyType>test@test.com</anyType>
                </Values>
              </DataRecord>
should look like this:

<DataRecord>
            <Values>
              <anyType xsi:type="xsd:string">1234</anyType>
              <anyType xsi:type="xsd:string">test@test.com</anyType>
            </Values>
          </DataRecord>
I suspect there is something simple here that is causing this issue, but I need someone smarter than me to point out what I am missing.

thanks,

Tony
 
g tsuji
Ranch Hand
Posts: 697
3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When you define the element anyType with type="s:string", its type is statically fixed. Consequently there won't be the need to convey its concrete type dynamically and hence the message transmitted would look like shown in the concrete:

If you intend to render it with a more general s:anyType, and cast it to the concrete string sub-type, you could take out the type attribute in the definition of the element anyType, like this.

In that case, when your ws consumer establish its content as String, the message would dynamically type it with xsi:type to preserve the information and to make that information available to the server-side code.

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!