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
Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

Can you try posting your request to Eval instead of Production environment? I can help you debug better. Do you still have your app id and password for the Eval environment?

 

I took your .NET code and converted it to Java since I don't have a .NET environment and I was able to successfully issue the command:

 

StringBuffer data = newStringBuffer();

data.append("");

data.append("<?xml version=\"1.0\"?>");

 

// Data.AppendLine("<!DOCTYPE pap PUBLIC \"-//WAPFORUM//DTD PAP 2.1//EN\" \"http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd\">");

data.append("<bpds version=\"1.0\" >");

 

// Data.AppendLine("<pap >");

data.append("<subscriptionquery-message pushservice-id=\"" + APP_ID + "\">");

data.append("<status status-value=\"active\"/>");

data.append("</subscriptionquery-message>");

 

// Data.AppendLine("</pap>");

data.append("</bpds>");

 

// Data.AppendLine("--" + Boundary);

data.append("");

 

ByteArrayOutputStream output =new ByteArrayOutputStream();

output.write(data.toString().getBytes());

 

HttpResponse httpResponse = client.transmitPOST(

"https://pushapi.eval.blackberry.com/mss/PD_cpSubQuery", output, "application/xml", APP_ID, PASSWORD, null);

 

where the API for tranmistPOST is:

 

public HttpResponse transmitPOST(String url, ByteArrayOutputStream payload, String contentType, String username, String password, HttpHeaderList headers)

 

The HttpResponse gives me back the proper results.

 

Regular Contributor
martinwang
Posts: 84
Registered: ‎12-02-2009
My Device: Not Specified

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

My Application id is production application id, my eval is expired 2012-08-27, I do not know if it still valid. By now , I can do register device to BIS push with push initiator and without push initiator, I can send push message from DOT.NET web service , now I plan to register more device on BIS push, I am working on check all register devices on my push application id. One thing I am not clear in sample push enable app, it register content provider and then register BIS push, I don`t know what is difference?. I will run you code on DOT.NET web service. Thanks very much.
Regular Contributor
martinwang
Posts: 84
Registered: ‎12-02-2009
My Device: Not Specified

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

I am not very familiar java code and Tom cat, I can not debug push initiator code on Eclipse. But I try with push initiator debug port, with sdk admin interface I can query my device status. I think My product application id is valid
Regular Contributor
martinwang
Posts: 84
Registered: ‎12-02-2009
My Device: Not Specified

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

I found you call by Push SDK API : client.transmitPOST() , Could you do it directly use Java httprequest object? Thanks
Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

Remove the <?xml ... part and I think you'll be good to go.

Regular Contributor
martinwang
Posts: 84
Registered: ‎12-02-2009
My Device: Not Specified

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

Thanks very much. It work
Regular Contributor
martinwang
Posts: 84
Registered: ‎12-02-2009
My Device: Not Specified

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

You are the best Advisor I have met.
I have other questions for you.
1.) By now I can register device to BIS push server, I comment the code register content provider ( push initiator) in sample-push-enable app( client), this has any side effect?
2.) Can I directly do suspend/ resume directly send xml data to BIS push server by http request, If so which url I have to use, and the data format send by post method. Thanks again.
Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

1) No there is no side effect to comment out the subscription call to the push initiator. But it is very strongly recommended you have subscription management in your push initiator. You should keep a fairly accurate persistent store of who is subscribed to your application and you should only be pushing to those devices. You should only use the subscriber query message periodically to reconcile your persistent store with the one in the RIM push service.

 

2) Yes you can.

<ppg url>/mss/PD_cpSub?cpAction=suspend&pin=

<ppg url>/mss/PD_cpSub?cpAction=resume&pin=

Regular Contributor
martinwang
Posts: 84
Registered: ‎12-02-2009
My Device: Not Specified

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

Thanks you again, I will try suspend/resume.
for device subscribed info, I will log in SQL server db based succeeding event
Retired
marco_dicesare
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10

Re: Try to query Supplying a status to request subscribed addresses from Blackberry push sever get malform reasponse

Martin, did a bit more digging and I found the real problem was that you had a blank line before the <?xml ... declaration tag. That tag needs to be first in your XML message. The Data.AppendLine(""); will add a newline at the top of the XML message that causes a problem. So re-add the XML declaration <?xml and comment out the newline:

 

//Data.AppendLine(""); <-- remove this
Data.AppendLine("<?xml version=\"1.0\"?>");  // <-- re-add this