Calling a Web service through 2-way SMS

Calling a Web service through 2-way SMS SearchSearch
Author Message
Norman Holtzhausen
New member
Username: Nholtzha

Post Number: 1
Registered: 07-2006
Posted on Sunday, July 16, 2006 - 11:58 pm:   

I have created a web service, in Visual Studio.net, that I want to call through an incoming SMS. The user will send in the answer to a question and their email address. The SMS gateway must call the wev service, passing the mobile number and contents of the SMS to the service. The web service will then insert the details into a database and create a message to send back.

I have set up a default 2-way SMS command as follows:
http://127.0.0.1/Service.asmx?op=GetContent&sMobile=@@SENDER@@&sTagg=@@SMSPREFIX@@&sEmail=@@SMS@@

However, this is not working. The incoming SMS message gets a response: "Command not completed. Request returned invalid command type". What do I need to do to make this work?
Norman Holtzhausen
New member
Username: Nholtzha

Post Number: 2
Registered: 07-2006
Posted on Monday, July 17, 2006 - 12:46 am:   

Ah, well just after posting this I solved the first problem, namely that my URL was wrong. It should have been:

http://127.0.0.1/Service.asmx/GetContent&sMobile=@@SENDER@@&sTagg=@@SMSPREFIX@@&sEmail=@@SMS@@

The other thing is that I needed to un-check the "Command returns response text" box. Now it works fine, but I need to manually send a reply i.e. the gateway is not accepting the response string and automatically sending that out.

Bryce Norwood - NowSMS Support
Board Administrator
Username: Bryce

Post Number: 6243
Registered: 10-2002
Posted on Wednesday, July 26, 2006 - 08:24 pm:   

Hi,

If you want to return a response, check "Command returns response text".

However, your URL must return a response that is plain text.

Alternatively, you could initiate a new HTTP request from your application back to NowSMS to perform an HTTP GET to send the message that you want to send.