Ronald,
1) Not sure on the exception, that shouldn't have happened. However, use of
SOAP12HTTP_MTOM_BINDING is deprecated in JAX-WS 2.1. Normally, you would
just use: SOAP12HTTP_BINDING
and add an @MTOM annotation. (Actually, there error looks like possibly an
old version of wsdl4j. Not really sure though.)
2) No idea on that one either. I have no idea what the error means in Axis2.
3) We have the wsdl2java file/script in the bin directory of the distribution.
There is also the wsdl2java goal in the codegen maven plugin.
Dan
On Wednesday 13 August 2008 7:31:27 am Ronald Pieterse wrote:
> 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(SoapBindin
>gFactory.java:186) at
> org.apache.cxf.binding.soap.SoapBindingFactory.createBindingInfo(SoapBindin
>gFactory.java:172) at
> org.apache.cxf.binding.AbstractBindingFactory.createBindingInfo(AbstractBin
>dingFactory.java:82) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(
>AbstractWSDLBasedEndpointFactory.java:302) at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFa
>ctoryBean.java:154) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo
>(AbstractWSDLBasedEndpointFactory.java:178) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abs
>tractWSDLBasedEndpointFactory.java:102) at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:114
>) at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.j
>ava: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:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.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(SimpleDeserial
>izer.java:145) at
> org.apache.axis.encoding.DeserializationContext.startElement(Deserializatio
>nContext.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.ja
>va: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(SimpleDeserial
>izer.java:145) at
> org.apache.axis.encoding.DeserializationContext.startElement(Deserializatio
>nContext.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.ja
>va: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
--
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog