Related to Andreas problem.
It seems that when returning a POJO (or array of POJOs) to .NET AND using
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) you will see the problem.
The workaround is to use RPC and .NET is happy, here is a modified example
using a 181 Web Service, return an array of Person objects containing one
Address objects (a weak example, I know but illustrates the point):
| package org.jboss.samples;
|
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.Use;
|
|
| @WebService
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| public class POJOService {
| @WebMethod(operationName="GetPersonByID")
| public Person getPerson(String id)
| {
| System.out.println("Actually just ignoring the id for " +
| " this example code: " + id);
| Person somebody = new Person();
| somebody.setName("Burr Sutter");
| somebody.setAge(24);
| somebody.setBirthDate(new java.util.Date());
| return somebody;
| }
|
| @WebMethod (operationName="GetAllPeopleArray")
| public Person[] getPeople() {
| Person[] results = new Person[2];
| Person a = new Person();
| a.setName("Burr Sutter");
| a.setAge(24);
| a.setBirthDate(new java.util.Date());
| Address anAddress1 = new Address();
| anAddress1.setStreetAddr1("123 ABC Lane");
| anAddress1.setStreetAddr1("Suite 200");
| anAddress1.setCity("Atlanta");
| a.setAddress(anAddress1);
| results[0] = a;
|
| Person b = new Person();
| b.setName("Thomas Diesler");
| b.setAge(23);
| b.setBirthDate(new java.util.Date());
| Address anAddress2 = new Address();
| anAddress2.setStreetAddr1("456 XYZ Street");
| anAddress2.setStreetAddr1("Box 221");
| anAddress2.setCity("New York");
| b.setAddress(anAddress2);
| results[1] = b;
|
| return results;
| }
|
| @WebMethod (operationName="AddPerson")
| public void addPerson(Person person) {
| System.out.println("\n\n");
| System.out.println(person.getName());
| System.out.println(person.getAddress().getStreetAddr1());
| System.out.println(person.getAge());
| }
| }
|
|
The VB.NET WinForm code:
| Dim proxy As New JBossPOJO.POJOServiceService
|
| Dim results As JBossPOJO.Person() = proxy.GetAllPeopleArray
| For Each item As JBossPOJO.Person In results
| MsgBox(item.name & " " & item.address.streetAddr1)
| Next
|
Note: JBossPOJO was created using Add Web Reference in the Solution Explorer of
Visual Studio Express.
The C# WebForm code:
| JBossPOJO.POJOServiceService proxy =
| new JBossPOJO.POJOServiceService();
| JBossPOJO.Person[] people = proxy.GetAllPeopleArray();
| StringBuilder x = new StringBuilder();
| foreach (JBossPOJO.Person aPerson in people)
| {
| x.Append(aPerson.name + " " +
| aPerson.address.streetAddr1 + "\n");
| }
| TextBox1.Text = x.ToString();
|
|
Burr
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3947447#3947447
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3947447
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user