PDA

View Full Version : استفاده از web service برای ارسال sms در Vb



akram_raeespour
دوشنبه 07 اسفند 1385, 16:29 عصر
سلام
من یک برنامه در vb دارم که باید sms ارسال کند. تا این جا می دانم که باید از Microsoft soap type library استفاده کنم. و کد آن را هم پیدا کردم. در واقع برنامه من باید یک تابع واقع در یک سرور برای ارسال sms اجرا کند. این سرور یک فایل با نام WSDL هم دارد که با فرمت XML است. که من از URL آن در کدم استفاده می کنم. اما هنگام ارسال برنامه این error را می دهد.
WSDL Reader:Analyzing the WSDL file failed HRESULT=0x80004005 -
WSDL Reader: Initialization of service failed HRESULT=0x80004005 -
WSDL Service: Initialization of the port for service SMSServer frailed HRESULT=0x80004005 - WSDL Port: Analyzing the binding information for port SMSServerPort failed HRESULT =0x80004005 - WSDLPort: An operation for port SMSServerPort could not be initialized HRESULT= 0x80004005 - WSDLOperation: Initializina of the input
لینک فایل wsdl من هم این است:
http://iran.tc/WebService/Service.php?wsdl
کد استفاده از آن هم این است:
Dim par(5) As Variant
Dim clnt As New SoapClient
Dim strsvc As String
clnt.mssoapinit "http://iran.tc/WebService/Service.php?wsdl"
par(1) = "username"
par(2) = "password"
par(3) = "9153249858" 'girandeh sms
par(4) = "Hello world!" 'matn sms
par(5) = "30009900001111" 'ferestandeh sms
strsvc = clnt.sensms(par)
MsgBox strsvc
Please help me!! i'm confused!!
:متفکر: