介面測驗地址
測驗地址:http://223.68.184.9:8084/DAQItem/services/CallUniversalService
維修廠編號:32101594
驗證用戶名:antj_01
驗證密碼:antj_01pass2016
uj5u.com熱心網友回復:
delphi 客戶端自動生成了webserive的訪問代碼// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://223.68.184.9:8084/DAQItem/services/CallUniversalService?wsdl
// Encoding : UTF-8
// Version : 1.0
// (2017-03-22 21:47:58 - 1.33.2.5)
// ************************************************************************ //
unit CallUniversalService1;
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"
// ************************************************************************ //
// Namespace : http://service.rong
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// binding : CallUniversalServiceSoapBinding
// service : CallUniversalServiceService
// port : CallUniversalService
// URL : http://223.68.184.9:8084/DAQItem/services/CallUniversalService
// ************************************************************************ //
CallUniversalService = interface(IInvokable)
['{2D7FAF1F-C142-A89F-21C5-D321BCA855EA}']
function readStringXml(const x: WideString): WideString; stdcall;
end;
function GetCallUniversalService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): CallUniversalService;
implementation
function GetCallUniversalService(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): CallUniversalService;
const
defWSDL = 'http://223.68.184.9:8084/DAQItem/services/CallUniversalService?wsdl';
defURL = 'http://223.68.184.9:8084/DAQItem/services/CallUniversalService';
defSvc = 'CallUniversalServiceService';
defPrt = 'CallUniversalService';
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 CallUniversalService);
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(CallUniversalService), 'http://service.rong', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(CallUniversalService), '');
InvRegistry.RegisterInvokeOptions(TypeInfo(CallUniversalService), ioDocument);
end.
java 呼叫介面例子:
介面呼叫示例:
/**調介面測驗
* @param args
* @throws AxisFault
*/
public static void main(String[] args) throws AxisFault {
// TODO Auto-generated method stub
// 使用RPC方式呼叫WebService
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
// 指定呼叫WebService的URL (目前為測驗地址)
EndpointReference targetEPR = new EndpointReference("http://223.68.184.9:8084/DAQItem/services/CallUniversalService");
options.setTo(targetEPR);
// 指定要呼叫的計算機器中的方法及WSDL檔案的命名空間:
QName opAddEntry = new QName("http://service.rong","readStringXml");
// 引數
String xml = "呼叫介面需要傳輸的xml引數";
Object[] opAddEntryArgs = new Object[] {xml};
// 呼叫plus方法并輸出該方法的回傳值
Class[] classesa = new Class[] {String.class };
String rest=(String) serviceClient.invokeBlocking(opAddEntry,opAddEntryArgs, classesa)[0];
try {
System.out.println(URLDecoder.decode(rest.toString(), "utf-8"));
} catch (UnsupportedEncodingException e) {
// TODO 自動生成的 catch 塊
e.printStackTrace();
}
}
uj5u.com熱心網友回復:
已連接成功,下面還有更多問題麻煩大家。謝謝。uj5u.com熱心網友回復:
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/56618.html
標籤:網絡通信/分布式開發
下一篇:關于Delphi視頻聊天軟體
