aspose file tools*
The moose likes Web Services and the fly likes many questions about ws 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 "many questions about ws" Watch "many questions about ws" New topic
Author

many questions about ws

angel sar
Greenhorn

Joined: Aug 29, 2009
Posts: 17
hi, im new on this forum and also newbie in web servies , i have some questions hope you can help me.
1)i publish a webservice, how a client can call it? just looking at its wsdl file and then generete a stub? any other way?
2)I learned 2 ways to implement a wsdl file, one that generate all the content in 1 wsdl file and other that generate a wsdl file using xsd files (header and request). I think its the same, just one is more flexible, am i wrong? are there more differents? what you recommed? do i have to give all the files (wsdl and xsds) to the client in order to invoke the webservice?


thanks for your help
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
1. Basically you have two choices on how to implement a client of a SOAP web service:
- Using the WSDL and a tool like wsimport, you generate client artifacts which you then use from your program that is to access the web service.
- If you know the address of the web service and the message format, then you can write a client that do not use the WSDL at all. In this case you have to write code that creates the request messages and interpret the response messages. This approach is more suitable if your program is to access web services that you know little or nothing about when writing your program or if you access non-SOAP web services.
2. Yes, you can externalize XML schemas of a WSDL by storing them in separate files and then importing them in the <types> section of the WSDL.
Using this approach can help you to:
- Maintain only one single copy of an XML schemas used by multiple WSDLs.
- Separate out type definitions from a long WSDL to make it easier to overview.
The question whether to use this approach or not is a matter of taste, I'd say. For smaller WSDLs, it does not matter that much if you have the types defined inline.
Best wishes!
angel sar
Greenhorn

Joined: Aug 29, 2009
Posts: 17
Thank You very much for your answer Ivan. Please, give me more details in these points, hope i dont bother you , and sorry for my noob questions

At your 1.a answer, is wsimport a program? where can i download it?
At your 1.b answer, just i need the message format and the ws location to program and test my client, right?

I understand your explanation about using xsd files , but i think its better to tell you my situation so you can understand me better. The client of the WS i built is a informix 4gl system. This system through mq will call a translator that translate the mq to xml format and then call my WS. My question is, do i have to give just the wsdl file, xsd files or both to the translator? is it enough to give the address of the wsdl document?

And finally, when i generate a skeleton of my bean, the ide creates two interface, if my bean name is xxx, the ide creates xxx interface and xxx_sei interface, but they are the same. I understand that just i need is a sei and its implementation, a sib (service implementation bean), strange right?

Thank You a lot four your time
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
angel sar wrote:At your 1.a answer, is wsimport a program? where can i download it?

It is enclosed in the JavaSE 6 distribution, at least the JDK, so you probably already got it.

At your 1.b answer, just i need the message format and the ws location to program and test my client, right?

Right. If you need, I can supply some sample code on how to do it.

My question is, do i have to give just the wsdl file, xsd files or both to the translator? is it enough to give the address of the wsdl document?

If you use wsimport to create client artifacts, then the URI of the WSDL will be "embedded" in the generated artifacts. If you use these artifacts to call your service, you do not have to supply any additional information. For an example, see: http://www.netbeans.org/kb/docs/websvc/jax-ws.html

And finally, when i generate a skeleton of my bean, the ide creates two interface, if my bean name is xxx, the ide creates xxx interface and xxx_sei interface, but they are the same. I understand that just i need is a sei and its implementation, a sib (service implementation bean), strange right?

Hmmm, I've never had two interfaces generated for me by wsimport. It could be you use tools that I am not familiar with.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: many questions about ws