InfoPath 2003 and Axis web service with Arrays - InfoPath Dev
in

InfoPath Dev

InfoPath 2003 and Axis web service with Arrays

Last post 05-02-2007 08:47 AM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-06-2007 08:48 AM

    InfoPath 2003 and Axis web service with Arrays

    Hi ,
    InfoPath looks great in terms of usage and building a form quickly. how ever i am facing a problem while working on web service which returns 2 dimentional data.
    I am using InfoPath 2003 (as client) and Tomcat Axis 1.2 as web service provider.

    I have to return below data structure to the client.

    Part.num Part.Name Part.Rev Part.Attribute1 Part.Attribute2......n
    row1
    row2
    ...
    etc

    I have created 2 beans in java.
    PartBean
    AttributeBean

    PartBean has fields like below
    String number;
    String name ;
    String rev ;
    AttributeBean[] attributes;

    AttributeBean has fields like
    String name;
    String value;
    String attibuteType;
    ...etc

    i have created a web service "executePartsSearch()" which returns PartBean[]

    In Design Mode info path has parsed the schema.
    the schema has an item (group element) at the point of attribute array and that item has childs of AttributeBean.

    when i execute the web services.
    InfoPath is throwing a Error Dialog with following message:

    "Element 'item' is unexpected according to content model of parent element '{urn:com.plm.wsx.ui.PartsObjectService}attributes'.
    Expecting: {urn:com.plm.wsx.ui.PartsObjectService}item."

    if i change the attribute[] to simple type of attribute it works fine.
    but this will not fulfill my need as i need the variable number of attributes for each partobject.

    also i need this bidirectional meaning i want to submit the form with same structure to do updates.

    do i need to do some custom coding to avoid the item error.

    please let me know how to come out of this problem.

    Below is sample of XML response:
    Envelope:
    Body:
    executePartsSearchResponse:
    executePartsSearchReturn:
    attributes:
    item:
    attributeName:
    absoluteName:
    dataType:
    attributeValue: Attr Value 1
    availableValue:
    readOnly: false
    name: Attr 1
    partName: MPG Parent Part
    partNumber: MPG1
    executePartsSearchReturn:
    attributes:
    item:
    attributeName:
    absoluteName:
    dataType:
    attributeValue: Attr Value 1
    availableValue:
    readOnly: false
    name: Attr 1
    partName: MPG Parent Part
    partNumber: MPG2


    Please let me know the workaround for this problem.
  • 05-02-2007 08:47 AM In reply to

    Re: InfoPath 2003 and Axis web service with Arrays

    Hi cuzdatha and welcome to the forums!

    This is an interesting scenario. I have always wondered how Java and InfoPath could interact together. I have done a lot of Java programming in my academic studies, but it does not seem to popular in the business world.

    The problem you are seeing with the attributes is because per the XML specification, attributes cannot be repeating. The only way you could have multiple attributes, is if you gave them all a seperate name, like attr1, attr2, etc. However, this will be hard to describe in the schema and will not be a very pretty data structure. You should create a repeating structure underneath the node that you are wanting to put the attributes on and store your repeating data there.

    I hope this helps, please let us know how it turns out!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.