Hi Sergey,

Sorry for the late response. I may have misrepresented the method, it should be as follows:

@WebService(name="MyObjectService")
@SOAPBinding(use=Use.LITERAL, style=Style.RPC)
@Consumes("*/*")
@Produces("text/xml")
@Path("/MyObjects")
public interface MyObjectService{
   @GET
   @Path("/")
   @WebMethod
   @WebResult(name="myObjectInstance")
   public MyObject getMyObject(
           @QueryParam("uniqueIDField")
           @WebParam(name="uniqueIDField")
           long uniqueIDField)
   ;

   @PUT
   @Path("/")
   @WebMethod
   @WebResult(name="uniqueIDField")
   public long insertMyObject(
           @WebParam(name="myObjectInstance")
           MyObject myObjectInstance,
           @QueryParam("reason")
           @WebParam(name="reason")
           String reason
           )
   ;
}

@WebService(endpointInterface="some.domain.MyObjectService", serviceName="MyObjectService", portName="MyObjectServicePort")
public class MyObjectServiceImpl implements MyObjectService{
public MyObject getMyObject(long uniqueIDField) throws SolegyContingencyException{
       return new MyObject();
   }
public long insertMyObject(MyObject myObjectInstance, String reason) throws SolegyContingencyException{
       return 1;
   }
}

@XmlType(name="MyObject")
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name="MyObject")
public class MyObject {
   private long uniqueIDField;
   @GET
   @Path("/uniqueIDField")
   public long getUniqueIDField() {
       return uniqueIDField;
   }
   public void setUniqueIDField(long uniqueIDField) {
       this.uniqueIDField = uniqueIDField;
   }
}

The wadl section i get is something as follows:

<method name="GET">
 <request>
   <param name="uniqueIDField" style="query" type="xs:long"/>
 </request>
 <response>
   <representation mediaType="text/xml"/>
 </response>
</method>
<method name="PUT">
 <request>
   <representation/>
   <param name="reason" style="query" type="xs:string"/>
 </request>
 <response>
   <!-- Primitive type : xs:long --><representation mediaType="text/xml"/>
 </response>
</method>

And yes, I did specify text/xml. I also have providers included to wrap the response in tags. I had to add the providers because at the time (2.0), primitives were not supported. I haven't tried it lately without the providers, but are primitives now supported out of the box?

Also, is there somewhere to look to be able to use the tool that creates an http-centric client-code from the wadl?

Thanks!

Gabo.

Sergey Beryozkin wrote:
Hi Gabo

It is an 'Object' so a WSDL generator has no idea what else to say, apart
from <representation/>. If you add "Consumes' with some values then you'll
get a bit more specific tag...


However, there appears to be a bug :

<response><!-- Primitive type : xs:long --><representation mediaType="text/xml"/></response></method></resource>

or do you have Produces('text/xml') on the class itself ? Can you please
send me a class sample so that I can fix it ?

cheers, Sergey

Reply via email to