I'm far from a WSDL guru, but could you do something like this?
<xsd:complexType name="xds:eCommercePromosOperation>
<xsd:all>
<xsd:element name="inSKU" type="xsd:string">
<xsd:element name="inPromoNum" type="xsd:string">
<xsd:element name="inZip" type="xsd:string">
</xsd:all>
</xsd:complexType>
<xsd:complexType name="eCommercePromosOperationArray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns: eCommercePromosOperation [10]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="eCommerceStoreInput">
<xsd:all>
<xsd:element name="inStore" type="xsd:string"/>
<xsd:element name=" eCommercePromosOperations" type="tns: eCommercePromosOperationArray "/>
</xsd:all>
</xsd:complexType>
<message name="get eCommerceStuff"><part name="ineCommerceStoreInput " type="tns: eCommerceStoreInput "/>
</message>
In my mind that will create a an 10 element array of the element eCommercePromosOperation.
Then your element eCommerceStoreInput would contain your inStore element and the array element.
-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Thursday, March 06, 2014 11:18 AM
To: Web Enabling the AS400 / iSeries
Subject: [WEB400] WSDL - Mix simple and complex types
Ok...I've worked with WSDLs to define web services, but it's always been the clone and go type model. I'm running into a problem now that I can't seem to resolve. Here's the gist: I want to have a web service that accepts a store number, and then up to 10 groups of SKU, promo and zip. I'm trying
this:
<xsd:element name="inStore">
<xsd:simpleType>
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
</xsd:element>
<xsd:element name="eCommercePromosOperation"> <xsd:complexType> <xsd:sequence minOccurs="1" maxOccurs="10"> <xsd:element name="inSKU" type="xsd:string"></xsd:element> <xsd:element name="inPromoNum" type="xsd:string"></xsd:element> <xsd:element name="inZip" type="xsd:string"></xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element>
But SoapUI only shows the complex type, like this (in the request):
<ecom:eCommercePromosOperation>
<inSKU>?</inSKU>
<inPromoNum>?</inPromoNum>
<inZip>?</inZip>
</ecom:eCommercePromosOperation>
Any ideas? Thanks!
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list To post a message email: WEB400@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/web400.
As an Amazon Associate we earn from qualifying purchases.