Delphi转java、soap delphi、短信发送

发布于 2024-08-04 23:32:00 字数 6119 浏览 2 评论 0原文

我正在编写一个代码,我需要从短信服务提供商发送短信,他们给我提供了delphy程序,可以从他们的服务发送短信,但我不知道delphy,我应该将此代码更改为java 任何人都可以指导我如何更改此代码吗? 我认为这是肥皂服务

    // ************************************************************************ //

// The types declared in this file were generated from data read from the

// WSDL File described below:

// WSDL     : http://mihansmscenter.com/webservice/?wsdl

// Encoding : ISO-8859-1

// Version  : 1.0

// (8/14/2007 6:51:27 PM - 1.33.2.5)

// ************************************************************************ //



unit IMihanSMSCenterService;



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"



  stringArray = array of WideString;            { "http://mihansmscenter.com/webservice/" }

  intArray   = array of Integer;                { "http://mihansmscenter.com/webservice/" }



  // ************************************************************************ //

  // Namespace : http://mihansmscenter.com/webservice/

  // soapAction: http://mihansmscenter.com/webservice/#%operationName%

  // transport : http://schemas.xmlsoap.org/soap/http

  // style     : rpc

  // binding   : mihansmscenterWSDLBinding

  // service   : mihansmscenterWSDL

  // port      : mihansmscenterWSDLPort

  // URL       : http://www.mihansmscenter.com/webservice/index.php

  // ************************************************************************ //

  mihansmscenterWSDLPortType = interface(IInvokable)

  ['{7B1648E6-5147-A087-2C5C-7FF87155D985}']

    procedure send(const username: WideString; const password: WideString; const to_: WideString; const from: WideString; const message: WideString; const send_time: Integer; out status: Integer; out identifier: Integer; out status_message: WideString); stdcall;

    procedure multiSend(const username: WideString; const password: WideString; const to_: stringArray; const from: WideString; const message: WideString; const send_time: Integer; out status: Integer; out send_results: intArray; out identifiers: intArray; out status_message: WideString

                        ); stdcall;

    procedure checkSendStatus(const username: WideString; const password: WideString; const identifier: Integer; out status: Integer; out sendStatus: Integer; out status_message: WideString); stdcall;

    procedure bulkSend(const username: WideString; const password: WideString; const count: Integer; const from: WideString; const message: WideString; const description: WideString; out status: Integer; out status_message: WideString); stdcall;

    procedure verifyReceive(const username: WideString; const password: WideString; const to_: WideString; const from: WideString; const message: WideString; const timestamp: Integer; out status: Integer; out status_message: WideString); stdcall;

    procedure accountInfo(const username: WideString; const password: WideString; out status: Integer; out status_message: WideString; out remaining_sms: Integer; out total_sms: Integer; out received_sms: Integer; out sent_sms: Integer; out recieve_url: WideString; out sms_numbers: stringArray

                          ); stdcall;

    procedure changeReceiveURL(const username: WideString; const password: WideString; const receive_url: WideString; out status: Integer; out status_message: WideString); stdcall;

    procedure changePassword(const username: WideString; const password: WideString; const new_password: WideString; out status: Integer; out status_message: WideString); stdcall;

  end;



function GetmihansmscenterWSDLPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): mihansmscenterWSDLPortType;





implementation



function GetmihansmscenterWSDLPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): mihansmscenterWSDLPortType;

const

  defWSDL = 'http://mihansmscenter.com/webservice/?wsdl';

  defURL  = 'http://www.mihansmscenter.com/webservice/index.php';

  defSvc  = 'mihansmscenterWSDL';

  defPrt  = 'mihansmscenterWSDLPort';

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 mihansmscenterWSDLPortType);

    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;





initialization

  InvRegistry.RegisterInterface(TypeInfo(mihansmscenterWSDLPortType), 'http://mihansmscenter.com/webservice/', 'ISO-8859-1');

  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(mihansmscenterWSDLPortType), 'http://mihansmscenter.com/webservice/#%operationName%');

  InvRegistry.RegisterExternalParamName(TypeInfo(mihansmscenterWSDLPortType), 'send', 'to_', 'to');

  InvRegistry.RegisterExternalParamName(TypeInfo(mihansmscenterWSDLPortType), 'multiSend', 'to_', 'to');

  InvRegistry.RegisterExternalParamName(TypeInfo(mihansmscenterWSDLPortType), 'verifyReceive', 'to_', 'to');

  RemClassRegistry.RegisterXSInfo(TypeInfo(stringArray), 'http://mihansmscenter.com/webservice/', 'stringArray');

  RemClassRegistry.RegisterXSInfo(TypeInfo(intArray), 'http://mihansmscenter.com/webservice/', 'intArray');



end.

I am working on a code which I need to send sms messages from a sms service provider they get me delphy program that can send a sms from their service but i dont know delphy and i should change this code to java
Can anyboddy guide me that how can i change this code?
I think this is a soap service

    // ************************************************************************ //

// The types declared in this file were generated from data read from the

// WSDL File described below:

// WSDL     : http://mihansmscenter.com/webservice/?wsdl

// Encoding : ISO-8859-1

