0

I created an Array of Object from the .Net environment as follows :

    Dim names(2) As User
    names(0) = New User("param1", "param2", "param3")
    names(1) = New User("param1", "param2", "param3")

Here I have created a User class with 3 String variables. I also created a User class at Java environment with same String variables and the Java class accepts User[] user. I generated webservice based on the Java class and forwrading the parameter from the .Net environment as follows :

        Dim MyService As localhost.ReadObject = New localhost.ReadObject
        Dim resultString As String = MyService.ReadParameters(names)
1
  • I resolved the issue. Instead of creating the User class at the client side, I created at server side and created the User objects by accessing it using web service reference. Commented Mar 13, 2012 at 18:59

1 Answer 1

1

i have done what you need. if you pass array object(list is not supported in WebService) then in java you need to use class which has an array type of variable then generate getter and setter of that array type of variable and then generate wsdl again. if you do that then java service will accepts your array input.

suppose your service need to send "PurchaseOrder" kind of array object then say :

class OuterObject{

    public PurchaseOrder[] order;

    public PurchaseOrder[] getOrder() {

        return order;
    }

    public PurchaseOrder[] setOrder( PurchaseOrder[] order) {

         this.order = order;
    }

}

then use OuterObject as input parameter in your service method.say:

class ServiceClass{

  public placeOrder(OuterObject object){

      PurchaseOrder[] data = object.getOrder();
      int ordernumber = data.getOrderNumber();
      System.out.println("ordernumber is = " + ordernumber);

   }

}

it will work but use only array not list, service doesn't support list.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.