Hi

You have a QueryParam attached to a parameter which is expected to represent a message body, so no attempt to read the stream is attempted

Thanks, Sergey
On 01/11/13 07:31, Kiren Pillay wrote:
HI All,

I need to post an XML entity to a restful web-service, however my service
isn't picking up the request for some reason, I'm getting a null value for
my request.

Can someone please guide me in the right direction.  I'm using the JAXB
Provider.

Here's my service:

@POST
     @Produces({ MediaType.APPLICATION_XML })
     public Response execute(@QueryParam("") MmsBillingRequest request)
throws Exception {
         System.err.println("REQUEST RECEIVED");
         Response response = new Response();
         try {
              request.getOriginatorInterface();


My Test Client:

     String xmlRequest = "<MmsBillingRequest> "
                         + "  <originatorMsisdn>27823339811
</originatorMsisdn>"
                         + "  <originatorInterface />" + " <payloadSize/>"
                         + "  <messageClass/>" + "  <readRepRequested/>"
                         + "  <timeStamp/>" + "  <recipients/>"
                         + "</MmsBillingRequest>";

                 // ****************

                 WebClient wc = WebClient.create(

                         "
http://localhost:9090/deploy-mms-billing/rest//function/mmsBilling";,
                         "test", "test", null);

                 wc.type("application/xml").accept("application/xml");



                     long l1 = System.currentTimeMillis();
                     // Response response = wc.get(Response.class);
                     Response response = wc.post(xmlRequest);
                     System.out.println(response.getEntity());


Regards
Kiren



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to