C# generated proxy method different than original Java service method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adrya1984
    New Member
    • Dec 2009
    • 3

    C# generated proxy method different than original Java service method

    Hi,

    I have a Java service that has the following method signature:

    Code:
           @WebMethod(operationName = "getContactList")
            public MyListClass getContactList(@WebParam(name = "myList") MyListClass myList) throws IllegalArgumentException {
                    return myList;
            }
    
    public class MyListClass implements Serializable{
    List<ContactOD> innerList;
    
        public List<ContactOD> getInnerList() {
            if(innerList == null){
                innerList = new ArrayList<ContactOD>();
            }
            return innerList;
        }
    
        public void setInnerList(List<ContactOD> innerList) {
            this.innerList = innerList;
        }
    
    }
    When i generate the proxy in C# for this Java service, i get the method signature like this:

    Code:
       public ContactOD[]  getContactList(ContactOD[] myList)
    I see nowhere in my generated proxy MyListClass that wraps this List<ContactOD> .

    What do i need to do to the java web service or to the C# generation of proxy so i can see in the proxy class the method like this:

    Code:
    public MyListClass getContactList(MyListClass myList)
    Thank you so much, Adriana
  • cloud255
    Recognized Expert Contributor
    • Jun 2008
    • 427

    #2
    I have had this problem before tough that was a C# web service being accessed by a Java mobile phone. The end conclusion we came to was that the definition in the WSDL file was interpreted as an array as not all languages support a generic collection such as a list.

    Code:
    <xs:element name="ContactList" type="ContactOD" minOccurs="0" maxOccurs="unbounded"/>
    is therefor interpreted as an array by the code generator. What we did was perform a rather crude hack, and built a little array to string converter function.

    Comment

    Working...