• 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
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Returning an Array of user -defined objects from a JAX-WS Webservice

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi Friends,
I am new to webservices. I've made a really simple WebService. I deploy it to the JBoss 5 AS and JBoss automatically generates the WSDL for it. I use SAAJ API to pass the SOAP Request Message(using an xml file) to this webservice and then I get the response. I am going to provide each of the resources below:
1. Webservice Code:


2. WSDL Generated when I deployed above webservice on JBoss AS:



3. The SAAJ Client Code that I am using:


4. The SOAP Request message (or the content of soapRequest.xml) that the above SAAJ Client Code is sending to Webservice:


5. The Response that the SAAJ Client Code gets from the Webservice:



My Question: The Response that we got from the webservice has a tag <item> under <companies> tag. I want that it should be named as <company>, and not <item>. I believe there should be an annotation for doing this which I may have to apply to the WebMethod in the Webservice code which I've listed.
Request you to let me know what should I do in order to get this done without changing the WSDL manually.

Best Regards,
Nitin


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

Have you ever been able to get <item> named as <company>? If yes, how?

Thanks.

Wap Rau
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I think that the reason for the element in question being named <item> may be related to the fact that you use RPC binding.
Have you tried using DOCUMENT style binding?
Best wishes!
 
Wap Rau
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ivan Krizsan wrote:Hi!
I think that the reason for the element in question being named <item> may be related to the fact that you use RPC binding.
Have you tried using DOCUMENT style binding?
Best wishes!



Thanks Ivan Krizsan, for your reply. I am very new to Web Services. Could you provide me with links to the resources for such DOCUMENT style binding?

Thanks again,

Wap Rau
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this in your code
@SOAPBinding
(
style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
)
 
Wap Rau
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Arun Kumar wrote:Try this in your code
@SOAPBinding
(
style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
)



Thanks Arun Kumar for your reply. I will try your solution. Thanks again for responding.
 
Why is the word "abbreviation" so long? And this ad is so short?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic