EodData wsdl Java连接 [英] EodData wsdl java connection
本文介绍了EodData wsdl Java连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在努力弄清楚如何使用EodData.com启动WSDL连接
I am stuck trying to figure out how to initiate a WSDL connection with EodData.com
wsdl地址是
http://ws.eoddata.com/data.asmx?wsdl
我正在使用CXF创建客户端连接:
I am using CXF to create a client connection:
QName qname = new QName("http://ws.eoddata.com/Data", "Data");
Data data = new Data(new URL("http://ws.eoddata.com/data.asmx?wsdl"), qname);
DataHttpGet dataGet = data.getDataHttpGet();
dataGet.login("xxx", "ppp");
我得到
Caused by: org.apache.cxf.interceptor.Fault: Unmarshalling Error: unexpected element (uri:"http://schemas.xmlsoap.org/soap/envelope/", local:"Header"). Expected elements are <{http://ws.eoddata.com/Data}LoginResult>
不确定我应该如何发起连接?
Not sure how I should initiate the connection?
推荐答案
使用以下代码进行快速测试对我有用。
A quick test using the following code worked for me.
使用WSDL2Java:
Using WSDL2Java:
wsdl2java -autoNameResolution http://ws.eoddata.com/data.asmx?wsdl
然后使用您提供的代码进行一些更改:
Then using the code you provided with a few changes:
QName qname = new QName("http://ws.eoddata.com/Data", "Data");
Data data = new Data(new URL("http://ws.eoddata.com/data.asmx?wsdl"), qname);
DataSoap dataSoap = data.getDataSoap();
LOGINRESPONSE response = dataSoap.login("xxx", "ppp");
System.out.println(response.getMessage());
响应为:
Invalid Username or Password
这篇关于EodData wsdl Java连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文