用xe6呼叫微博service報如下錯誤,不知道為什么,用delphi7呼叫不報錯,但引數傳上去變成空值
uj5u.com熱心網友回復:
看是像java后臺的錯誤啊.delphi7和XE的編譯環境不一樣了。像有些資料型別的長度等產生了變化
uj5u.com熱心網友回復:
看具體函式的定義和引數上傳的代碼uj5u.com熱心網友回復:
java端的Web服務,引數空值是有一個地方傳的引數不對!在生成的Web服務單元中,找一下InvRegistry.RegisterInvokeOptions(TypeInfo(xxxxxxxxServiceSoap), ioDocument);
改一下ioDocument這個引數,如果沒有加上這一句,然后在改一下試試!引數為空一般情況是這里的問題。
uj5u.com熱心網友回復:
nm_wyh說的這句有的,除了ioDocument引數改成其他引數都會報EJB Exception錯誤,參考webservice代碼如下,大家看看,這是哪的問題,快崩潰了。// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://58.216.220.27:8004/SlowUploadService/SlowUploadService?WSDL
// >Import : http://58.216.220.27:8004/SlowUploadService/SlowUploadService?WSDL:0
// >Import : http://58.216.220.27:8004/SlowUploadService/SlowUploadService?xsd=1
// Encoding : UTF-8
// Version : 1.0
// (2014-09-22 15:37:34 - - $Rev: 10138 $)
// ************************************************************************ //
unit SlowUploadService1;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
const
IS_OPTN = $0001;
IS_NLBL = $0004;
IS_UNQL = $0008;
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.
// ************************************************************************ //
// !:base64Binary - "http://www.w3.org/2001/XMLSchema"[Gbl]
// !:string - "http://www.w3.org/2001/XMLSchema"[Gbl]
// ************************************************************************ //
// Namespace : http://service.cz.slowup.chis.com/
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// binding : SlowUploadServicePortBinding
// service : SlowUploadService
// port : SlowUploadServicePort
// URL : http://58.216.220.27:8004/SlowUploadService/SlowUploadService
// ************************************************************************ //
SlowUploadService = interface(IInvokable)
['{2C40B69E-7CB9-F1B6-9360-51C42A807B23}']
function uploadSlowCase(const arg0: WideString; const arg1: WideString; const arg2: TByteDynArray): TByteDynArray; stdcall;
end;
function GetSlowUploadService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): SlowUploadService;
implementation
uses SysUtils;
function GetSlowUploadService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): SlowUploadService;
const
defWSDL = 'http://58.216.220.27:8004/SlowUploadService/SlowUploadService?WSDL';
defURL = 'http://58.216.220.27:8004/SlowUploadService/SlowUploadService';
defSvc = 'SlowUploadService';
defPrt = 'SlowUploadServicePort';
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 SlowUploadService);
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(SlowUploadService), 'http://service.cz.slowup.chis.com/', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(SlowUploadService), '');
InvRegistry.RegisterInvokeOptions(TypeInfo(SlowUploadService), ioDocument);
end.
uj5u.com熱心網友回復:
求高手幫忙!!!!!!!!!!!轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/97427.html
標籤:網絡通信/分布式開發
上一篇:Dubbo系列之服務暴露程序
