Mule can generate a WSDL on-the-fly but it needs something to infer the WSDL from. It can be done from a pure POJO component without any need for JAX-WS annotations and is configured like this:
<flow name="bookLookupService">
<http:inbound-endpoint address="http://localhost:8181/bls"
exchange-pattern="request-response">
<cxf:simple-service serviceClass="com.acme.BookLookupService" />
</http:inbound-endpoint>
<component class="com.acme.BookLookupServiceImpl" />
</flow>
With the following interface:
package com.acme;
public interface BookLookupService
{
public static class BookLookup
{
private String bookid;
public String getBookid()
{
return bookid;
}
public void setBookid(final String bookid)
{
this.bookid = bookid;
}
}
public static class Book
{
private String bookid, name;
public String getBookid()
{
return bookid;
}
public void setBookid(final String bookid)
{
this.bookid = bookid;
}
public String getName()
{
return name;
}
public void setName(final String name)
{
this.name = name;
}
}
Book lookup(final BookLookup bookLookup);
}
and implementation:
package com.acme;
public class BookLookupServiceImpl implements BookLookupService
{
public Book lookup(final BookLookup bookLookup)
{
final Book book = new Book();
book.setName("LOTR");
book.setBookid(bookLookup.getBookid());
return book;
}
}
The problem is that the WSDL will not conform to the expected message above, you end up with messages like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:acme="http://acme.com/" xmlns:acme1="http://acme.com">
<soapenv:Header/>
<soapenv:Body>
<acme:lookup>
<acme:arg0>
<acme1:bookid>ABC123</acme1:bookid>
</acme:arg0>
</acme:lookup>
</soapenv:Body>
</soapenv:Envelope>
If you want stricter control on the generated WSDL you'll have to use JAX-WS / JAXB annotations.