What framework are you using for your SOAP client? Do you know the
version of CXF used for the web service provider?
From here:
Unmarshalling Error: unexpected element
(uri:"http://soaphttp.rd.nsrr.swim.faa.gov/", local:"zip"). Expected
elements are<{}zip>
The WSDL from which you generated your SOAP client is expecting a "zip"
element with no namespace but is getting a zip element with the
namespace listed
above. It might be good to confirm that with Wireshark[1].
My guess, if not a library/JAR problem, is that something is wrong with
the WSDL.
You can check this by modifying the local copy of your WSDL to have it
not send
the namespace as requested, and generate your client[2] from that WSDL, and
see what happens.
HTH,
Glen
[1] http://www.jroller.com/gmazza/entry/soap_calls_over_wireshark
[2] http://www.jroller.com/gmazza/entry/soap_client_tutorial
On 10/22/2011 07:24 AM, Michael wrote:
I am getting an unmarshalling error when my client attempts to call a CXF
web service operation. I will provide below both the error received on the
client side and the error and a portion of the stack trace from the server
side.
Client Side Error
Oct 22, 2011 6:46:47 AM com.sun.xml.internal.ws.model.RuntimeModeler
getRequestWrapperClass
INFO: Dynamically creating request wrapper Class
gov.faa.swim.nsrr.rd.soaphttp.GetTemperature
Oct 22, 2011 6:46:47 AM com.sun.xml.internal.ws.model.RuntimeModeler
getResponseWrapperClass
INFO: Dynamically creating response wrapper bean Class
gov.faa.swim.nsrr.rd.soaphttp.GetTemperatureResponse
Oct 22, 2011 6:46:47 AM com.sun.xml.internal.ws.model.RuntimeModeler
getRequestWrapperClass
INFO: Dynamically creating request wrapper Class
gov.faa.swim.nsrr.rd.soaphttp.SetTemperature
Oct 22, 2011 6:46:47 AM com.sun.xml.internal.ws.model.RuntimeModeler
getResponseWrapperClass
INFO: Dynamically creating response wrapper bean Class
gov.faa.swim.nsrr.rd.soaphttp.SetTemperatureResponse
Oct 22, 2011 6:46:47 AM com.sun.xml.internal.ws.model.RuntimeModeler
getRequestWrapperClass
INFO: Dynamically creating request wrapper Class
gov.faa.swim.nsrr.rd.soaphttp.GetForecast
Oct 22, 2011 6:46:47 AM com.sun.xml.internal.ws.model.RuntimeModeler
getResponseWrapperClass
INFO: Dynamically creating response wrapper bean Class
gov.faa.swim.nsrr.rd.soaphttp.GetForecastResponse
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
Unmarshalling Error: unexpected element
(uri:"http://soaphttp.rd.nsrr.swim.faa.gov/", local:"zip"). Expected
elements are<{}zip>
at
com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(Unknown
Source)
at
com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(Unknown
Source)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at
com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at $Proxy23.getTemperature(Unknown Source)
at
gov.faa.swim.nsrr.rd.soaphttp.SoapHttpWeatherCanonicalClientApp.main(SoapHtt
pWeatherCanonicalClientApp.java:13)
Server Side Error (and partial stack trace)
06:46:47,495 INFO [STDOUT] DefaultValidationEventHandler: [ERROR]:
unexpected element (uri:"http://soaphttp.rd.nsrr.swim.faa.gov/",
local:"zip"). Expected elements are<{}zip>
06:46:47,495 INFO [STDOUT] Location: line 1
06:46:47,511 WARN [org.apache.cxf.phase.PhaseInterceptorChain]
Interceptor
for{http://soaphttp.rd.nsrr.swim.faa.gov/}SoapHttpWeatherImpl#{http://soapht
tp.rd.nsrr.swim.faa.gov/}GetTemperature has thrown exception,
unwinding now:
org.apache.cxf.interceptor.Fault:
Unmarshalling Error: unexpected element
(uri:"http://soaphttp.rd.nsrr.swim.faa.gov/", local:"zip").
Expected elements are<{}zip>
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:78
7) [:2.3.1]
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:62
8) [:2.3.1]
at
org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:133) [:2.3.1]
at
org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralI
nInterceptor.java:109) [:2.3.1]
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain
.java:255) [:2.3.1]
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationOb
server.java:113) [:2.3.1]
at
org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestinatio
n.java:97) [:2.3.1]
at
org.apache.cxf.transport.servlet.ServletController.invokeDestination(Servlet
Controller.java:461) [:2.3.1]
at
org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.jav
a:172) [:3.4.1.GA]
at
org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerI
mpl.java:57) [:3.4.1.GA]
at
org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHe
lper.java:156) [:3.4.1.GA]
at
org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:90)
[:3.4.1.GA]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractH
TTPServlet.java:179) [:2.3.1]
at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServ
let.java:103) [:2.3.1]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
[:1.0.0.Final]
The client side error messages shown above are from executing a small Java
client I coded. When I use the Web Service utility in Eclipse to try to
call the same operation I get the same error.
I can provide my WSDL and both the annotated server and client side Java
code if needed.
Thanks,
Mike
--
Glen Mazza
Talend - http://www.talend.com/apache
Blog - http://www.jroller.com/gmazza
Twitter - glenmazza