用java开发好了接口,我如何向接口上提交信息(100)

Z

zqqxh

Unregistered / Unconfirmed
GUEST, unregistred user!
先声名:这是我第一个关于JAVA的问题,我对JAVA一点也不懂,请热心的朋友帮帮忙。接口是别人用JAVA开发的,我只负责向接口提交数据,但如何提交我不会,如果能找到通过DELPHI向上面转数据的方法最好了。接口地址如下:http://127.0.0.1/transitPoint/ourservices/TransitPointService?wsdl在浏览器上显示如下的信息:<?xml version="1.0" encolding="UTF-8"?>-<wsdl:definitions targeNamespace="myservice"xmlns:tns="myservice"xmlns:wsdlsoap="http://xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"xmlns:xsd="http://www.w3.xmlns:soapenc11="http://schemas.xmssoap.org/soap/encoding/"xmlns:soapenc12="http://xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"xmlns:wsdl="http://schem-<wsdl:types>-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"attributeFormDefault="qutargetNamespace="myservice">以上这一串东西是什么意思,我一点也看不懂!
 
B

bsense

Unregistered / Unconfirmed
GUEST, unregistred user!
这个是xml soap 服务的规格 浏览器必须装 xml 支持
 
Y

youthon

Unregistered / Unconfirmed
GUEST, unregistred user!
这不就是webservice吗?通过webservice调用通过new->webservice中的wsdl导入功能导入,修改生成的单元中的参数,然后调用就可以了
 
Z

zqqxh

Unregistered / Unconfirmed
GUEST, unregistred user!
谢谢前面两位大哥,我如何做?JAVA我一点不懂,DELPHI能做到吗?或者干脆给我写一段,我急着要,谢谢了。
 
Z

zqqxh

Unregistered / Unconfirmed
GUEST, unregistred user!
按照youthon所说的做了,里面的参数不会改,也不会调用。特别是里面有个"ArrayOfString"不知道如何向它传递数据,总说类型不对。有会用的请指教。。。。。
 

火焰领主打伞

Unregistered / Unconfirmed
GUEST, unregistred user!
通过new->webservice中的wsdl导入功能导入,看生成的接口文件。接口文件里面有函数,自己选择调用。具体细节出现的问题具体分析,呵呵,谁也不知道下一个错误是什么。
 
Z

zqqxh

Unregistered / Unconfirmed
GUEST, unregistred user!
从webservice中的wsdl生成的接口文件中,有如下的定义:type ArrayOfString = array of WideString;
{ "myservice" } ArrayOfDouble = array ofdo
uble;
{ "myservice" } ArrayOfInt = array of Integer;
{ "myservice" } TransitPointServicePortType = interface(IInvokable) ['{C582D218-381B-2DBB-ECED-F63DC6A6AE1A}'] function uploadHosDetailsData(const in0: ArrayOfString;
const in1: ArrayOfString;
const in2: ArrayOfString;
const in3: ArrayOfString;
const in4: ArrayOfString;
const in5: ArrayOfString;
const in6: ArrayOfDouble;
const in7: ArrayOfDouble;
const in8: ArrayOfDouble;
const in9: ArrayOfInt;
const in10: ArrayOfString): WideString;
stdcall;
function patientRegistration(const in0: ArrayOfString;
const in1: ArrayOfString): WideString;
stdcall;
function dischargeInformation(const in0: ArrayOfString;
const in1: ArrayOfDouble): WideString;
stdcall;
end;
 
Z

zqqxh

Unregistered / Unconfirmed
GUEST, unregistred user!
调用单元如下:procedure TForm1.Button1Click(Sender: TObject);varqin0:ArrayOfString;qin1:ArrayOfString;
begin
qin0[0]:='测试人';qin0[1]:='442801198906051912';qin1[0]:='13233111';qin1[1]:='2211';qin1[2]:='测试人原因';qin1[3]:='2009-01-01';qin1[4]:='单位科室';qin1[5]:='1';Memo1.Text:=TransitPointService.GetTransitPointServicePortType.patientRegistration(qin0,qin1);
end;
可编译通过,但执行时出错!
 
Z

zqqxh

Unregistered / Unconfirmed
GUEST, unregistred user!
有明白的,请指教,我这样调用有没有问题?
 
Z

zqqxh

Unregistered / Unconfirmed
GUEST, unregistred user!
终于自己解决了,原来ArrayOfString在使用前需要定义长度,加入如下这两行就OK了!SetLength(qin0,2);SetLength(qin1,6);
特别多谢youthon和火焰领主打伞,给我指了条明路.结贴了
 
顶部