EodData wsdl java 连接

发布于 2024-09-10 11:31:32 字数 677 浏览 2 评论 0原文

我试图弄清楚如何启动与 EodData.com 的 WSDL 连接,

wsdl 地址是

http://ws.eoddata.com/data.asmx?wsdl

我正在使用 CXF 创建客户端连接:

 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> 

不确定应该如何启动连接?

I am stuck trying to figure out how to initiate a WSDL connection with EodData.com

the wsdl address is

http://ws.eoddata.com/data.asmx?wsdl

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");

and I got

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

神妖 2024-09-17 11:31:32

使用以下代码进行的快速测试对我有用。

使用 WSDL2Java:

wsdl2java -autoNameResolution http://ws.eoddata.com/data.asmx?wsdl

然后使用您提供的代码进行一些更改:

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

A quick test using the following code worked for me.

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());

The response was:

Invalid Username or Password
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文