Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java web service return fails  RSS feed

 
Miguel Sanchez Cuarental
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone.

I have a problem with my java web service and I hope you can help me.

My web service have few methods that respond with an object array.

This is my object class "PlateImp.java"



This class inherate that Plate interface.

In my class with all the methods calling "WebMethodClass.java". I return an array of these PlateImp.

When I debug the method to get the array of PlatesImp "GetPlates", I can view that the array is filled correctly and the object included in it are filled but when I try to connect it to an C# application or when I try the service with SOAPUI, the response isn´t an array of my objects. The return is "GetPlatesResponse" and the object in the array are null or empty.

I hope you can help me.

Thank you very much.

Miguel Sánchez Cuarental
 
Vijitha Kumara
Saloon Keeper
Posts: 3997
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the CodeRanch!

I think you may need to post some code from where you construct the response to be sent to the client, which will help to answer your query (and may be any other useful info).
 
Miguel Sanchez Cuarental
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Vijitha.

I am going to post some code in order to give you some information about my problem.

In the server side. This is the code of my webmethod that return the "plates".



When I debug my server, I can view that the PlateImp[] is filled correctly.


For the other side, in my C# client. I add a service reference with the following direction



I create an object to use the webservice using:

private WebAccess.WebAccessClient m_oClient = new WebAccess.WebAccessClient();

And I create a method to get the plates. This is my method



I hope I´ve given some information about my problem.

Thank you very much.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am I reading this right? You are trying to return an array of Java objects to a C# client?

Think about it - how can C# understand Java objects?

Bill
 
Miguel Sanchez Cuarental
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I think that it´s possible to consume a java web service from C# client.

This webservice have the methods to insert data in a BBDD and get the information. The methods to insert data works correctly and I can get basic data from the webservice (integer, boolean, String[], etc...)

But the problem is with the objects, When I receive the object I can view the properties but the information is empty or is null.

I don´t know if there are any incompatibility with complex object.

Thank you
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that it´s possible to consume a java web service from C# client.


Of course, SOAP is intended to be language independent.

However, Java objects are not a data type allowed by SOAP, precisely because they are not language independent.

Examine this SOAP 1.1 documentation - especially around section 5 for the allowed data types and how complex data types are encoded.

Search Google for "soap data types" to see tutorials.

Bill

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!