My first suggestion (defining the repeating field on the <sequence>) is the proper way to describe the SOAP response you are receiving. But perhaps WSDL2Java doesn't support this structure. I don't know how to tell Axis how to deal with a set of repeating elements that aren't defined as a single element. That's why I suggested that you define a bean (event) to represent the repeating fields. But that would require a change in your service. The challenge you have is that two of the fields in your response are not repeating fields. Java doesn't really work this way.
Anne On 7/3/05, Chris Averia <[EMAIL PROTECTED]> wrote: > Hi Anne, > > I tried your 2 suggestions. > > For Suggestion No. 1, WSDL2Java generated a class called > LogGetEventsResponse. Included are all the elements defined such as acctId, > eventDt, eventCd...but all of the variables are all single instance. How > can I make this as an array? > > For suggestion No.2, WSDL2Java generated a class called Event as well as an > EventArrayHolder. However, it is expecting an element called "event" in the > Soap response so that it could dederailize it properly to the array. > > How can I modify the WSDL file to properly deserailize the Soap response > that I have included below? > > Thanks a lot. > > > Anne Thomas Manes <[EMAIL PROTECTED]> wrote: > Your schema defines each element in the response as an array, but your > response is not returning the array elements as arrays. Instead it is > returning groups of elements as arrays. I suggest that you modify the > schema to reflect the expected response. Something like this: > > <s:element name="LogGetEventsResponse"> > <s:complexType> > <s:sequence> > <s:sequence minOccurs="1" maxOccurs="200"> > <s:element name="accountId" type="s:unsignedInt" /> > <s:element name="eventDt" type="s:dateTime" /> > <s:element name="eventCode" type="s:unsignedInt" /> > <s:element name="eventSrc" type="s:unsignedInt" /> > <s:element name="status" type="s:unsignedInt" /> > <s:element name="errorSrcPeriod" type="s:unsignedInt" /> > <s:element name="errorSeverity" type="s:unsignedInt" /> > <s:element name="adminUserId" type="s:unsignedInt" /> > <s:element name="serverId" type="s:unsignedInt" /> > <s:element name="sessionId" type="s:unsignedInt" /> > <s:element name="InEndDt" type="s:dateTime" /> > <s:element name="OutStartDt" type="s:dateTime" /> > <s:element name="OutEndDt" type="s:dateTime" /> > <s:element name="MsgIn" type="s:unsignedInt" /> > <s:element name="MsgOut" type="s:unsignedInt" /> > <s:element name="BytesIn" type="s:unsignedInt" /> > <s:element name="BytesOut" type="s:unsignedInt" /> > <s:element name="CmdsIn" type="s:unsignedInt" /> > <s:element name="CmdsOut" type="s:unsignedInt" /> > <s:element name="AdnCount" type="s:unsignedInt" /> > <s:element name="transactionId" type="s:string" /> > <s:element name="extSessionInfo" type="s:string" /> > </s:sequence> > <s:element minOccurs="1" maxOccurs="1" name="result" type="s:int" > /> > <s:element minOccurs="0" maxOccurs="1" name="resultCause" > type="s:string" /> > </s:sequence> > </s:complexType> > </s:element> > > Or you might want to create an element (and a matching bean) called > event, and use this element to specify the array, such as: > > <s:element name="event"> > <s:complexType> > <s:sequence> > <s:element name="accountId" type="s:unsignedInt" /> > <s:element name="eventDt" type="s:dateTime" /> > <s:element name="eventCode" type="s:unsignedInt" /> > <s:element name="eventSrc" type="s:unsignedInt" /> > <s:element name="status" type="s:unsignedInt" /> > <s:element name="errorSrcPeriod" type="s:unsignedInt" /> > <s:element name="errorSeverity" type="s:unsignedInt" /> > <s:element name="adminUserId" type="s:unsignedInt" /> > <s:element name="serverId" type="s:unsignedInt" /> > <s:element name="sessionId" type="s:unsignedInt" /> > <s:element name="InEndDt" type="s:dateTime" /> > <s:element name="OutStartDt" type="s:dateTime" /> > <s:element name="OutEndDt" type="s:dateTime" /> > <s:element name="MsgIn" type="s:unsignedInt" /> > <s:element name="MsgOut" type="s:unsignedInt" /> > <s:element name="BytesIn" type="s:unsignedInt" /> > <s:element name="BytesOut" type="s:unsignedInt" /> > <s:element name="CmdsIn" type="s:unsignedInt" /> > <s:element name="CmdsOut" type="s:unsignedInt" /> > <s:element name="AdnCount" type="s:unsignedInt" /> > <s:element name="transactionId" type="s:string" /> > <s:element name="extSessionInfo" type="s:string" /> > </s:sequence> > &nb sp; </s:complexType> > > </s:element> > <s:element name="LogGetEventsResponse"> > <s:complexType> > <s:sequence> > <s:element minOccurs="1" maxOccurs="200" ref="event" /> > <s:element minOccurs="1" maxOccurs="1" name="result" type="s:int" > /> > <s:element minOccurs="0" maxOccurs="1" name="resultCause" > type="s:string" /> > </s:sequence> > </s:complexType> > </s:element> > > Anne > > On 7/1/05, Chris Averia <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > I have attached the WSDL file that I compiled using wsdl2Java. This > file > > contains a Soap call definition that expects arrays as return values. > > > > However, I always encounter that the size of the return arrays are > always 1. > > Can somebody point me to the right direction? BTW, Im using Axis1.2 > final. > > > > Here is the actual Soap Response: > > > > <?xml version="1.0" encoding="UTF-8"?> > > <soapenv:Envelope > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> > > .<soapenv:Body> > > ..<LogGetEventsRe sponse xmlns="http://foo.com/foo1.0/"> > > > ...<accountId>83</accountId> > > ...<eventDt>2005-05-27T03:08:26</eventDt> > > ...<eventCode>109</eventCode> > > ...<eventSrc>4</eventSrc> > > ...<status>1</status> > > ...<adminUserId>99</adminUserId> > > ...<accountId>83</accountId> > > ...<eventDt>2005-05-27T03:07:59</eventDt> > > ...<eventCode>105</eventCode> > > ...<eventSrc>4</eventSrc> > > ...<status>1</status> > > ...<adminUserId>99</adminUserId> > > ...<accountId>83</accountId> > > ...<eventDt>2005-05-27T03:07:58</eventDt> > > ...<eventCode>102</eventCode> > > ...<eventSrc>4</eventSrc> > > ...<status>1</status> > > ...<adminUserId>99</adminUserId> > > ...<accountId>83</accountId> > > ...<eventDt>2005-05- > > 27T03:07:58</event Dt>...<eventCode>104</eventCode> > > ...<eventSrc>4</eventSrc> > > ...<status>1</status> > > ...<adminUserId>99</adminUserId> > > ...<accountId>83</accountId> > > ...<eventDt>2005-05-27T03:07:58</eventDt> > > ...<eventCode>103</eventCode> > > ...<eventSrc>4</eventSrc> > > ...<status>1</status> > > ...<adminUserId>99</adminUserId> > > ...<result>1</result> > > ..</LogGetEventsResponse> > > .</soapenv:Body> > > </soapenv:Envelope> > > > __________________________________________________ > Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com
