Eoddata WSDL Java connection
•
Java
I don't know how to find out how to use eoddata Com start WSDL connection
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");
I got it
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 should I start the connection?
Solution
Using the following code for quick testing is useful to me
Using wsdl2java:
wsdl2java -autoNameResolution http://ws.eoddata.com/data.asmx?wsdl
Then make some changes using the code you provided:
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 answer is:
Invalid Username or Password
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码