Response from Now SMS

Response from Now SMS SearchSearch

SMS & MMS Technical Forum » WAP Technical Discussions (unsupported) » Response from Now SMS « Previous || Next »
Author Message
tayyba fatima
New member
Username: Tayyba

Post Number: 1
Registered: 05-2015
Posted on Monday, May 04, 2015 - 04:20 am:   

I have written pushInititator which makes connection with NowSMS. it send 'OK' for connection but for response i get this

OK

<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 10">
<meta name=Originator content="Microsoft Word 10">
<title>Now SMS</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author> </o:Author>
<o:Template>Normal</o:Template>
<o:LastAuthor> </o:LastAuthor>
<o:Revision>6</o:Revision>
<o:TotalTime>0</o:TotalTime>
<o:Created>2002-10-09T15:06:00Z</o:Created>
<o:LastSaved>2002-10-09T15:57:00Z</o:LastSaved>
<o:Pages>1</o:Pages>
<o:Words>9</o:Words>
<o:Characters>53</o:Characters>
<o:Company> </o:Company>
<o:Lines>1</o:Lines>
<o:Paragraphs>1</o:Paragraphs>
<o:CharactersWithSpaces>61</o:CharactersWithSpaces>
<o:Version>10.2625</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<frameset id=frameset framespacing=0 frameborder=0 border=0 cols="260,*">
<frame name=LeftFrame id=LeftFrame src=TOCFrame.htm style='mso-linked-frame:auto'>
<frame name=MainFrame id=MainFrame src="Send%20Text%20Message.htm" style='mso-linked-frame:
auto'>
<noframes>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p class=MsoNormal>This page uses frames, but your browser doesn't support
them.</p>
</div>
</body>
</noframes>
</frameset>

</html>

what might be the issue? i tried to solve by running it in browser which support framer but unable to get it as i dont have image sources for the frames. Any help would be appreciated
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5283
Registered: 08-2008
Posted on Monday, May 04, 2015 - 11:43 am:   

Hi,

What is the URL you are posting to?

It needs to start with /PAP ... e.g., http://x:####/pap




--
Des
NowSMS Support
tayyba fatima
New member
Username: Tayyba

Post Number: 2
Registered: 05-2015
Posted on Tuesday, May 05, 2015 - 04:01 am:   

and using
URL url = new URL("http://localhost:8800"); url on which ppg is running
sendPushMessage(String clientAddress, String addressType,String message, String mimeType)
pi.sendPushMessage("+923325999976","PLMN@bsms.ufone.com","hi","text");
my push method:
public void sendPushMessage(String clientAddress, String addressType,
String message, String mimeType) throws Exception {
// String userCredentials = "tayyba:tayyba";
// String basicAuth = "Basic " + new String(new Base64().encode(authorization.getBytes()));
HttpURLConnection http = (HttpURLConnection) ppgUrl.openConnection();

String ppgServer = ppgUrl.getHost();
http.setDoInput(true);
http.setRequestProperty("Content-Type", CONTENT_TYPE);
if (authorization != null) {
if (!authorization.trim().equals(""))
http.setRequestProperty("Authorization", "Basic dGF5eWJhOmZhdGltYQ==");
http.setRequestProperty("User-Agent", USER_AGENT);

}
http.setDoOutput(true);
PrintWriter out = new PrintWriter(new BufferedOutputStream(
http.getOutputStream()));
out.println("--multipart-boundary");
out.println("Content-type: application/xml");
out.println();
out.println(createPapMessage(clientAddress, addressType, ppgServer,
genPushId(), null));
// createSiMessage(String url, String sid, String message)
out.println(createSiMessage("www.example.com","D123","sample text"));
out.println();
out.println("--multipart-boundary");
out.println("Content-type: " + mimeType);
out.println();
// out.println(message);
out.println();
out.println("--multipart-boundary--");
out.flush();
out.close();
http.connect();

}
tayyba fatima
New member
Username: Tayyba

Post Number: 3
Registered: 05-2015
Posted on Tuesday, May 05, 2015 - 04:06 am:   

url for pap doctype used :

<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN" "http://www.wapforum.org/DTD/pap_1.0.dtd">
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5287
Registered: 08-2008
Posted on Tuesday, May 05, 2015 - 01:06 pm:   

The url on which ppg is running is incorrect, it should be:

URL url = new URL("http://localhost:8800/pap");

--
Des
NowSMS Support
tayyba fatima
New member
Username: Tayyba

Post Number: 4
Registered: 05-2015
Posted on Thursday, May 07, 2015 - 03:19 am:   

Now it is giving this response


Accepted

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN" "http://www.wapforum.org/DTD/pap_1.0.dtd">
<pap>
<push-response push-id="1430971815766:0">
<response-result code="1001"/>
</push-response>
</pap>

when i can this kind of response?

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN"
"http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">
<pap>
<push-response push-id="999999999"
sender-address="https://www.pushdatadomain.com/PD_pushRequest"
sender-name="RIM Push-Data"
reply-time="2013-09-31T13:00:00Z">
<response-result code="1001" desc="Accepted for Processing">
</response-result>
</push-message>
</pap>
tayyba fatima
New member
Username: Tayyba

Post Number: 5
Registered: 05-2015
Posted on Thursday, May 07, 2015 - 03:24 am:   

Moreover I need to confirm that am I writing right request to get the response?

HttpURLConnection http = (HttpURLConnection) ppgUrl.openConnection();

String ppgServer = ppgUrl.getHost();
http.setDoInput(true);
http.setRequestProperty("Content-Type", CONTENT_TYPE);
http.setDoOutput(true);
PrintWriter out = new PrintWriter(new BufferedOutputStream(
http.getOutputStream()));
out.println("--multipart-boundary");
out.println("Content-type: application/xml");
out.println();
out.println(createPapMessage(clientAddress, addressType, ppgServer,
genPushId(), null));
out.println();
out.println("--multipart-boundary");
out.println("Content-type: " + mimeType);
out.println();
out.println(createSiMessage("www.example.com/push.wml","D123","sample text"));
out.println();
out.println("--multipart-boundary--");
out.flush();
out.close();
http.connect();
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5293
Registered: 08-2008
Posted on Thursday, May 07, 2015 - 12:49 pm:   


quote:

Now it is giving this response


Accepted

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 1.0//EN" "http://www.wapforum.org/DTD/pap_1.0.dtd">
<pap>
<push-response push-id="1430971815766:0">
<response-result code="1001"/>
</push-response>
</pap>

when i can this kind of response?




We only support the older version. The XML elements are the same, and the main attributes are the same.

I do not see a problem.

--
Des
NowSMS Support
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 5294
Registered: 08-2008
Posted on Thursday, May 07, 2015 - 12:54 pm:   


quote:

Moreover I need to confirm that am I writing right request to get the response?




Show me the complete raw PAP request, not code. I have no idea what variable values are set prior to that code snippet, and I have no idea what content is generated by some of the functions.

I would go so far as to suggest that you use Wireshark to trace the request and verify that the request is in the format you expect.

Have you tried sending push messages from our web interface?

--
Des
NowSMS Support
Arnold
New member
Username: Arnold

Post Number: 3
Registered: 11-2018
Posted on Friday, November 09, 2018 - 09:33 am:   

try to send push messages

Add Your Message Here, or click here to create a new discussion topic.
Post:
Bold text Italics Underline Create a hyperlink Insert a clipart image
Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Click here to create an account.
Username:
Password:
Options: Automatically activate URLs in message
Action:

Login Login / Register Logout Logout Search Last 30 Days Topics Topics