Home > Back-end >  First contact with delph7 invokes the Java interfaces, XML format message, please expert guidance, i
First contact with delph7 invokes the Java interfaces, XML format message, please expert guidance, i

Time:09-20

Interface testing address
The test address: http://223.68.184.9:8084/DAQItem/services/CallUniversalService
Repair shop number: 32101594
Verify the user name: antj_01
Verify password: antj_01pass2016

CodePudding user response:

Delphi client to automatically generate the access code webserive
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//The types declared in this file were generated from The 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)
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

The 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 the or were referred
//to but never [!] Declared in the document. The types from the latter category
//typically map to a predefined/known XML or Borland types; Or, they could also
//indicate incorrect WSDL documents that failed to declare the or import a schema type.
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//! : string - "http://www.w3.org/2001/XMLSchema"



//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//Namespace: http://service.rong
//transport: http://schemas.xmlsoap.org/soap/http
//style: the document
//binding: CallUniversalServiceSoapBinding
//service: CallUniversalServiceService
//the port: CallUniversalService
//URL: http://223.68.184.9:8084/DAQItem/services/CallUniversalService
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
CallUniversalService=interface (IInvokable)
[' {2 d7faf1f - C142 - A89F - 21 c5 - D321BCA855EA} ']
The function readStringXml (const x: WideString) : WideString; Stdcall;
end;

The function GetCallUniversalService (UseWSDL: Boolean=System. False. Addr: string='; HTTPRIO: THTTPRIO=nil) : CallUniversalService;


Implementation

The 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;
The begin
Result:=nil;
If (Addr=' ') then
The begin
If UseWSDL then
Addr:=defWSDL
The else
Addr:=defURL;
end;
If HTTPRIO=nil then
RIO:=THTTPRIO. Create (nil)
The else
RIO:=HTTPRIO;
Try
Result:=(RIO as CallUniversalService);
If UseWSDL then
The begin
RIO. WSDLLocation:=Addr;
RIO. Service:=defSvc;
RIO. Port:=defPrt;
End the else
LTD URL:=Addr;
The 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 call interface example:

Interface to invoke the sample:

/* * callback interface test
* @ param args
* @ throws AxisFault
*/
Public static void main (String [] args) throws AxisFault {
//TODO Auto - generated method stub

//use RPC call WebService
RPCServiceClient serviceClient=new RPCServiceClient ();
The Options Options=serviceClient. GetOptions ();
//specified invoke the web service URL (for test currently address)
The EndpointReference targetEPR=new the EndpointReference (" http://223.68.184.9:8084/DAQItem/services/CallUniversalService ");
Options. SetTo (targetEPR);
//specified to invoke the calculate method of the machine and the WSDL file name space:
QName opAddEntry=new QName (" http://service.rong ", "readStringXml");
//parameter
Need to transport the XML String XML="call interface parameters".

Object [] opAddEntryArgs=new Object [] {} to XML.
//call plus method and the output of the method return value
Class classesa=new Class [] [] {String. Class};
String rest=(String) serviceClient. InvokeBlocking (opAddEntry opAddEntryArgs, classesa) [0].

Try {
System. The out. Println (URLDecoder. Decode (rest. The toString (), "utf-8"));
} the catch (UnsupportedEncodingException e) {
//TODO to automatically generate the catch block of
e.printStackTrace();
}
}

CodePudding user response:

Has the connection is successful, there are more problems bother you, thank you.

CodePudding user response:

null
  • Related