delphi7調用webservice Java 傳入參數為空



在delphi7中,new-webservices-wsdl importer中輸入wsdl地址,會自動生成wsdl單元代碼。
在調用時,傳入參數到服務器端時為空了。

網上說缺少
InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceRS_JGXXPortType), ioDocument);
這句,可是我的代碼里都有的。

以下是代碼里的前四句
InvRegistry.RegisterInterface(TypeInfo(ServiceRS_JGXXPortType), 'http://release.service.das.jeaw.com', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(ServiceRS_JGXXPortType), 'urn:%operationName%');
InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceRS_JGXXPortType), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceRS_JGXXPortType), ioLiteral);

請高人指點下,為什么傳入參數為空?

解答:

加上最后一句試試

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;
RIO.HTTPWebNode.UseUTF8InHeader:= True;//加上這句

InvRegistry.RegisterInvokeOptions(TypeInfo(WebService1Soap),ioDocument);
這其中,WebService1Soap是你的對象名.按自己的情況改就是了.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM