Http post to gateway failed | Search |
NowSMS Support Forums ⬆ NowSMS Support - MMS & Advanced Issues ⬆ Archive through July 14, 2004 ⬆ |
◄ ► |
Author | Message | |||
Derek Liu Unregistered guest |
I developed a simple program to post a gif file as a MMS message. I tried gateway's web interface and my cellphone received the file ok. So assume gateway itself works fine. I am using serial attached cell phone for testing. The http post was sent to http://127.0.0.1:8800 which is also the web interface address. I first got "your browser donesn't support frame" error. I then tried to disabled "menu driven interface" and the error is "unknow request" and "Error: menu not enabled". Following is the trace. please let me know what went wrong. Thanks Derek POST / HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */* Accept-Language: zh-cn Content-type: multipart/form-data; boundary=-----------------------------7d42322e401fe Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Host: 127.0.0.1 Accept: */* Content-length: 7383 Connection: Keep-Alive Cache-Control: no-cache -----------------------------7d42322e401fe Content-Disposition: form-data; name="PhoneNumber" 64986990 -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFrom" Derek test -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSSubject" test -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSText" Derek first test -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="C:\nowsms\test.gif" Content-Type: image/gif .... <ignore file's binary content> .... -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="MMSFile"; filename="" Content-Type: application/octet-stream -----------------------------7d42322e401fe Content-Disposition: form-data; name="Submit" submit -----------------------------7d42322e401fe-- HTTP/1.0 200 OK Content-type: text/html <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 framespacing=0 frameborder=0 border=0 cols="233,1*"> <frame name=LeftFrame src=TOCFrame.htm style='mso-linked-frame:auto'> <frame name=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> | |||
Derek Liu Unregistered guest |
Looks like my own program has problem. I searched through the archive and found someone posted a sample java code which used HttpClient library. I tested it and it worked for me. So I am using the sample code as reference now. This should be the end of the thread. | |||
AngKangxun New member Username: Genmaxi Post Number: 10 Registered: 03-2004 |
could you direct me to the sample java code or could you email it to me, thanks... my email is genmaxi@hotmail.com anyway yr program that can send mms to mobile cell, could u email to me too. thanks... | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 2372 Registered: 10-2002 |
Derek, My guess is that your original problem was with the MIME boundary headers. Our examples probably shouldn't include ----- characters in the boundary. Basically, the issue is that when a boundary appears in the message, two "-" characters are prepended to the boundary. On the last message part, two "-" characters are also appended to the boundary. So let's say that the boundary specified in the HTTP header was just "7d42322e401fe". The boundary that separates the different parts of the message would then be: --7d42322e401fe And the final boundary marker would be: --7d42322e401fe-- In your example, I suspect that we couldn't find any boundary markers, so we treated the message as if there were no parameters specified. -bn | |||
Bryce Norwood - NowSMS Support Board Administrator Username: Bryce Post Number: 2373 Registered: 10-2002 |
AngKangxun, I believe this is the Java example code that Derek is referring to: http://support.nowsms.com/discus/messages/485/1360.html |