I have a couple of questions and hope that someone will be able to answer
them fairly quickly. I'm in a bit of a rush here...
I have an MTOM enabled service (CXF 2.1.1) and want to use my client code to
receive attachments. The service is implemented correctly I think, since
the following code works just fine:
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setServiceClass(PrototypeService.class);
factory.setAddress("http://localhost:83/soap/PrototypeService");
PrototypeService client = (PrototypeService) factory.create();
com.tripolis.api.model.v15.Attachment reply = client.getFile();
InputStream fileStream = (InputStream)
reply.getData().getInputStream();
...here we get the data from the stream (tested fine with 160MB)
However this uses classes from the server since I have no client code
generated here. You don't want to have your clients do this, right?
My service is MTOM enabled through the WebService annotation like so:
@BindingType(value = SOAPBinding.SOAP11HTTP_MTOM_BINDING)
My questions:
1. Why does using SOAP12HTTP_MTOM_BINDING throw the following exception for
me:
WSDLException: faultCode=CONFIGURATION_ERROR: No Java extensionType
found
to represent a '{http://schemas.xmlsoap.org/wsdl/soap12/}binding' element in
the context of a 'javax.wsdl.Binding'.:
at
javax.wsdl.extensions.ExtensionRegistry.createExtension(Unknown Source)
at
org.apache.cxf.tools.util.SOAPBindingUtil.createSoapBinding(SOAPBindingUtil.java:413)
at
org.apache.cxf.binding.soap.SoapBindingFactory.createSoapBinding(SoapBindingFactory.java:186)
at
org.apache.cxf.binding.soap.SoapBindingFactory.createBindingInfo(SoapBindingFactory.java:172)
at
org.apache.cxf.binding.AbstractBindingFactory.createBindingInfo(AbstractBindingFactory.java:82)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:302)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:154)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:178)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102)
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:164)
at
org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:334)
at
org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:251)
at
org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
at
org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:392)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
2. My Axis 1.4 client code does not work when I try to invoke the call.
OCuld this be due to incompatibility between CXF 2.1.1 and Axis 1.4?
It was generated just fine but invocation of the getFile method throws the
following exception:
2008-08-13 13:21:42,149 ERROR org.apache.axis.client.Call - Exception:
org.xml.sax.SAXException: SimpleDeserializer encountered a child
element,
which is NOT expected, in something it was trying to deserialize.
at
org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at
com.tripolis.test.prototype.client.PrototypeServiceSoapBindingStub.getFile(PrototypeServiceSoapBindingStub.java:389)
at
com.tripolis.test.prototype.client.ClientTest.generatedClient(ClientTest.java:27)
at
com.tripolis.test.prototype.client.ClientTest.main(ClientTest.java:21)
AxisFault
faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a
child element, which is NOT expected, in something it was trying to
deserialize.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException:
SimpleDeserializer encountered a child element, which is NOT expected, in
something it was trying to deserialize.
at
org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at
com.tripolis.test.prototype.client.PrototypeServiceSoapBindingStub.getFile(PrototypeServiceSoapBindingStub.java:389)
at
com.tripolis.test.prototype.client.ClientTest.generatedClient(ClientTest.java:27)
at
com.tripolis.test.prototype.client.ClientTest.main(ClientTest.java:21)
{http://xml.apache.org/axis/}hostname:HP-NX9420-01
3. How do I generate client code with CXF 2.1.1? I can't seem to find the
WSDL2Java file anymore. I have the JAX-WS frontend stuff in my classpath
(I use maven so it came in with CXF)
Thnx.
Ronald
--
View this message in context:
http://www.nabble.com/Problem-client-code-MTOM-enabled-service-%28CXF-2.1.1%29-tp18961332p18961332.html
Sent from the cxf-user mailing list archive at Nabble.com.