Delphi 调用Web Service 出错 ( 积分: 100 )

  • 主题发起人 主题发起人 yangjungis
  • 开始时间 开始时间
Y

yangjungis

Unregistered / Unconfirmed
GUEST, unregistred user!
我用JAVA开发的WEB SERVICE,在JAVA中测试成功
使用DELPHI调用,出现以下错误信息:
JAXRPCTIE01: 处理请求时捕捉到异常: 意外的元素名称: expected=String_1,actual={urn:Res2BssWS/types}String_1
WSDL文件如下:
<?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?><definitions xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
xmlns:tns=&quot;urn:Res2BssWS/wsdl&quot;
xmlns:ns2=&quot;urn:Res2BssWS/types&quot;
xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
name=&quot;Res2BssWS&quot;
targetNamespace=&quot;urn:Res2BssWS/wsdl&quot;>
<types>
<schema xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:tns=&quot;urn:Res2BssWS/types&quot;
xmlns:soap11-enc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
targetNamespace=&quot;urn:Res2BssWS/types&quot;>
<complexType name=&quot;queryLogicNum&quot;>
<sequence>
<element name=&quot;String_1&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;queryLogicNumResponse&quot;>
<sequence>
<element name=&quot;result&quot;
type=&quot;tns:EplNumVO&quot;
nillable=&quot;true&quot;
minOccurs=&quot;0&quot;
maxOccurs=&quot;unbounded&quot;/></sequence></complexType>
<complexType name=&quot;EplNumVO&quot;>
<sequence>
<element name=&quot;LNum&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/>
<element name=&quot;PNum&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/>
<element name=&quot;id&quot;
type=&quot;decimal&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;QueryNumberException&quot;>
<sequence>
<element name=&quot;message&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;queryPhysicNum&quot;>
<sequence>
<element name=&quot;String_1&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;queryPhysicNumResponse&quot;>
<sequence>
<element name=&quot;result&quot;
type=&quot;tns:EplNumVO&quot;
nillable=&quot;true&quot;
minOccurs=&quot;0&quot;
maxOccurs=&quot;unbounded&quot;/></sequence></complexType>
<element name=&quot;queryLogicNum&quot;
type=&quot;tns:queryLogicNum&quot;/>
<element name=&quot;queryLogicNumResponse&quot;
type=&quot;tns:queryLogicNumResponse&quot;/>
<element name=&quot;QueryNumberException&quot;
type=&quot;tns:QueryNumberException&quot;/>
<element name=&quot;queryPhysicNum&quot;
type=&quot;tns:queryPhysicNum&quot;/>
<element name=&quot;queryPhysicNumResponse&quot;
type=&quot;tns:queryPhysicNumResponse&quot;/></schema></types>
<message name=&quot;Res2BssWSSEI_queryLogicNum&quot;>
<part name=&quot;parameters&quot;
element=&quot;ns2:queryLogicNum&quot;/></message>
<message name=&quot;Res2BssWSSEI_queryLogicNumResponse&quot;>
<part name=&quot;result&quot;
element=&quot;ns2:queryLogicNumResponse&quot;/></message>
<message name=&quot;QueryNumberException&quot;>
<part name=&quot;QueryNumberException&quot;
element=&quot;ns2:QueryNumberException&quot;/></message>
<message name=&quot;Res2BssWSSEI_queryPhysicNum&quot;>
<part name=&quot;parameters&quot;
element=&quot;ns2:queryPhysicNum&quot;/></message>
<message name=&quot;Res2BssWSSEI_queryPhysicNumResponse&quot;>
<part name=&quot;result&quot;
element=&quot;ns2:queryPhysicNumResponse&quot;/></message>
<portType name=&quot;Res2BssWSSEI&quot;>
<operation name=&quot;queryLogicNum&quot;>
<input message=&quot;tns:Res2BssWSSEI_queryLogicNum&quot;/>
<output message=&quot;tns:Res2BssWSSEI_queryLogicNumResponse&quot;/>
<fault name=&quot;QueryNumberException&quot;
message=&quot;tns:QueryNumberException&quot;/></operation>
<operation name=&quot;queryPhysicNum&quot;>
<input message=&quot;tns:Res2BssWSSEI_queryPhysicNum&quot;/>
<output message=&quot;tns:Res2BssWSSEI_queryPhysicNumResponse&quot;/>
<fault name=&quot;QueryNumberException&quot;
message=&quot;tns:QueryNumberException&quot;/></operation></portType>
<binding name=&quot;Res2BssWSSEIBinding&quot;
type=&quot;tns:Res2BssWSSEI&quot;>
<soap:binding transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;
style=&quot;document&quot;/>
<operation name=&quot;queryLogicNum&quot;>
<soap:operation soapAction=&quot;&quot;/>
<input>
<soap:body use=&quot;literal&quot;/></input>
<output>
<soap:body use=&quot;literal&quot;/></output>
<fault name=&quot;QueryNumberException&quot;>
<soap:fault name=&quot;QueryNumberException&quot;
use=&quot;literal&quot;/></fault></operation>
<operation name=&quot;queryPhysicNum&quot;>
<soap:operation soapAction=&quot;&quot;/>
<input>
<soap:body use=&quot;literal&quot;/></input>
<output>
<soap:body use=&quot;literal&quot;/></output>
<fault name=&quot;QueryNumberException&quot;>
<soap:fault name=&quot;QueryNumberException&quot;
use=&quot;literal&quot;/></fault></operation></binding>
<service name=&quot;Res2BssWS&quot;>
<port name=&quot;Res2BssWSSEIPort&quot;
binding=&quot;tns:Res2BssWSSEIBinding&quot;>
<soap:address location=&quot;http://yangjun:8080/webservice/Res2BssWS&quot;
xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;/></port></service></definitions>
 
