Title: Message
Even for an existing project that you want to expose as a web service, you can still create a separate interface for it that is different than the interface or classes that are used elsewhere. In the web service I created, I used this method. The original code had a huge class with something like 50 methods in it. For the web service, I chose to expose only 6 methods. I wrote a separate interface that only contained types that could be easily expressed in the wsdl.
 
The advantage is that you can expose the functionality at a higher level of granularity and have it not look so much like an API being exposed directly. Also you only provide the methods that are needed by the web service (which is likely to be a subset of the existing classes). By creating an interface that is implemented in your ...SoapBindingImpl.java file, you can then link the new class into your existing classes. In my class there was just one class, but with this method there could be many classes exposed through a single class. This should provide a much simplier interface for the clients of the web service.
 
I see that there is another post that describes the above in more general terms too.
-----Original Message-----
From: Oleg Lebedev [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 29, 2004 1:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Generating wsdl for interfaces

 
 > If you are going to trick java2wsdl into using the State class, then you might as well return a State object from getState(), 
> 
since 
that kinda defeats the purpose of returning an interface in the first place, right? 

Not true, because this interface is used in other projects. 
 
 >  I see alot of questions on this list where someone is trying to make axis produce a wsdl to fit their classes that they  
want to expose as a service. I'm a newbie here, so maybe I don't get it, but it seems this is the reverse of the process to be 
 
followed. Shouldn't you design your interface such that it exposes your web service in a way that meets the requirements of 
 
how a wsdl file is created and used, instead of trying to make the wsdl match an interface that was designed without a web
 
service in mind? 

This is true only for new applications, which are created with the only purpose of exposing their functionality as web services.

Currently, I added the following dircting to my java2wsdl target:
extraclasses="State "
This forces java2wsdl to add State type to wsdl types. Then I can replace IState type refernce in my wsdl with State and it works. I wonder if there is a more straightforward way to do this.
 
Thanks.
 
-----Original Message-----
From: Oleg Lebedev [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 29, 2004 1:09 PM
To: [EMAIL PROTECTED]
Subject: Generating wsdl for interfaces

Greetings.
 
I am trying to figure out how to get wsdl2java to work with methods which return interfaces.
I have an interface, which declares the following method which returns IState interface:

public IState getState(); 

java2wsdl generates correct wsdl, but shows a warning saying:

    [axis-java2wsdl]  WARN [main] (Types.java:1193) - The class 
    org.waterford.sequencer.interfaces.engine.IState does not contain a default constructor, 
    which is a requirement for a bean class.  The class cannot be converted into an xml schema
    type.  An xml schema anyType will be used to define this class in the wsdl file.

wsdl2java chokes and throws the following exception:

    [axis-wsdl2java] java.io.IOException: Type {urn:datatypes:engine.interfaces.sequ
    encer.waterford.org}IState is referenced but not defined.

I have a State class, which implements IState interface. I wonder if there is a way to trick java2wsdl or wsdl2java to use that class instead of IState interface.

Thanks.

 
*************************************
This e-mail may contain privileged or confidential material intended for the named recipient only.
If you are not the named recipient, delete this message and all attachments.
Unauthorized reviewing, copying, printing, disclosing, or otherwise using information in this e-mail is prohibited.
We reserve the right to monitor e-mail sent through our network.
*************************************
 
*************************************
This e-mail may contain privileged or confidential material intended for the named recipient only.
If you are not the named recipient, delete this message and all attachments.
Unauthorized reviewing, copying, printing, disclosing, or otherwise using information in this e-mail is prohibited.
We reserve the right to monitor e-mail sent through our network.
*************************************

Reply via email to