起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 439|回复: 20

[重要]webservice功能实现**

[复制链接]
发表于 2008-7-2 09:48:27 | 显示全部楼层 |阅读模式
x3平台是否支持webservice功能实现,能否实现调用远程函数的功能。
回复

使用道具 举报

发表于 2008-7-2 09:50:01 | 显示全部楼层
可以
请用关键字  webservice   搜索一下 alang 的贴子
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-2 17:50:25 | 显示全部楼层
看了alang的帖子了,但是出现了一些问题。
执行第3步的时候出错。
以下是生成的pas接口文件的文本形式。附件是具体接口内容。
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://10.143.47.8:8081/ERPwebse ... finishWorkForm?wsdl
// Encoding : UTF-8
// Version  : 1.0
// (2008-7-2 17:35:01 - $Revision:   1.9.1.0.1.0.1.9  $)
// ************************************************************************ //

unit finishWorkForm;

interface

uses InvokeRegistry, 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"


  // ************************************************************************ //
  // Namespace : http://localhost/ERPwebservice/finishWorkForm
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : finishWorkFormHttpBinding
  // service   : finishWorkForm
  // port      : finishWorkFormHttpPort
  // URL       : http://10.143.47.8:8081/ERPwebservice/services/finishWorkForm
  // ************************************************************************ //
  finishWorkFormPortType = interface(IInvokable)
  ['{19E84984-5EDF-887A-EA3A-B1C2C7C13D55}']
    function  finishWorkForm(const gdh: String): String; stdcall;
  end;

function GetfinishWorkFormPortType(UseWSDL: Boolean; Addr: string): finishWorkFormPortType;


implementation
  uses SOAPHTTPClient;

function GetfinishWorkFormPortType(UseWSDL: Boolean; Addr: string): finishWorkFormPortType;
const
  defWSDL = 'http://10.143.47.8:8081/ERPwebservice/services/finishWorkForm?wsdl';
  defURL  = 'http://10.143.47.8:8081/ERPwebservice/services/finishWorkForm';
  defSvc  = 'finishWorkForm';
  defPrt  = 'finishWorkFormHttpPort';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  RIO := THTTPRIO.Create(nil);
  try
     if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
    Result := (RIO as finishWorkFormPortType);
  finally
    if Result = nil then
      RIO.Free;
  end;
end;


initialization
  InvRegistry.RegisterInterface(TypeInfo(finishWorkFormPortType), 'http://localhost/ERPwebservice/finishWorkForm', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(finishWorkFormPortType), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(finishWorkFormPortType), ioDocument);

end.

finishworkform.rar

1.17 KB, 下载次数: 54

回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-2 17:53:38 | 显示全部楼层
报告的错误是以下。但是我试了无数次,根据错误分析修改,却无法正常生成注册文件。
Access violation at address
004BE4FC in module 'DelphiImporter.exe'. Read of address 00000000
回复 支持 反对

使用道具 举报

发表于 2008-7-2 18:25:26 | 显示全部楼层
我测试一下,之后回复
回复 支持 反对

使用道具 举报

发表于 2008-7-3 09:53:30 | 显示全部楼层
楼主,我这里测试过,导入没有问题。
你检查一下delphi环境,是否是delphi6 + sp2
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-3 11:11:10 | 显示全部楼层
是在delphi6+sp2环境下进行。
我把已经执行的步骤,生成的文件打包发上来了。
请帮我看看是不是还有其他什么原因。
例如,配置啊什么的。

webservice.rar

1.54 KB, 下载次数: 60

回复 支持 反对

使用道具 举报

发表于 2008-7-3 11:18:34 | 显示全部楼层
ws.bat文件中, -cws.ipr   写成了 -ws.ipr  ,所以出错了。
再试试
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-3 11:33:27 | 显示全部楼层
修改完了,还是报一样的错误。
你们那里可以试下,在我的配置下,能不能编译的吗?
还有为什么老是这个错误?究竟是什么原因呢?
回复 支持 反对

使用道具 举报

发表于 2008-7-3 11:57:02 | 显示全部楼层
这是我测试的,没有问题
我测试时,文件是放在D:\X3Importer\doc中执行的

doc.rar

1.84 KB, 下载次数: 58

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-18 20:03 , Processed in 0.042319 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表