我用JAVA开发的WEB SERVICE,在JAVA中测试成功
使用DELPHI调用,出现以下错误信息:
JAXRPCTIE01: 处理请求时捕捉到异常: 意外的元素名称: expected=String_1,actual={urn:Res2BssWS/types}String_1
WSDL文件如下:
<?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?><definitions xmlns=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
xmlns:tns=&quot;urn:Res2BssWS/wsdl&quot;
xmlns:ns2=&quot;urn:Res2BssWS/types&quot;
xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;
name=&quot;Res2BssWS&quot;
targetNamespace=&quot;urn:Res2BssWS/wsdl&quot;>
<types>
<schema xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:tns=&quot;urn:Res2BssWS/types&quot;
xmlns:soap11-enc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;
targetNamespace=&quot;urn:Res2BssWS/types&quot;>
<complexType name=&quot;queryLogicNum&quot;>
<sequence>
<element name=&quot;String_1&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;queryLogicNumResponse&quot;>
<sequence>
<element name=&quot;result&quot;
type=&quot;tns:EplNumVO&quot;
nillable=&quot;true&quot;
minOccurs=&quot;0&quot;
maxOccurs=&quot;unbounded&quot;/></sequence></complexType>
<complexType name=&quot;EplNumVO&quot;>
<sequence>
<element name=&quot;LNum&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/>
<element name=&quot;PNum&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/>
<element name=&quot;id&quot;
type=&quot;decimal&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;QueryNumberException&quot;>
<sequence>
<element name=&quot;message&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;queryPhysicNum&quot;>
<sequence>
<element name=&quot;String_1&quot;
type=&quot;string&quot;
nillable=&quot;true&quot;/></sequence></complexType>
<complexType name=&quot;queryPhysicNumResponse&quot;>
<sequence>
<element name=&quot;result&quot;
type=&quot;tns:EplNumVO&quot;
nillable=&quot;true&quot;
minOccurs=&quot;0&quot;
maxOccurs=&quot;unbounded&quot;/></sequence></complexType>
<element name=&quot;queryLogicNum&quot;
type=&quot;tns:queryLogicNum&quot;/>
<element name=&quot;queryLogicNumResponse&quot;
type=&quot;tns:queryLogicNumResponse&quot;/>
<element name=&quot;QueryNumberException&quot;
type=&quot;tns:QueryNumberException&quot;/>
<element name=&quot;queryPhysicNum&quot;
type=&quot;tns:queryPhysicNum&quot;/>
<element name=&quot;queryPhysicNumResponse&quot;
type=&quot;tns:queryPhysicNumResponse&quot;/></schema></types>
<message name=&quot;Res2BssWSSEI_queryLogicNum&quot;>
<part name=&quot;parameters&quot;
element=&quot;ns2:queryLogicNum&quot;/></message>
<message name=&quot;Res2BssWSSEI_queryLogicNumResponse&quot;>
<part name=&quot;result&quot;
element=&quot;ns2:queryLogicNumResponse&quot;/></message>
<message name=&quot;QueryNumberException&quot;>
<part name=&quot;QueryNumberException&quot;
element=&quot;ns2:QueryNumberException&quot;/></message>
<message name=&quot;Res2BssWSSEI_queryPhysicNum&quot;>
<part name=&quot;parameters&quot;
element=&quot;ns2:queryPhysicNum&quot;/></message>
<message name=&quot;Res2BssWSSEI_queryPhysicNumResponse&quot;>
<part name=&quot;result&quot;
element=&quot;ns2:queryPhysicNumResponse&quot;/></message>
<portType name=&quot;Res2BssWSSEI&quot;>
<operation name=&quot;queryLogicNum&quot;>
<input message=&quot;tns:Res2BssWSSEI_queryLogicNum&quot;/>
<output message=&quot;tns:Res2BssWSSEI_queryLogicNumResponse&quot;/>
<fault name=&quot;QueryNumberException&quot;
message=&quot;tns:QueryNumberException&quot;/></operation>
<operation name=&quot;queryPhysicNum&quot;>
<input message=&quot;tns:Res2BssWSSEI_queryPhysicNum&quot;/>
<output message=&quot;tns:Res2BssWSSEI_queryPhysicNumResponse&quot;/>
<fault name=&quot;QueryNumberException&quot;
message=&quot;tns:QueryNumberException&quot;/></operation></portType>
<binding name=&quot;Res2BssWSSEIBinding&quot;
type=&quot;tns:Res2BssWSSEI&quot;>
<soap:binding transport=&quot;http://schemas.xmlsoap.org/soap/http&quot;
style=&quot;document&quot;/>
<operation name=&quot;queryLogicNum&quot;>
<soap:operation soapAction=&quot;&quot;/>
<input>
<soap:body use=&quot;literal&quot;/></input>
<output>
<soap:body use=&quot;literal&quot;/></output>
<fault name=&quot;QueryNumberException&quot;>
<soap:fault name=&quot;QueryNumberException&quot;
use=&quot;literal&quot;/></fault></operation>
<operation name=&quot;queryPhysicNum&quot;>
<soap:operation soapAction=&quot;&quot;/>
<input>
<soap:body use=&quot;literal&quot;/></input>
<output>
<soap:body use=&quot;literal&quot;/></output>
<fault name=&quot;QueryNumberException&quot;>
<soap:fault name=&quot;QueryNumberException&quot;
use=&quot;literal&quot;/></fault></operation></binding>
<service name=&quot;Res2BssWS&quot;>
<port name=&quot;Res2BssWSSEIPort&quot;
binding=&quot;tns:Res2BssWSSEIBinding&quot;>
<soap:address location=&quot;http://yangjun:8080/webservice/Res2BssWS&quot;
xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;/></port></service></definitions>
 
