You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Olvera Segura Jaime Ivan <jo...@bursatec.com.mx> on 2008/01/04 04:58:32 UTC
MTOM problems : http://schemas.xmlsoap.org/wsdl/" is not a valid
SOAP version.
Hi,
I just deploy a webservice using anotations and spring to generate it, it works fine for the wsdl generation, but when i try to consume the service fault with this exception:
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: "http://schemas.xmlsoap.org/wsdl/" is not a valid SOAP version.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:90)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:56)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:402)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1948)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1791)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:207)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:254)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:205)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:135)
at $Proxy27.publica(Unknown Source)
at com.bursatec.publicador.test.wsClient.TestPublica.testPublicaArchivo(TestPublica.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
these are my files:
configuration file:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean class="com.bursatec.publicador.web.services.impl.PublicadorWebServiceImpl" id="publicadorWebService">
<property name="publicadorService">
<ref bean="publicaService" />
</property>
</bean>
<jaxws:endpoint
id="publicador"
implementor="#publicadorWebService"
address="/servicio">
<jaxws:properties>
<entry key="mtom-enabled" value="true"/>
</jaxws:properties>
</jaxws:endpoint>
</beans>
My service :
@WebService(name="PublicadorWS")
@WebFault(name="publicadorException")
public interface PublicadorWebService {
@WebMethod(operationName="publicaArchivo")
@WebResult(name="resultadoPublicacion")
public String publica(
@WebParam(name = "publicaJaxb") PublicaJaxb publicaJaxb) throws PublicadorException;
}
And my client :
public final void testPublicaArchivo() {
try {
final String wsdlUrl = "http://10.100.72.30:7001/publicador/services/servicio?wsdl=PublicadorWS.wsdl";
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("mtom-enabled", Boolean.TRUE);
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setProperties(properties);
factory.setServiceClass(PublicadorWebService.class);
factory.setAddress(wsdlUrl);
PublicaJaxb publicaJaxb = new PublicaJaxb();
publicaJaxb.setTipoPublicacion(tipoPub);
publicaJaxb.setEntidadEmisora(emisora);
publicaJaxb.setSistema(sistema);
publicaJaxb.setCodigoSeguridad(codigo);
publicaJaxb.setUsuario(usuario);
publicaJaxb.setNombreArchivo(nombreArchivo);
DataSource source = new FileDataSource(new File("O:/desarrollo/BN5903_Noticias_08-11-2007.pdf"));
publicaJaxb.setData(new DataHandler(source));
PublicadorWebService client = (PublicadorWebService) factory.create();
client.publica(publicaJaxb);
and my wsdl :
wsdl:definitions name="PublicadorWS" targetNamespace="http://services.web.publicador.bursatec.com/">
−
<wsdl:types>
−
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://services.web.publicador.bursatec.com/">
−
<xs:complexType name="publicaJaxb">
−
<xs:sequence>
<xs:element minOccurs="0" name="data" ns1:expectedContentTypes="application/octet-stream" type="xs:base64Binary"/>
<xs:element minOccurs="0" name="codigoSeguridad" type="xs:string"/>
<xs:element minOccurs="0" name="entidadEmisora" type="xs:int"/>
<xs:element minOccurs="0" name="nombreArchivo" type="xs:string"/>
<xs:element minOccurs="0" name="sistema" type="xs:string"/>
<xs:element minOccurs="0" name="tipoPublicacion" type="xs:string"/>
<xs:element minOccurs="0" name="usuario" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="PublicadorException" type="PublicadorException"/>
−
<xs:complexType name="PublicadorException">
<xs:sequence/>
</xs:complexType>
<xs:element name="publicaArchivo" type="publicaArchivo"/>
−
<xs:complexType name="publicaArchivo">
−
<xs:sequence>
<xs:element minOccurs="0" name="publicaJaxb" type="publicaJaxb"/>
</xs:sequence>
</xs:complexType>
<xs:element name="publicaArchivoResponse" type="publicaArchivoResponse"/>
−
<xs:complexType name="publicaArchivoResponse">
−
<xs:sequence>
<xs:element minOccurs="0" name="resultadoPublicacion" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
−
<wsdl:message name="PublicadorException">
<wsdl:part element="ns1:PublicadorException" name="PublicadorException">
</wsdl:part>
</wsdl:message>
−
<wsdl:message name="publicaArchivo">
<wsdl:part element="ns1:publicaArchivo" name="parameters">
</wsdl:part>
</wsdl:message>
−
<wsdl:message name="publicaArchivoResponse">
<wsdl:part element="ns1:publicaArchivoResponse" name="parameters">
</wsdl:part>
</wsdl:message>
−
<wsdl:portType name="PublicadorWS">
−
<wsdl:operation name="publicaArchivo">
<wsdl:input message="ns1:publicaArchivo" name="publicaArchivo">
</wsdl:input>
<wsdl:output message="ns1:publicaArchivoResponse" name="publicaArchivoResponse">
</wsdl:output>
<wsdl:fault message="ns1:PublicadorException" name="PublicadorException">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
Does anything is wrong ?
It seems that cxf get for the service at http://services.web.publicador.bursatec.com -> Is it possible to change to something like http://localhost ? or it doesn't matters
Because it's only deploy at localhost
Do I have to put also this aditional line in applicationcontext.xml
<jaxws:binding>
<soap:soapBinding mtomEnabled="true" version="1.2"/>
</jaxws:binding>
Thanks in advance
Ivan
.