Thank's for your answer.

I trying not to code the client side stub (to avoid errors). We are going to implement several web services and I want to automatize the client stub creation using ant. What I wanna know is how can I tell WSDL2Java to use my bean instead of the generated one.

Thank you,
Aureliano.

Areliano,

I'm new to SOAP and Axis, so my advice is worth the price of admission,
but...

You could ignore the WSDL and wrapper the call to your web service with your
own code and register the type mapping.

  void wrapperMethod(MyBean mb) {
  String endpoint = http://localhost:8080/axis/services/YourService;

  Service service = new Service();
  Call call = (Call) service.createCall();

qn = new QName("urn:BeanService", "MyBean");

  call.registerTypeMapping(MyBean.class, qn,
    new org.apache.axis.encoding.ser.BeanSerializerFactory(MyBean.class,
qn),
    new org.apache.axis.encoding.ser.BeanDeserializerFactory(MyBean.class,
qn));

  call.setTargetEndpointAddress(new java.net.URL(endpoint));
  call.setOperationName(new QName("www.yourcompany.net/ns/yourns",
"doSomething"));

  call.invoke(new Object[]{mb});
}

You could then distribute the class with the wrapper call with the MyBean
object to whatever client will call it.

Do you really need the WSDL to generate java code if you intend on using
your bean classes anyway?

I used this code to test my SOAP services up to the point of generating the
WSDL.  In my case I explicitly DON'T want to use my classes but would rather
have them generated by the WSDL.

Good luck,

Bill Pfeiffer






----- Original Message ----- From: "Aureliano Calvo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, March 10, 2003 5:04 PM Subject: Share classes in client and server



Hi!

I have an service with a method that haves a bean on it's interface:

public class MyService{
public void doSomething( MyBean bean ) {
// Do something
}
}

I first run Java2WSDL to generate the .wsdl file.
When I run the WSDL2Java program it generates another class named
MyBean. But I want to use the same class both on server and client.

I alse need to have automatically generated the client's stub code.

Do you have any sugestions?

Thank's in advance,
Aureliano.
--
"Any fool can write code that a computer can understand. Good
programmers write code that humans can understand."

"If you don't think carefully, you might think that programming is just
typing statements in a programming language"











--
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."


"If you don't think carefully, you might think that programming is just typing statements in a programming language"








Reply via email to