怎么没人回答我的问题?
 
还没人回答我的问题,在线等待?
 
[:(][:(][:(][:(][:(][:(][:(][:(][:(][:(][:(][:(][:(][:(]
 
你用浏览器看看你的接口能不能打开呀
 
http://www.delphibbs.com/keylife/iblog_show.asp?xid=11130
你可以作参考
 
to wanghaiou:
能打开
to 鳄鱼先生:
按照文档,一样的结果呀?
 
以前和Java 的WebService 接口的时候碰到类似的问题
最后,稍微改了一下Delphi生成的接口单元
改动的地方为:
2.接口的执行选项默认为 ioDocument,生成的格式和Java不兼容
修改方法: 将执行选项改为 ioLiteral, 便于和其它开发工具进行接口
修改后的代码如下:
InvRegistry.RegisterInvokeOptions(TypeInfo(XcdsExPortType), ioLiteral);
 
to lich:
修改后还是不行呀,提示错误如下:
JAXRPCTIE01: 处理请求时捕捉到异常: 无法识别的操作: String_1
我把生成的代码给你:
// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://localhost:8080/webservice/Res2BssWS?WSDL
// Encoding : UTF-8
// Codegen : [wfDebug,wfAmbiguousComplexTypesAsArray,wfUnwindLiteralParameters,wfOutputLiteralTypes,wfUseSerializerClassForAttrs]
// Version : 1.0
// (2005-6-30 10:06:23 - 1.33.2.5)
// ************************************************************************ //
unit Res2BssWS;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
type
// ************************************************************************ //
// The following types, referred to in the WSDLdo
cument are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in thedo
cument. The types from the latter category
// typically map to predefined/known XML or Borland types;
however, they could also
// indicate incorrect WSDLdo
cuments that failed to declare or import a schema type.
// ************************************************************************ //
// !:string - &quot;urn:Res2BssWS/types&quot;
// !:decimal - &quot;urn:Res2BssWS/types&quot;
queryPhysicNum = class;
{ &quot;urn:Res2BssWS/types&quot;
}
QueryNumberException = class;
{ &quot;urn:Res2BssWS/types&quot;[F] }
queryLogicNum = class;
{ &quot;urn:Res2BssWS/types&quot;
}
EplNumVO = class;
{ &quot;urn:Res2BssWS/types&quot;
}
queryLogicNumResponse = class;
{ &quot;urn:Res2BssWS/types&quot;[A] }
queryPhysicNumResponse = class;
{ &quot;urn:Res2BssWS/types&quot;[A] }

// ************************************************************************ //
// Namespace : urn:Res2BssWS/types
// Serializtn: [xoHolderClass,xoLiteralParam]
// ************************************************************************ //
queryPhysicNum = class(TRemotable)
private
FString_1: WideString;
public
constructor Create;
override;
published
property String_1: WideString read FString_1 write FString_1;
end;


// ************************************************************************ //
// Namespace : urn:Res2BssWS/types
// ************************************************************************ //
QueryNumberException = class(ERemotableException)
private
Fmessage: WideString;
published
property message: WideString read Fmessage write Fmessage;
end;


// ************************************************************************ //
// Namespace : urn:Res2BssWS/types
// Serializtn: [xoHolderClass,xoLiteralParam]
// ************************************************************************ //
queryLogicNum = class(TRemotable)
private
FString_1: WideString;
public
constructor Create;
override;
published
property String_1: WideString read FString_1 write FString_1;
end;


// ************************************************************************ //
// Namespace : urn:Res2BssWS/types
// ************************************************************************ //
EplNumVO = class(TRemotable)
private
FLNum: WideString;
FPNum: WideString;
Fid: TXSDecimal;
public
destructor Destroy;
override;
published
property LNum: WideString read FLNum write FLNum;
property PNum: WideString read FPNum write FPNum;
property id: TXSDecimal read Fid write Fid;
end;

result = array of EplNumVO;
{ &quot;urn:Res2BssWS/types&quot;
}

// ************************************************************************ //
// Namespace : urn:Res2BssWS/types
// Serializtn: [xoHolderClass,xoInlineArrays,xoLiteralParam]
// ************************************************************************ //
queryLogicNumResponse = class(TRemotable)
private
Fresult: result;
public
constructor Create;
override;
destructor Destroy;
override;
function GetEplNumVOArray(Index: Integer): EplNumVO;
function GetEplNumVOArrayLength: Integer;
property EplNumVOArray[Index: Integer]: EplNumVO read GetEplNumVOArray;
default;
property Len: Integer read GetEplNumVOArrayLength;
published
property result: result read Fresult write Fresult;
end;


// ************************************************************************ //
// Namespace : urn:Res2BssWS/types
// Serializtn: [xoHolderClass,xoInlineArrays,xoLiteralParam]
// ************************************************************************ //
queryPhysicNumResponse = class(TRemotable)
private
Fresult: result;
public
constructor Create;
override;
destructor Destroy;
override;
function GetEplNumVOArray(Index: Integer): EplNumVO;
function GetEplNumVOArrayLength: Integer;
property EplNumVOArray[Index: Integer]: EplNumVO read GetEplNumVOArray;
default;
property Len: Integer read GetEplNumVOArrayLength;
published
property result: result read Fresult write Fresult;
end;

// ************************************************************************ //
// Namespace : urn:Res2BssWS/wsdl
// transport : http://schemas.xmlsoap.org/soap/http
// style :do
cument
// binding : Res2BssWSSEIBinding
// service : Res2BssWS
// port : Res2BssWSSEIPort
// URL : http://yangjun:8080/webservice/Res2BssWS
// ************************************************************************ //
Res2BssWSSEI = interface(IInvokable)
['{AFEA5C31-C2A8-E480-7195-73DD7135AE6E}']
function queryLogicNum(const parameters: queryLogicNum): queryLogicNumResponse;
stdcall;
function queryPhysicNum(const parameters: queryPhysicNum): queryPhysicNumResponse;
stdcall;
end;

function GetRes2BssWSSEI(UseWSDL: Boolean=System.False;
Addr: string='';
HTTPRIO: THTTPRIO = nil): Res2BssWSSEI;

implementation
function GetRes2BssWSSEI(UseWSDL: Boolean;
Addr: string;
HTTPRIO: THTTPRIO): Res2BssWSSEI;
const
defWSDL = 'http://localhost:8080/webservice/Res2BssWS?WSDL';
defURL = 'http://yangjun:8080/webservice/Res2BssWS';
defSvc = 'Res2BssWS';
defPrt = 'Res2BssWSSEIPort';
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 Res2BssWSSEI);
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;

constructor queryPhysicNum.Create;
begin
inherited Create;
FSerializationOptions := [xoHolderClass,xoLiteralParam];
end;

constructor queryLogicNum.Create;
begin
inherited Create;
FSerializationOptions := [xoHolderClass,xoLiteralParam];
end;

destructor EplNumVO.Destroy;
begin
if Assigned(Fid) then
Fid.Free;
inherited Destroy;
end;

constructor queryLogicNumResponse.Create;
begin
inherited Create;
FSerializationOptions := [xoHolderClass,xoInlineArrays,xoLiteralParam];
end;

destructor queryLogicNumResponse.Destroy;
var
I: Integer;
begin
for I := 0 to Length(Fresult)-1do
if Assigned(Fresult) then
Fresult.Free;
SetLength(Fresult, 0);
inherited Destroy;
end;

function queryLogicNumResponse.GetEplNumVOArray(Index: Integer): EplNumVO;
begin
Result := Fresult[Index];
end;

function queryLogicNumResponse.GetEplNumVOArrayLength: Integer;
begin
if Assigned(Fresult) then
Result := Length(Fresult)
else
Result := 0;
end;

constructor queryPhysicNumResponse.Create;
begin
inherited Create;
FSerializationOptions := [xoHolderClass,xoInlineArrays,xoLiteralParam];
end;

destructor queryPhysicNumResponse.Destroy;
var
I: Integer;
begin
for I := 0 to Length(Fresult)-1do
if Assigned(Fresult) then
Fresult.Free;
SetLength(Fresult, 0);
inherited Destroy;
end;

function queryPhysicNumResponse.GetEplNumVOArray(Index: Integer): EplNumVO;
begin
Result := Fresult[Index];
end;

function queryPhysicNumResponse.GetEplNumVOArrayLength: Integer;
begin
if Assigned(Fresult) then
Result := Length(Fresult)
else
Result := 0;
end;

initialization
InvRegistry.RegisterInterface(TypeInfo(Res2BssWSSEI), 'urn:Res2BssWS/wsdl', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(Res2BssWSSEI), '');
// 这儿是我修改的,原来是
// InvRegistry.RegisterInvokeOptions(TypeInfo(Res2BssWSSEI), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(Res2BssWSSEI), ioLiteral);
RemClassRegistry.RegisterXSClass(queryPhysicNum, 'urn:Res2BssWS/types', 'queryPhysicNum');
RemClassRegistry.RegisterSerializeOptions(queryPhysicNum, [xoHolderClass,xoLiteralParam]);
RemClassRegistry.RegisterXSClass(QueryNumberException, 'urn:Res2BssWS/types', 'QueryNumberException');
RemClassRegistry.RegisterXSClass(queryLogicNum, 'urn:Res2BssWS/types', 'queryLogicNum');
RemClassRegistry.RegisterSerializeOptions(queryLogicNum, [xoHolderClass,xoLiteralParam]);
RemClassRegistry.RegisterXSClass(EplNumVO, 'urn:Res2BssWS/types', 'EplNumVO');
RemClassRegistry.RegisterXSInfo(TypeInfo(result), 'urn:Res2BssWS/types', 'result');
RemClassRegistry.RegisterXSClass(queryLogicNumResponse, 'urn:Res2BssWS/types', 'queryLogicNumResponse');
RemClassRegistry.RegisterSerializeOptions(queryLogicNumResponse, [xoHolderClass,xoInlineArrays,xoLiteralParam]);
RemClassRegistry.RegisterXSClass(queryPhysicNumResponse, 'urn:Res2BssWS/types', 'queryPhysicNumResponse');
RemClassRegistry.RegisterSerializeOptions(queryPhysicNumResponse, [xoHolderClass,xoInlineArrays,xoLiteralParam]);
end.
 
请先用 java 实现调用,
然后拦截 发送的 http 报文,
对比其不同
 
delphi调用:
<SOAP-ENV:Envelope xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;>
<SOAP-ENV:Body>
<queryLogicNum xmlns=&quot;urn:Res2BssWS/wsdl&quot;>
<String_1>12345</String_1>
</queryLogicNum>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

JAVA调用:
<env:Envelope xmlns:env=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
xmlns:enc=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;
xmlns:ns0=&quot;urn:Res2BssWS/types&quot;
xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;>
<env:Body>
<ns0:queryLogicNum>
<String_1>12345</String_1>
</ns0:queryLogicNum>
</env:Body>
</env:Envelope>
如何修改DELPHI调用报文与JAVA一致
 
我上一次是逐步跟踪SOAP 的源程序才让他们发送的报文一致的
最后,发现只用修改那个地方就可以了,也是和Java 对接的
两者的主要区别就是,Java的字段名前面带有一个前缀,
你试者改变SOAP 组件的一些属性,还有自动生成的文件中的一些模式
然后再拦截跟踪一下,
我相信Delphi应该是能够支持这种报文格式的,
上次我还以为Delphi 无法调用Java 的SOAP ,
只是需要配置和修改一下就可以了
 
后退
顶部