aspose file tools*
The moose likes Web Services and the fly likes question with object parameter webservice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "question with object parameter webservice" Watch "question with object parameter webservice" New topic
Author

question with object parameter webservice

camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
Hi Guys,
I have a question how i can use object in parameter of my method in my SEI. I thought that I could use any object like: Date, MyClass etc. But, when I created the client and tested, it was not worked as I was expecting.


My client: I used wsimort -keep -p package urlwsdl



any idea ?

thanks.


Brazil - Sun Certified Java Programmer - SCJP 5
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
    
    4
http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/2.0/tutorial/doc/JAXBWorks4.html
See Default Data Type Bindings

First, see Java-to-Schema
java.util.Date - xs:dateTime

(from your java code to schema)

Then Schema-to-Java
xsd:dateTime - javax.xml.datatype.XMLGregorianCalendar

(from wsdl implicitly schema to client side code. So this is what you got.)

Brazil World Cup 2014
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
Hi Paul,

good link!!!

thanks for your answer. I think I got to understand, but sometimes, I am confused. I got to resolve this problem using @XmlElement, like:


I am not sure, it is right, but I got to show the result in xml via soapui. So, now I have a doubt: use annotations is better way?

Other point that for me it is not clear yet, is:
1. I have create a simple webservice and publish it using annotations java 6;
2. via sopaaui I check the result. it is ok
3. after I create a client to consume my web service and I use wsimpot -keep -p package myurlwsdl

only this is necessary to create and publish a webservice to a client can consume? and about xsd? where it appears?

My method in my SEI return a object. How can show the result to my client in xml file? I get to see xml format in soapui. But I do not get to imagine how it will work in real env.

could you more details about please?

hehe yeah World cup 2014 will be here!! have you planned to come here?
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
    
    4
I'll try to explain as clearly as I can. So there is no need to play with words here.
I'll give you what I have as we go along the way.

Suppose I am a Web service provider, then there are 2 ways to provide a wsdl to a consumer

way 1. using Java to generate a wsdl which will include the xsd.
The xsd could be either embed/inline withing the wsdl itself or externally.

This is the way you did. So you should see xsd from your myurlwsdl
If possible, post that wsdl. I'll show you.

Example http://www.ibm.com/developerworks/library/ws-tip-jaxwsrpc4/index.html

See Listing 1. HelloWorld service's WSDL.
The xsd is embed/inline withing the wsdl itself





way 2. create a wsdl which has xsd. The wsld is used to create server side code to be used by the Web service provider.
The wsdl can also be used by a consumer as well.
The xsd could be either embed/inline withing the wsdl itself or externally.

I'll find one and show you.

Usually, companies have the servers like Tomcat, Websphere, Weblogic, Glassfish etc to
host their web service. Try to download GlassFish server bundled with Eclipse, then work with the IDE if possible.


SOAP UI: work with this example
http://www.soapui.org/SOAP-and-WSDL/working-with-wsdls.html
http://www.webservicex.net/CurrencyConvertor.asmx?WSDL

To see SOAP message: request and response
http://www.soapui.org/SOAP-Recording/recording-soap-trafic.html
or use TCPMON
http://ws.apache.org/commons/tcpmon/tcpmontutorial.html
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
Hi Paul,

Sorry for too late I am answering your post. I had business travel and a hard week in my job. But now I got to understand better, your explanation and links It was very good.I will continue studying and improving my knowledge with WS, now with web servers, I am thinking about to use jetty, but you recommended glassfish. why? do you think it better than jetty?

thanks again.

see ya!
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
    
    4
1. GlassFish 3.x: Community Version. J2EE app server. Has every thing...
Has Metro JAXWS-RI (implementation of JAX-WS). So all you need is to focus on learning JAX-WS.

2. Download JAXWS2.2.5-20110729.jar has excellent: user guide, doc, tools, example...

3. Obviously, there are others as well.
camilo lopes
Ranch Hand

Joined: Aug 08, 2007
Posts: 202
cool! Paul. I will check about it. thanks again for your help! .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question with object parameter webservice