Hi Joanna,

The extra layer of <arrival> is because you used name='arrival' on the 
<collection> element in your binding. This says you want to use 
<arrival> as a wrapper element around the items in the collection.

As to the namespace, isn't there a <namespace> definition in your 
binding that you didn't show? I'd expect there to be one to create this 
added namespace declaration. If you can show the <schema> element from 
your WSDL (with targetNamespace and elementFormDefault attributes) along 
with any <namespace> element in the binding it'd help.

You're using the -uw flag to unwrap the WSDL in WSDL2Java, right? Then 
the abstract <mapping> for event-type is what you want.

  - Dennis

Dennis M. Sosnoski
SOA and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Joanna Muench wrote:
> Thanks for getting back to me Dennis. Removing the abstract from the arrival 
> mapping and going from name to type-name fixed that mapping problem.
>
> Close... but not there yet. Probably related to the eventType being abstract 
> and 
> how the collection is generated via the wsdl. One problem is an extra layer 
> of 
> <arrival>, the other is the addition of a namespace qualifier to the first 
> arrival element:
>
> <returnedEvent>
>      <localid>2</localid>
>      <location>Oregon Coast</location>
>      <prefOrigin>12</prefOrigin>
>      <author>UW Geophysics</author>
>      <arrival xmlns="http://www.iris.edu/phasepick/xsd";>
>        <arrival>
>          <station>SUW</station>
>          <distance>402.7</distance>
>          <phase>P</phase>
>       ...
>        <arrival>
>        <arrival>
>         ...
>        <arrival>
>      </arrival
> </returnedEvent>
>
> Within the wsdl this response is
>
> <element name="eventFinderResponse">
>    <complexType>
>      <sequence>
>       <element maxOccurs="unbounded" name="returnedEvent" 
> type="xsd:eventType"/>
>      </sequence>
>    </complexType>
> </element>
>
> Is the solution to create an EventFinderResponse with a non-abstract mapping 
> to 
> wrap the eventTypes in?
>
> Thanks, Joanna
>
> PS the current state of the binding is:
>
>    <mapping name="arrival" class="edu.iris.ws.phasepick.Arrival">
>      <value name="station" field="station"/>
>      <value name="distance" field="distance"/>
>      <value name="phase" field="phase"/>
>      <value name="azimuth" field="azimuth"/>
>      <value name="author" field="author"/>
>      <value name="arrivalTime" field="arrivalTime"/>
>    </mapping>
>
>    <mapping type-name="xsd:eventType" abstract="true" 
> class="edu.iris.ws.phasepick.Event">
>      <value name="localId" field="id"/>
>      <value name="location" field="location"/>
>      <value name="prefOrigin" field="prefOrigin"/>
>      <value name="author" field="author"/>
>      <collection name="arrival" field="arrivals"/>
>    </mapping>
>
>
>
> Dennis Sosnoski wrote:
>   
>> Hi Joanna,
>>
>> It looks like you're getting a somewhat unintended side-effect of the 
>> abstract mapping in your second binding, with the collection as a 
>> separate mapping. Abstract mappings aren't really intended to be used 
>> directly as collection item types, and I should probably have a 
>> validation check to catch it when this is done. The intended ways to do 
>> what you want are (1) make the Arrival mapping concrete, with a name 
>> specified on the <mapping>, in which case the collection can reference 
>> it directly as an item-type, or (2) keep the Arrival mapping abstract, 
>> and add a child element to the collection:
>>
>>   <collection field="...">
>>     <structure name="arrival" type="... Arrival"/>
>>   </collection>
>>
>> If either of these approaches doesn't work for you I'd appreciate a Jira 
>> bug report with the specifics. Thanks,
>>
>>   - Dennis
>>
>> Dennis M. Sosnoski
>> SOA and Web Services in Java
>> Training and Consulting
>> http://www.sosnoski.com - http://www.sosnoski.co.nz
>> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>>
>>
>>
>>     
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>
>   

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to