Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Contributor
adayler
Posts: 2
Registered: ‎10-08-2010

HttpMessage.setMethod(HttpMessage.POST) is changed by GET, on BlockingSenderDestination

I’m trying to migrate a Blackberry application to OS 7, it was built for OS 6 (my app is working on OS 6), theoretically it should not bring any problem, at least point it is true, but I found a problem that I still cannot resolve. When have executed calls to web services (SOAP), I'm setting the HttpMessages for using POST method, but when the call is executed, it have arrived to the server with GET method (and it not going to have, was intentionally disabled), it is a big problem for me , because the Sever with which am working doesn't have support for working with GET (I have always "Http 500 error"). It doesn't happens on the simulator side, just happens on the device side. Do you know any workaround for it ? Is a problem with OS version ? (See below for the code that I'm using, and for the code)

 

Device

---------

Model: Bold 9930

Carrier: Sprint

OS: 7.0 Bundle 1296 (v7.0.0.241, Platform 5.0.0.442)

 

Simulator (On the simulator side I don't have any problem)

-------------

ModelBold 9930

OS: 7.0 Bundle 1962(v7.0.0.440, Sept_24_2011_signed, Platform 4.0.0.141)

 

 public void run()
        {
            context.setEnableBtnsend(false);
            BlockingSenderDestination blockSendDest = null;

            try
            {
                URI uri = URI.create(URL_BASE);
                blockSendDest
                    = (BlockingSenderDestination) DestinationFactory.getSenderDestination(
                    senderContext.getName(), uri);

                if (blockSendDest == null)
                {
                    blockSendDest = DestinationFactory.createBlockingSenderDestination(
                        senderContext, uri);
                }

                ByteMessage requestMessage = blockSendDest.createByteMessage();
                requestMessage.setTransportHeader("Content-Type", "text/xml;charset=UTF-8");
                requestMessage.setTransportHeader("SOAPAction", "\"\"");
                // getBodyRequest() -> Insert SOAP request, works fine, was tested on SOAP UI
                requestMessage.setStringPayload(getBodyRequest());
                ((HttpMessage) requestMessage).setMethod(HttpMessage.POST);
                blockSendDest.resume();
                Message response = blockSendDest.sendReceive(requestMessage);

                if (response != null)
                {
                    procesMessageResponse(response);
                }

                context.setEnableBtnsend(true);
.
.
catch (Exception ex)
{
   handleException(ex);
}
}

 

 

Please use plain text.