java如何调用delphi编写的webservice接口

bxfyb 2007-08-31 03:37:09
<%@ page import="org.apache.axis.client.Call"%>
<%@ page import="org.apache.axis.client.Service"%>
<%@ page import="org.apache.axis.encoding.XMLType"%>
<%@ page import="javax.xml.rpc.*"%>

<%@ page import="javax.xml.rpc.ParameterMode"%>
<%@ page import="java.util.Vector"%>
<%@page import="java.net.URL"%>

<%
Service service = new Service();
Call call = (Call)service.createCall();
call.setTargetEndpointAddress( new URL("http://127.0.0.1/inter/RewiseInterFace.dll/wsdl/IReWiseInterFace") );
call.setOperationName(new javax.xml.namespace.QName("GetStation"));
// call.setUseSOAPAction(true);
//call.setSOAPActionURI("http://www.my.com/Rpc");
call.addParameter( "StationName", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN );
call.addParameter( "TimeString", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN );
call.addParameter( "ModeName", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN );
call.addParameter( "SendBuffer", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.INOUT );
call.addParameter( "Check", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.INOUT );

call.setReturnType( XMLType.XSD_STRING );

String Buffer = null;
String Ch = null;
String dd=(String)call.invoke(new Object[]{"宾县","2007082912","DMS_AVN",Buffer,Ch});

请高手帮助看看哪里出了问题?
wsdl等描述文件在下面跟贴里!
...全文
797 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
lanweiqiang 2008-11-13
  • 打赏
  • 举报
回复
楼主,我也碰到了你碰到的这个问题
请把你的解决办法发给我,OK?
lanweiqiang@sina.com
谢谢!
icelander 2007-10-10
  • 打赏
  • 举报
回复
call.setTargetEndpointAddress 中的地址应该为这个

http://127.0.0.0/inter/RewiseInterFace.dll/soap/IReWiseInterFace

胖胖牛1976 2007-09-25
  • 打赏
  • 举报
回复
同问
bxfyb 2007-08-31
  • 打赏
  • 举报
回复
在lomboz_eclipse中报错信息
org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.xinclude.XIncludeHandler.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.apache.jsp.testt_jsp._jspService(testt_jsp.java:76)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:328)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Unknown Source)
bxfyb 2007-08-31
  • 打赏
  • 举报
回复
这是WSDL描述
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://scmas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema" name="IReWiseInterFaceservice"
targetNamespace="http://tempri.org/" xmlns:tns="http://tempuri.org/"
xmlns:soap="http://scmas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://scmas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://scmas.xmlsoap.org/wsdl/mime/">
<message name="GetStation0Request">
<part name="StationName" type="xs:string"/>
<part name="TimeString" type="xs:string"/>
<part name="ModeName" type="xs:string"/>
<part name="SendBuffer" type="xs:string"/>
<part name="Check" type="xs:string"/>
</message>
<message name="GetStation0Response">
<part name="SendBuffer" type="xs:string"/>
<part name="Check" type="xs:string"/>
</message>
<message name="GetPictureBinary1Request">
<part name="DateTimeString" type="xs:string"/>
<part name="ModeName" type="xs:string"/>
<part name="LayerString" type="xs:string"/>
<part name="ElementString" type="xs:string"/>
<part name="TimeString" type="xs:string"/>
<part name="SendFile" type="xs:boolean"/>
<part name="FileName" type="xs:string"/>
<part name="Buffer" type="xs:base64Binary"/>
<part name="Check" type="xs:string"/>
</message>
<message name="GetPictureBinary1Response">
<part name="SendFile" type="xs:boolean"/>
<part name="FileName" type="xs:string"/>
<part name="Buffer" type="xs:base64Binary"/>
<part name="Check" type="xs:string"/>
</message>
<portType name="IReWiseInterFace">
<operation name="GetStation">
<input message="tns:GetStation0Request"/>
<output message="tns:GetStation0Response"/>
</operation>
<operation name="GetPictureBinary">
<input message="tns:GetPictureBinary1Request"/>
<output message="tns:GetPictureBinary1Response"/>
</operation>
</portType>
<binding name="IReWiseInterFacebinding" type="tns:IReWiseInterFace">
<soap:binding style="rpc" transport="http://scmas.xmlsoap.org/soap/http"/>
<operation name="GetStation">
<soap:operation soapAction="urn:ReWiseInterFaceIntf-IReWiseInterFace#GetStation" style="rpc"/>
<input message="tns:GetStation0Request">
<soap:body use="encoded" encodingStyle="http://scmas.xmlsoap.org/soap/encoding/" namespace="urn:ReWiseInterFaceIntf-IReWiseInterFace"/>
</input>
<output message="tns:GetStation0Response">
<soap:body use="encoded" encodingStyle="http://scmas.xmlsoap.org/soap/encoding/" namespace="urn:ReWiseInterFaceIntf-IReWiseInterFace"/>
</output>
</operation>
<operation name="GetPictureBinary">
<soap:operation soapAction="urn:ReWiseInterFaceIntf-IReWiseInterFace#GetPictureBinary" style="rpc"/>
<input message="tns:GetPictureBinary1Request">
<soap:body use="encoded" encodingStyle="http://scmas.xmlsoap.org/soap/encoding/" namespace="urn:ReWiseInterFaceIntf-IReWiseInterFace"/>
</input>
<output message="tns:GetPictureBinary1Response">
<soap:body use="encoded" encodingStyle="http://scmas.xmlsoap.org/soap/encoding/" namespace="urn:ReWiseInterFaceIntf-IReWiseInterFace"/>
</output>
</operation>
</binding>
<service name="IReWiseInterFaceservice">
<port name="IReWiseInterFacePort" binding="tns:IReWiseInterFacebinding">
<soap:address location="http://127.0.0.0/inter/RewiseInterFace.dll/soap/IReWiseInterFace"/>
</port>
</service>
</definitions>

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