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.

inside custom component

BlackBerry Push Development

Reply
Contributor
Posts: 18
Registered: ‎09-17-2013
My Device: z10
My Carrier: 01000640637

Error in push notification configuration

Hi all

   Can anyone help me.

I try to make configuration to push notification, but i have problem

it gives me exception

 

net.rim.pushsdk.commons.PushSDKException: Unable to parse the response from this command because the content-type header field returned was not the expected: 'application/xml'. This may occur if the URL being accessed is wrong or the service at the URL is not available. Actual content-type returned was: text/html

 

i used low level example with webwork technique and use z10 device

 

Thx

 

Contributor
Posts: 14
Registered: ‎12-09-2013
My Device: blackberry torch
My Carrier: vodafone

Re: Error in push notification configuration

I am facing with the same problem too.

I used the highlevel push SDK and my java code is:

public static String pushMessage(){

IdGenerator idGenerator = new IdGeneratorImpl();
String address = "XXXXXXXX";

String message = "Hello World";

PushMessageControl pushMessageControl = new PushMessageControl(PPGType.PUBLIC_PUSH, idGenerator, "xxxx-AppID", address);

Content content = new TextContent(message, "UTF-8");

PapService papService = new PapServiceImpl();

PushSDKProperties properties = new PushSDKPropertiesImpl();
properties.setPublicPpgAddress("https://cpxxxx.pushapi.eval.blackberry.com/mss/PD_pushRequest/");
properties.setParserSpecialCharacters(BLACKBERRY_PARSER_SPECIAL_CHARACTERS);
properties.setHttpIsPersistent(false);
properties.setHttpConnectionTimeout(BLACKBERRY_CONNECTION_TIMEOUT);
properties.setDtdDeclarationPublic(BLACKBERRY_DTD_DECLARATION_PUBLIC);
properties.setHttpReadTimeout(BLACKBERRY_READ_TIMEOUT);

HttpClientImpl client = new HttpClientImpl();
client.setPushSDKProperties(properties);
papService.setHttpClient(client);
papService.setPushSDKProperties(properties);
try{
System.out.println("The content is " + content.toString());
System.out.println("The PAP msg is " + papService.toString());
PushResponse response = papService.push("xxxx-AppID", "PWD", "xxxx-AppID", pushMessageControl, content);
System.out.println("The response is " + response.toString());
return response.toString();
}catch(Exception e){
System.out.println("The Exception is " + e.toString());
return e.toString();
}
}

 

The reponse is: 

net.rim.pushsdk.commons.PushSDKException: Unable to parse the response from this command because the content-type header field returned was not the expected: 'application/xml'. This may occur if the URL being accessed is wrong or the service at the URL is not available. Actual content-type returned was: text/html

 

Could anybody please help?