Mike,

The fact is that I want to create a web service that could receive any type,
including complex types. And dynamically identify the attributes and types
and extract these values. For instance, this web service could receive a
complex type from another web service:

- <complexType name="Person">
- <sequence>
  <element name="age" type="xsd:int" /> 
  <element name="name" nillable="true" type="soapenc:string" /> 
  </sequence>
  </complexType>

And could get the values of age and name. But the same web service could
receive another complex type:

- <complexType name="Address">
- <sequence>
  <element name="street" type="soapenc:string" /> 
  <element name="city" type="soapenc:string"/> 
  <element name="state" type="soapenc:string"/> 
  <element name="country" type="soapenc:string"/>
  </sequence>
  </complexType>

And could get the values of the elements too. In my opinion java Object
could solve my necessity, but I would be restrict to Java, I agree. Can you
see another solution for this?

Thanks in advance.


-----Mensagem original-----
De: Mike Woinoski [mailto:[EMAIL PROTECTED] 
Enviada em: domingo, 4 de setembro de 2005 13:01
Para: [email protected]
Assunto: Re: Is it possible?

John Delaney wrote:

> Fabricio
> 
> It is entirely possible. You have to make sure that you define the
> interface properly on both sides. Use the xsd:AnyType to describe you
> java object. The only things that doesn't work completely are the
> signatures of the methods in your web service, get used to giving each
> method a unique name.

Yes, it's possible, but do you really want to? Usually, the main motivation
for 
using web services is interoperability with other platforms. You want your
web 
service to be able to service requests from .NET clients, Perl clients,
COBOL 
clients, etc. The service's WSDL is a contract; it should completely
describe 
all messages that might be sent, and using xsd:anyType makes your contract 
useless to your clients. (Yes, I know .NET does it all the time; the result
is 
that many .NET services can be consumed only by .NET clients.) If you really

need to pass around generic Java objects, RMI is a better choice than web
services.

Mike


-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.18/89 - Release Date: 2/9/2005


Reply via email to