با سلام
دوست عزيز ميشه خودتون يه تغييري بديد. تو نمونه برنامه اي كه فرستادم هست.
چون ارائه دهنده سرويس ميگه هيچ تغييري در هدر نداشته و همون هدر قبلي ارسال شده
Printable View
با سلام
دوستان عزیز لطفا بفرمایید مشکل زیر مربوط به چیست؟
با تشکر
http://upload7.ir/imgs/2014-01/52661757165497021386.png
باسلام خدمت شما دوستان عزیز
من یه سورس ضمینه کردم که برای ارسال شماره 3000 هستش
لطفا بازبینیش کنید و کمکم کنید که بتونم ازش استفاده کنم و لوگین کنم به وب سرویسم و پیامک ارسال کنم
راستی اصلا نمیدونم باید کجا آدرس وب سرویس سایت خدمات sms رو وارد کنم
با تشکر از شما استاید محترم
sms sample.part1.rar
sms sample.part2.rar
sms sample.part3.rar
sms sample.part4.rar
شما برنامه رو دادی توش فقط DLL کال کردی بعد می گی ارور دارم؟!!
چشم دی ال ال بین نداریم که دوست عزیز.
از کی این فایل رو گرفتی؟
از یکی از پست های همین سایت دانلود کردم
دوست عزیز فایل ضمینه (sms.rar)که شما ارسال کرده بودین در این تاپیک هم مشکل داشت و ارور میداد
از اینجا دانلود کردم
https://barnamenevis.org/showthread.p...DB%8C-30000%29
دوست عزیز حالا من چیکار باید انجام بدم که بشه با سورس ارسال پیامک انجام بدم
آدرس WSDL سایتی که وب سرویس ارائه می ده چیه؟
اصلا با وب سرویسه یا دیوایس داره؟ چه شرکتی؟ سایت داره؟ یا با پنل سخت افزاری ارسال می کنید؟
http://parsasms.com/webservice/v2.asmx?WSDL
شرکت اصلی قاصدک هستش
http://ghasedak-ict.com/
اون فایلی که شما گرفتید داستانش فرق داره. بگردید دنبال ارتباط با وب سرویس در دلفی، خود من نمونه اش رو هم گذاشتم.
موفق باشید.
دوست عزیز سرچ کردم چیز درستی پیدا نکردم
میشه نمونه سورسی برام قرار دهید تا با مطالعه اون بیشتر با وب سرویس ها آشنا بشم
وب سرویس ساده ای داره :
کدشم که معلومه :
Getv2Soap().SendSMS()
برای آشنا شدن با وب سرویس ها فیلم شاهین رو پیشنهاد میکنم.
دوست عزیز میشه برام یه سورس نمونه ضمینه کنید
یکم هم خودتون زحمت بکشید.
نمونه کد چی؟ کدش به سادگی کدی هست که Gold گذاشت.
نمونه سورس رو هم که من گذاشتم. شروع کنید به یادگیری و تمرین و آزمون و خطا، ما هم کمک می کنیم. سوالاتون رو بپرسید. مثلا این که چکار کردید؟ به کجا رسیدید؟ کجا گیر کردید؟
سورس sms.rar که شما ضمینه کردین باید توی کدوم خط کد یوزر و پسورد خودمو وارد کنم که به سرویس پیامکی که متعلق به خودمه متصل بشم ؟
تنبلی دارید می کنید دوست عزیز:
https://barnamenevis.org/showthread.p...=1#post1905918
دوست عزیز سورس تست رو براتون پیام خصوصی کردن لطفا بازبینیش میکنید ؟
دوست عزیز این ارور رو میده
http://uplod.ir/mvlmxneirps7/erroe.JPG.htm
سورس:
http://uplod.ir/i2alnruai8jg/test.rar.htm
1- در مورد پیام خصوصی می تونید نظر من رو در امضا ببینید.
2- فایلی که دادید خودتون تا حالا ران کردید؟
3- یونیت v کجاست؟
4- یوزر پس کجاست؟
5- ..
دوست عزیز من باید سرویس و پورت رو چی قرار بدم ؟
با سلام
دوست عزيز You-See خسته نباشيد
چندي قبل در خصوص مشكل ارتباط با وب سرويس شركت "سامانه پيام كوتاه پيشخوان" صحبت كرده بوديم. در اين پست شما گفتيد معلوم نيست چه چيزي نوشتن. من هنوز مشكلم رو نتونستم با اون شركت حل كنم. شما راه حلي نميتونين پيشنهاد كنيد؟
يه چنين يونيتي رو اضافه كردم ولي هيچ جوابي نميده. جديدا هرچي ميذارم ميگه كاربر مورد نظر وجود ندارد.
برنامه كامل همراه با يوزر و پسورد رو هم براتون پيام خصوصي كردم
// ************************************************** ********************** //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://ws.smspishkhan.ir/SmsService.asmx?wsdl
// Encoding : utf-8
// Version : 1.0
// (2013/11/04 12:56:02 È.Ù - 1.33.2.5)
// ************************************************** ********************** //
unit SmsService;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
type
// ************************************************** ********************** //
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
// ************************************************** ********************** //
// !:string - "http://www.w3.org/2001/XMLSchema"
// !:int - "http://www.w3.org/2001/XMLSchema"
// !:decimal - "http://www.w3.org/2001/XMLSchema"
// !:short - "http://www.w3.org/2001/XMLSchema"
// !:float - "http://www.w3.org/2001/XMLSchema"
AccountCredentials = class; { "http://smspishkhan.ir/webservices/"[H] }
WsResponce = class; { "http://smspishkhan.ir/webservices/" }
WsMessageInfo = class; { "http://smspishkhan.ir/webservices/" }
WsSendResponce = class; { "http://smspishkhan.ir/webservices/" }
WsListOfStringResponce = class; { "http://smspishkhan.ir/webservices/" }
WsScheduleInfo = class; { "http://smspishkhan.ir/webservices/" }
WsRecieveMessage = class; { "http://smspishkhan.ir/webservices/" }
WsRecieveResponce = class; { "http://smspishkhan.ir/webservices/" }
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
AccountCredentials = class(TSOAPHeader)
private
Fusername: WideString;
Fpassword: WideString;
published
property username: WideString read Fusername write Fusername;
property password: WideString read Fpassword write Fpassword;
end;
ArrayOfDecimal = array of TXSDecimal; { "http://smspishkhan.ir/webservices/" }
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
WsResponce = class(TRemotable)
private
FErrorCode: Integer;
FErrorDesc: WideString;
published
property ErrorCode: Integer read FErrorCode write FErrorCode;
property ErrorDesc: WideString read FErrorDesc write FErrorDesc;
end;
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
WsMessageInfo = class(TRemotable)
private
FMessagesId: TXSDecimal;
FRecipient: WideString;
FPartsCount: Smallint;
FTariff: Single;
FAmount: TXSDecimal;
FStatus: Smallint;
FStatusTime: WideString;
FResponseDesc: WideString;
FUserMessageRef: WideString;
public
destructor Destroy; override;
published
property MessagesId: TXSDecimal read FMessagesId write FMessagesId;
property Recipient: WideString read FRecipient write FRecipient;
property PartsCount: Smallint read FPartsCount write FPartsCount;
property Tariff: Single read FTariff write FTariff;
property Amount: TXSDecimal read FAmount write FAmount;
property Status: Smallint read FStatus write FStatus;
property StatusTime: WideString read FStatusTime write FStatusTime;
property ResponseDesc: WideString read FResponseDesc write FResponseDesc;
property UserMessageRef: WideString read FUserMessageRef write FUserMessageRef;
end;
ArrayOfWsMessageInfo = array of WsMessageInfo; { "http://smspishkhan.ir/webservices/" }
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
WsSendResponce = class(WsResponce)
private
FRequestId: TXSDecimal;
FTotalCount: TXSDecimal;
FTotalParts: TXSDecimal;
FTotalAmount: TXSDecimal;
FIsPartitioned: Smallint;
FStatus: Smallint;
FStatusTime: WideString;
FMessages: ArrayOfWsMessageInfo;
FSubRequestsId: ArrayOfDecimal;
public
destructor Destroy; override;
published
property RequestId: TXSDecimal read FRequestId write FRequestId;
property TotalCount: TXSDecimal read FTotalCount write FTotalCount;
property TotalParts: TXSDecimal read FTotalParts write FTotalParts;
property TotalAmount: TXSDecimal read FTotalAmount write FTotalAmount;
property IsPartitioned: Smallint read FIsPartitioned write FIsPartitioned;
property Status: Smallint read FStatus write FStatus;
property StatusTime: WideString read FStatusTime write FStatusTime;
property Messages: ArrayOfWsMessageInfo read FMessages write FMessages;
property SubRequestsId: ArrayOfDecimal read FSubRequestsId write FSubRequestsId;
end;
ArrayOfString = array of WideString; { "http://smspishkhan.ir/webservices/" }
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
WsListOfStringResponce = class(WsResponce)
private
FLines: ArrayOfString;
published
property Lines: ArrayOfString read FLines write FLines;
end;
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
WsScheduleInfo = class(TRemotable)
private
FScheduleTime: WideString;
FIntervalPeriod: Integer;
FIntervalCount: Integer;
FDayStartTime: WideString;
FDayEndTime: WideString;
published
property ScheduleTime: WideString read FScheduleTime write FScheduleTime;
property IntervalPeriod: Integer read FIntervalPeriod write FIntervalPeriod;
property IntervalCount: Integer read FIntervalCount write FIntervalCount;
property DayStartTime: WideString read FDayStartTime write FDayStartTime;
property DayEndTime: WideString read FDayEndTime write FDayEndTime;
end;
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
WsRecieveMessage = class(TRemotable)
private
FId: TXSDecimal;
FLineNo: WideString;
FSenderNo: WideString;
FUDH: WideString;
FBody: WideString;
FEncoding: Smallint;
FTariff: Single;
FPartsCount: Smallint;
FAmount: TXSDecimal;
FRecieveTime: WideString;
public
destructor Destroy; override;
published
property Id: TXSDecimal read FId write FId;
property LineNo: WideString read FLineNo write FLineNo;
property SenderNo: WideString read FSenderNo write FSenderNo;
property UDH: WideString read FUDH write FUDH;
property Body: WideString read FBody write FBody;
property Encoding: Smallint read FEncoding write FEncoding;
property Tariff: Single read FTariff write FTariff;
property PartsCount: Smallint read FPartsCount write FPartsCount;
property Amount: TXSDecimal read FAmount write FAmount;
property RecieveTime: WideString read FRecieveTime write FRecieveTime;
end;
ArrayOfWsRecieveMessage = array of WsRecieveMessage; { "http://smspishkhan.ir/webservices/" }
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// ************************************************** ********************** //
WsRecieveResponce = class(WsResponce)
private
FRecieveMessages: ArrayOfWsRecieveMessage;
public
destructor Destroy; override;
published
property RecieveMessages: ArrayOfWsRecieveMessage read FRecieveMessages write FRecieveMessages;
end;
// ************************************************** ********************** //
// Namespace : http://smspishkhan.ir/webservices/
// soapAction: http://smspishkhan.ir/webservices/%operationName%
// transport : http://schemas.xmlsoap.org/soap/http
// binding : SmsServiceSoap
// service : SmsService
// port : SmsServiceSoap
// URL : http://ws.smspishkhan.ir/SmsService.asmx
// ************************************************** ********************** //
SmsServiceSoap = interface(IInvokable)
['{18256B71-4CBE-04CC-E231-F277B843141D}']
function SendMessage(const lineNo: WideString; const body: WideString; const recipient: WideString; const messageClass: Integer; const scheduleTime: WideString): WsSendResponce; stdcall;
function SendGroupMessage(const lineNo: WideString; const body: WideString; const recipients: ArrayOfString; const messageClass: Integer; const scheduleInfo: WsScheduleInfo): WsSendResponce; stdcall;
function GetUserLines: WsListOfStringResponce; stdcall;
function RecieveMessages(const lineNo: WideString; const timeFrom: WideString; const messageCount: Integer): WsRecieveResponce; stdcall;
function GetRequestStatus(const requestId: TXSDecimal): WsSendResponce; stdcall;
end;
function GetSmsServiceSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): SmsServiceSoap;
implementation
procedure HTTPRIO1BeforeExecute(const MethodName: String;
var SOAPRequest: WideString);
begin
SOAPRequest :=
'<?xml version="1.0" encoding="utf-8"?>' +
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'+
// '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' +
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
'xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +
'<soap:Header>' +
'<AccountCredentials xmlns="http://smspishkhan.ir/webservices/">' +
'<username>user</username>' +
'<password>pass</password>' +
'</AccountCredentials>' +
'</soap:Header>' +
'<soap:Body>' +
'<SendMessage xmlns="http://smspishkhan.ir/webservices/">' +
'<lineNo>10000333000000<lineNo>' +
'<body>test</body>' +
'<recipient>9115152509</recipient>' +
'<messageClass>0</messageClass>' +
'</SendMessage>' +
'</soap:Body>' +
'</soap:Envelope>' ;
end;
function GetSmsServiceSoap(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): SmsServiceSoap;
const
defWSDL = 'http://ws.smspishkhan.ir/SmsService.asmx?wsdl';
defURL = 'http://ws.smspishkhan.ir/SmsService.asmx';
defSvc = 'SmsService';
defPrt = 'SmsServiceSoap';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as SmsServiceSoap);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
destructor WsMessageInfo.Destroy;
begin
if Assigned(FMessagesId) then
FMessagesId.Free;
if Assigned(FAmount) then
FAmount.Free;
inherited Destroy;
end;
destructor WsSendResponce.Destroy;
var
I: Integer;
begin
for I := 0 to Length(FMessages)-1 do
if Assigned(FMessages[I]) then
FMessages[I].Free;
SetLength(FMessages, 0);
for I := 0 to Length(FSubRequestsId)-1 do
if Assigned(FSubRequestsId[I]) then
FSubRequestsId[I].Free;
SetLength(FSubRequestsId, 0);
if Assigned(FRequestId) then
FRequestId.Free;
if Assigned(FTotalCount) then
FTotalCount.Free;
if Assigned(FTotalParts) then
FTotalParts.Free;
if Assigned(FTotalAmount) then
FTotalAmount.Free;
inherited Destroy;
end;
destructor WsRecieveMessage.Destroy;
begin
if Assigned(FId) then
FId.Free;
if Assigned(FAmount) then
FAmount.Free;
inherited Destroy;
end;
destructor WsRecieveResponce.Destroy;
var
I: Integer;
begin
for I := 0 to Length(FRecieveMessages)-1 do
if Assigned(FRecieveMessages[I]) then
FRecieveMessages[I].Free;
SetLength(FRecieveMessages, 0);
inherited Destroy;
end;
initialization
InvRegistry.RegisterInterface(TypeInfo(SmsServiceS oap), 'http://smspishkhan.ir/webservices/', 'utf-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Sms ServiceSoap), 'http://smspishkhan.ir/webservices/%operationName%');
InvRegistry.RegisterHeaderClass(TypeInfo(SmsServic eSoap), AccountCredentials, 'AccountCredentials', '');
RemClassRegistry.RegisterXSClass(AccountCredential s, 'http://smspishkhan.ir/webservices/', 'AccountCredentials');
RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfDe cimal), 'http://smspishkhan.ir/webservices/', 'ArrayOfDecimal');
RemClassRegistry.RegisterXSClass(WsResponce, 'http://smspishkhan.ir/webservices/', 'WsResponce');
RemClassRegistry.RegisterXSClass(WsMessageInfo, 'http://smspishkhan.ir/webservices/', 'WsMessageInfo');
RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfWs MessageInfo), 'http://smspishkhan.ir/webservices/', 'ArrayOfWsMessageInfo');
RemClassRegistry.RegisterXSClass(WsSendResponce, 'http://smspishkhan.ir/webservices/', 'WsSendResponce');
RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfSt ring), 'http://smspishkhan.ir/webservices/', 'ArrayOfString');
RemClassRegistry.RegisterXSClass(WsListOfStringRes ponce, 'http://smspishkhan.ir/webservices/', 'WsListOfStringResponce');
RemClassRegistry.RegisterXSClass(WsScheduleInfo, 'http://smspishkhan.ir/webservices/', 'WsScheduleInfo');
RemClassRegistry.RegisterXSClass(WsRecieveMessage, 'http://smspishkhan.ir/webservices/', 'WsRecieveMessage');
RemClassRegistry.RegisterXSInfo(TypeInfo(ArrayOfWs RecieveMessage), 'http://smspishkhan.ir/webservices/', 'ArrayOfWsRecieveMessage');
RemClassRegistry.RegisterXSClass(WsRecieveResponce , 'http://smspishkhan.ir/webservices/', 'WsRecieveResponce'); //'http://smspishkhan.ir/webservices'
end.
با اجازه دادا یوسف:قلب: :
دوست عزیز آخه چرا اینقدر سختش میکنید. همه چیز گویاست.
شما کافیه wsdl رو در برنامتون import کنید و در مرحله بعد با صدا زدن متد SendMessage به راحتی پیامکتون رو ارسال کنید.
عکس زیر نمایانگر راحتی کار و متدهای موردنیاز هست.
ضمیمه 118086
و با مراجعه به این لینک در مورد پارامترهای این متد هم میتونید اطلاعات لازم ر به دست بیارید.
البته اگه من جای شما بودم. سمپلهای دیگه به زبانهای دیگه ای که این شرکت آماده کرده رو میگرفتم و کدهاش رو مطالعه میکردم تا با پارامتره بیشتر آشنا بشوم.
این شرکت سمپل برای زبانهای دیگه نداره.؟ که از اونا ایده بگیرید؟
..........................update
وبسرویسشون رو تست کردم. مشکل داره . درست طراحی نشده.
بهتره یه سمپل با هر زبانی دیگه ای غیر دلفی هم اگه باشه، ازشون بگیرید تا بشه روند کار رو دید.
تو شرایط عمومی و معمولی وبسرویس درست طراحی نشده. البته شاید باید کارهای اضافی دیگه ای جهت ارتباط انجام بشه . که در نگاه اول ناقص بودن وب سویس رو نشون میده.
اینو بر اساس همون راهنمای شما نوشتم.
ببینید درسته.؟
ی زمانی من با این وب سرویسهای پیامکی همین مشکلات را داشتم ، با php سمت سرور خودم ی اسکریپت رابط نوشتم شرو کندم... :)
من نگفتم چیزی کم داره :) دلفی خداسسسسسسسسسسسسسس:قلب:
من حال سروکله زدن نداشتم صورت مسئله را پاک کردم :)