• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Receiving Empty Response for my Java Web Service using a Complex Return type

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Experts,

I am pretty new to Web Service Development / Java in General and have run into an issue. Hopefully you will get me back on track .

I am currently developing a Web Service in Eclipse using the bottom up approach. This is supposed to be something simple that I'm playing with for a small POC.

My issue is that I am receiving an empty response from my service when i return an Object ( i.e. Person ). If I switch it around to return a String, it seems to be working as expected.

Here is my SOAP UI Request:



Here is my SOAPUI Response:



I have attached my Eclipse Project for reference,

Thanks in advance for your help,

Doyle
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a good idea to try to return a Java object in a web service, it greatly restricts your possible clients.

The whole idea behind web services is to separate the utility of the service from the language of implementation - thats why universal formats like XML and JSON are so widely used.

Bill
 
Doyle Reece
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Bill,
Thanks for your response, it is greatly appreciated.

My goal is to return the contents of the 'Person' Object, I'm not sure how to do this exactly. I was assuming the object would somehow be converted into the soap response format, but not exactly sure how to achieve this.

thanks again Bill,

Doyle
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a nice video tutorial. Please check that.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the client for this web service? Also, how complex is Person?

If it is a dynamic web page then JSON is indicated because it cooperates with JavaScript.

If the client is a Java or other language program and Person is simple then a simple sequence of name = value lines of text will work.

Bill
 
Doyle Reece
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Client is SOAPUI,

Person is as follows:




Thanks Bill
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The Client is SOAPUI,



Really? I always think of SOAPui as programmer's tool, not a client interface.

You could return a single String formatted as multiple text lines in the Properties format ie

SSN=nnnnnnnnn
FirstName=William
LastName=Brogden
etc......

I say Properties because the java.util.Properties class can read and write that simple format.
 
Hey, check out my mega multi devastator cannon. It's wicked. It makes this tiny ad look weak:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic