i'm trying create test client fro public webservice: http://www.webservicex.com/currencyconvertor.asmx?wsdl
used eclipse cxf 2.x auto-generate ws client. looks fine far, on execution following error. occures wehn call webservice method conversionrate
, auto-generated follows:
@webservice(targetnamespace = "http://www.webservicex.net/", name = "currencyconvertorsoap") @xmlseealso({objectfactory.class}) public interface currencyconvertorsoap { @webresult(name = "conversionrateresult", targetnamespace = "http://www.webservicex.net/") @requestwrapper(localname = "conversionrate", targetnamespace = "http://www.webservicex.net/", classname = "conversionrate") @webmethod(operationname = "conversionrate", action = "http://www.webservicex.net/conversionrate") @responsewrapper(localname = "conversionrateresponse", targetnamespace = "http://www.webservicex.net/", classname = "conversionrateresponse") public double conversionrate( @webparam(name = "fromcurrency", targetnamespace = "http://www.webservicex.net/") currency fromcurrency, @webparam(name = "tocurrency", targetnamespace = "http://www.webservicex.net/") currency tocurrency ); }
how can find out error comes from? might wrong here?
error:
warnung: interceptor {http://www.webservicex.net/}currencyconvertor#{http://www.webservicex.net/}conversionrate has thrown exception, unwinding org.apache.cxf.interceptor.fault: unmarshalling error: unerwartetes element (uri:"http://www.webservicex.net/", lokal:"conversionrateresult"). erwartete elemente sind <{}conversionrateresult> @ org.apache.cxf.jaxb.jaxbencoderdecoder.unmarshall(jaxbencoderdecoder.java:808) @ org.apache.cxf.jaxb.jaxbencoderdecoder.unmarshall(jaxbencoderdecoder.java:629) @ org.apache.cxf.jaxb.io.datareaderimpl.read(datareaderimpl.java:157) @ org.apache.cxf.interceptor.docliteralininterceptor.handlemessage(docliteralininterceptor.java:103) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:271) @ org.apache.cxf.endpoint.clientimpl.onmessage(clientimpl.java:800) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.handleresponseinternal(httpconduit.java:1592) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.handleresponse(httpconduit.java:1490) @ org.apache.cxf.transport.http.httpconduit$wrappedoutputstream.close(httpconduit.java:1309) @ org.apache.cxf.transport.abstractconduit.close(abstractconduit.java:56) @ org.apache.cxf.transport.http.httpconduit.close(httpconduit.java:622) @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderinterceptor.java:62) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:271) @ org.apache.cxf.endpoint.clientimpl.doinvoke(clientimpl.java:530) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:463) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:366) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:319) @ org.apache.cxf.frontend.clientproxy.invokesync(clientproxy.java:96) @ org.apache.cxf.jaxws.jaxwsclientproxy.invoke(jaxwsclientproxy.java:133) @ $proxy35.conversionrate(unknown source) @ currencyconvertorsoap_currencyconvertorsoap_client.main(currencyconvertorsoap_currencyconvertorsoap_client.java:50)
the solution not delete auto-generated package-info.java
. in general, when creating normal java projects, artifact can removed savely. in case of webservices contains mandatory definitions.
Comments
Post a Comment