Home > Back-end >  Please analyze the WebService returns a value, but the return value is always the same problem
Please analyze the WebService returns a value, but the return value is always the same problem

Time:09-16

The questions of the last post
https://bbs.csdn.net/topics/392395664

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Hj8090:

Changed as you said, there is a return value, but no matter what send the string is the same ({" obj ":" 003 "})

But I use the test tool to send {" token ":" 14123 ss23sf3oodhgl38403 ", "msgType" : "10001", "msgBody" : {" manifestNo ":" 20180923004 ", "plateNumber" : "jin AB0322", "driverName" : "zhang mowgli", "driverIdentityCardNo" : "132305198907050043"}} return values for ({" obj ":" 004 "})

Test tool information is as follows:
<? The XML version="1.0" encoding="utf-8"?>





-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --


{" obj ":" 004 "} & lt;/return>
<:/ns2 processResponse>

CodePudding user response:

The client code

 procedure TForm1. Button3Click (Sender: TObject); 
Var
Tmp_p: process;
Tmp_r: Widestring;
The begin
//HTTPRIO1. HTTPWebNode. UseUTF8InHeader:=True;
Tmp_p:=process. Create;
//tmp_r:=processResponse. Create;
Tmp_p. Arg0:=WidestringToString (Memo1. Lines. The Text).
Tmp_r:=GetSolidWasteService (False, ' ', HTTPRIO1). The process (tmp_p);
//Memo2. Lines. Text:=tmp_r. Return;
Memo2. Lines. Text:=(tmp_r);
end;


Where there is a problem?

CodePudding user response:

Back then delphi2010 did the client, the return value is {" obj ":" 003 "}, doubt is caused, the client receives is null because the valid characters or invalid characters back {" obj ":" 003 "}, return code label format error,
Use testing tools to send effective string {" obj ":" 004 "},


 SolidWasteService unit, Delphi, 
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//The types declared in this file were generated from The data read from The
//WSDL File described below:
//WSDL: http://211.90.38.54:18282/WebService/SolidWasteService? WSDL
//& gt; Import: http://211.90.38.54:18282/WebService/SolidWasteService? WSDL=ISolidWasteService. WSDL
//& gt; Import: http://211.90.38.54:18282/WebService/SolidWasteService? WSDL=ISolidWasteService. Wsdl> 0
//Encoding: utf-8
//Version: 1.0
//(2018-06-11 20:09:19 - - $Rev: $25127)
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//

The unit SolidWasteService;

Interface

USES InvokeRegistry SOAPHTTPClient, Types, XSBuiltIns;

Const
IS_OPTN=$0001;
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 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 Embarcadero 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" (Gbl)



//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
//Namespace: http://api.weighbridge.internet.shencai.com/
//transport: http://schemas.xmlsoap.org/soap/http
//style: the document
//binding: SolidWasteServiceImplServiceSoapBinding
//service: SolidWasteServiceImplService
//the port: SolidWasteServiceImplPort
//URL: http://211.90.38.54:18282/WebService/SolidWasteService
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//
ISolidWasteService=interface (IInvokable)
[' {4 c6fb50e - 23 f9-5664-0 a8d - F79439A6E7E1} ']
The function process (const arg0: string) : string; Stdcall;
end;

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


Implementation
USES the SysUtils;

The function GetISolidWasteService (UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO) : ISolidWasteService;
Const
DefWSDL='http://211.90.38.54:18282/WebService/SolidWasteService? WSDL ';
DefURL='http://211.90.38.54:18282/WebService/SolidWasteService'.
DefSvc='SolidWasteServiceImplService';
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related