// Version  : 1.0

// (8/14/2007 6:51:27 PM - 1.33.2.5)

// ************************************************************************ //



unit IMihanSMSCenterService;



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"



  stringArray = array of WideString;            { "http://mihansmscenter.com/webservice/" }

  intArray   = array of Integer;                { "http://mihansmscenter.com/webservice/" }



  // ************************************************************************ //

  // Namespace : http://mihansmscenter.com/webservice/

  // soapAction: http://mihansmscenter.com/webservice/#%operationName%

  // transport : http://schemas.xmlsoap.org/soap/http

  // style     : rpc

  // binding   : mihansmscenterWSDLBinding

  // service   : mihansmscenterWSDL

  // port      : mihansmscenterWSDLPort

  // URL       : http://www.mihansmscenter.com/webservice/index.php

  // ************************************************************************ //

  mihansmscenterWSDLPortType = interface(IInvokable)

  ['{7B1648E6-5147-A087-2C5C-7FF87155D985}']

    procedure send(const username: WideString; const password: WideString; const to_: WideString; const from: WideString; const message: WideString; const send_time: Integer; out status: Integer; out identifier: Integer; out status_message: WideString); stdcall;

    procedure multiSend(const username: WideString; const password: WideString; const to_: stringArray; const from: WideString; const message: WideString; const send_time: Integer; out status: Integer; out send_results: intArray; out identifiers: intArray; out status_message: WideString

                        ); stdcall;

    procedure checkSendStatus(const username: WideString; const password: WideString; const identifier: Integer; out status: Integer; out sendStatus: Integer; out status_message: WideString); stdcall;

    procedure bulkSend(const username: WideString; const password: WideString; const count: Integer; const from: WideString; const message: WideString; const description: WideString; out status: Integer; out status_message: WideString); stdcall;

    procedure verifyReceive(const username: WideString; const password: WideString; const to_: WideString; const from: WideString; const message: WideString; const timestamp: Integer; out status: Integer; out status_message: WideString); stdcall;

    procedure accountInfo(const username: WideString; const password: WideString; out status: Integer; out status_message: WideString; out remaining_sms: Integer; out total_sms: Integer; out received_sms: Integer; out sent_sms: Integer; out recieve_url: WideString; out sms_numbers: stringArray

                          ); stdcall;

    procedure changeReceiveURL(const username: WideString; const password: WideString; const receive_url: WideString; out status: Integer; out status_message: WideString); stdcall;

    procedure changePassword(const username: WideString; const password: WideString; const new_password: WideString; out status: Integer; out status_message: WideString); stdcall;

  end;



function GetmihansmscenterWSDLPortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): mihansmscenterWSDLPortType;





implementation



function GetmihansmscenterWSDLPortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): mihansmscenterWSDLPortType;

const

  defWSDL = 'http://mihansmscenter.com/webservice/?wsdl';

  defURL  = 'http://www.mihansmscenter.com/webservice/index.php';

  defSvc  = 'mihansmscenterWSDL';

  defPrt  = 'mihansmscenterWSDLPort';

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 mihansmscenterWSDLPortType);

    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;





initialization

  InvRegistry.RegisterInterface(TypeInfo(mihansmscenterWSDLPortType), 'http://mihansmscenter.com/webservice/', 'ISO-8859-1');

  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(mihansmscenterWSDLPortType), 'http://mihansmscenter.com/webservice/#%operationName%');

  InvRegistry.RegisterExternalParamName(TypeInfo(mihansmscenterWSDLPortType), 'send', 'to_', 'to');

  InvRegistry.RegisterExternalParamName(TypeInfo(mihansmscenterWSDLPortType), 'multiSend', 'to_', 'to');

  InvRegistry.RegisterExternalParamName(TypeInfo(mihansmscenterWSDLPortType), 'verifyReceive', 'to_', 'to');

  RemClassRegistry.RegisterXSInfo(TypeInfo(stringArray), 'http://mihansmscenter.com/webservice/', 'stringArray');

  RemClassRegistry.RegisterXSInfo(TypeInfo(intArray), 'http://mihansmscenter.com/webservice/', 'intArray');



end.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦幻的心爱 2024-08-11 23:32:00

您唯一感兴趣的是 WSDL:

http://mihansmscenter.com/webservice/?wsdl

选择 Java WS API 之一 - Axis、JAX-WS 等 - 然后从 WSDL 生成 Web 服务的客户端存根,并编写 Java 代码来处理这些存根。

Delphi 代码的其余部分对您来说几乎毫无用处。您可能想询问使用 Delphi 接口的代码,这样您就可以看到如何进行调用 - 例如密码是否加密等,因为您显然希望遵守这一点。

The only bit you are interested in is the WSDL:

http://mihansmscenter.com/webservice/?wsdl

Pick one of the Java WS APIs - Axis, JAX-WS, etc - then generate the client stubs for the web-service from the WSDL and write your Java code to work against those.

The rest of the Delphi code is pretty much useless to you. You might want to ask for the code that uses the Delphi interface, just so you can see how the calls are being made - stuff like are the passwords encrypted, etc because you'll obviously want to conform to that.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文