最近做一个项目,需要调用某个webservice接口以前做这个调用的时候都没出现过这样的问题
对方公司提供了一个公网的WSDL测试地址,如下:
http://220.168.17.11:8080/sjpt-sjptEJB/DrugInterfacesImpl?wsdl我是用D7的WSDL IMPORT直接导入的 里面有个testclient方法,调用的时候传入一个 testclient类,包含两个值 一个clientId,一个centerNo
无论我怎么传值,结果都是报的centerno不能为空..以前配到过.net开发的webservice传值进去为空的情况,加入一行
InvRegistry.RegisterInvokeOptions(TypeInfo(DrugInterfacesRemote), ioDocument);
就可以了,但是这次直接IMPORT后,就有这一行的.
哪位大侠能帮我看看?入参不对是抛出异常的procedure TForm1.btnTestClick(Sender: TObject);
var
  WebService : DrugInterfacesRemote;
  CClient : testClient;
  CClientResponse : testClientResponse;
begin
  WebService := GetDrugInterfacesRemote(true,'http://220.168.17.11:8080/sjpt-sjptEJB/DrugInterfacesImpl?wsdl',nil);
  CClient := testClient.Create;
  CClient.clientId := 13550;
  CNo := 'L03202';
  CClient.centerNo := CNo;
  try
    CClientResponse := WebService.testClient(CClient);
  except
    on E: Exception do
    begin
      ShowMessage( '出错' + E.Message);
      Exit;
    end;
  end; 
end;