IllegalArgumentException in WSDL first maven/cxf Soap Web Service - maven

I have a problem with a maven project using wsdl first and Camel CXF+Spring deployed on JBoss Fuse.
Calling the service the following exception occurs:
12:21:58,961 | WARN | qtp477359063-69 | PhaseInterceptorChain | 74 - org.apache.cxf.cxf-core - 3.0.4.redhat-621084 | Interceptor for {http://service.opf.meter.itd.it}OpfImpl#{http://service.opf.meter.itd.it}getOpf has thrown exception, unwinding now
java.lang.IllegalArgumentException: Part {http://service.opf.meter.itd.it}getOpfResponse should be of type it.itd.meter.opf.service.GetOpfResponse, not java.lang.String
at org.apache.cxf.jaxb.io.DataWriterImpl.checkPart(DataWriterImpl.java:292)[79:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-621084]
at org.apache.cxf.jaxb.io.DataWriterImpl.write(DataWriterImpl.java:220)[79:org.apache.cxf.cxf-rt-databinding-jaxb:3.0.4.redhat-621084]
at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:122)[74:org.apache.cxf.cxf-core:3.0.4.redhat-621084]
at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:69)[78:org.apache.cxf.cxf-rt-wsdl:3.0.4.redhat-621084]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)[74:org.apache.cxf.cxf-core:3.0.4.redhat-621084]
at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)[74:org.apache.cxf.cxf-core:3.0.4.redhat-621084]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)[74:org.apache.cxf.cxf-core:3.0.4.redhat-621084]
at org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:277)[74:org.apache.cxf.cxf-core:3.0.4.redhat-621084]
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)[74:org.apache.cxf.cxf-core:3.0.4.redhat-621084]
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)[82:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0.0]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)[96:org.apache.cxf.cxf-rt-transports-http:3.0.4.redhat-621084]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[93:org.ops4j.pax.web.pax-web-jetty:3.2.5]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:240)[93:org.ops4j.pax.web.pax-web-jetty:3.2.5]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:75)[93:org.ops4j.pax.web.pax-web-jetty:3.2.5]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.Server.handleAsync(Server.java:410)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:519)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[86:org.eclipse.jetty.aggregate.jetty-all-server:8.1.17.v20150415]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_101]
Here is my wsdl:
<wsdl:definitions targetNamespace="http://service.opf.meter.itd.it"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://service.opf.meter.itd.it"
xmlns:intf="http://service.opf.meter.itd.it"
xmlns:tns1="http://bean.opf.meter.itd.it"
xmlns:tns2="http://branch.bean.opf.meter.itd.it"
xmlns:tns3="http://bus.bean.opf.meter.itd.it"
xmlns:tns4="http://constrain.bean.opf.meter.itd.it"
xmlns:tns5="http://summary.bean.opf.meter.itd.it"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
(type omitted...)
<wsdl:message name="getOpfResponse">
<wsdl:part element="impl:getOpfResponse" name="getOpfResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getOpfRequest">
<wsdl:part element="impl:getOpfRequest" name="getOpfRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="OpfImpl">
<wsdl:operation name="getOpf">
<wsdl:input message="impl:getOpfRequest"></wsdl:input>
<wsdl:output message="impl:getOpfResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OpfImplSoapBinding" type="impl:OpfImpl">
<wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getOpf">
<wsdlsoap:operation soapAction="" style="document"/>
<wsdl:input>
<wsdlsoap:body parts="getOpfRequest" use="literal"/>
</wsdl:input>
<wsdl:output>
<wsdlsoap:body parts="getOpfResponse" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OpfImpl">
<wsdl:port binding="impl:OpfImplSoapBinding" name="DummyOpf">
<wsdlsoap:address location="http://192.168.80.125:8181/cxf/OptimalPowerFlow/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The (generated) interface:
package it.itd.meter.opf.service;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlSeeAlso;
/**
* This class was generated by Apache CXF 2.7.0.redhat-611423
* 2017-03-16T10:52:40.701+01:00
* Generated source version: 2.7.0.redhat-611423
*
*/
#WebService(targetNamespace = "http://service.opf.meter.itd.it", name = "OpfImpl")
#XmlSeeAlso({ObjectFactory.class, it.itd.meter.opf.bean.summary.ObjectFactory.class, it.itd.meter.opf.bean.bus.ObjectFactory.class, it.itd.meter.opf.bean.constrain.ObjectFactory.class, it.itd.meter.opf.bean.ObjectFactory.class, it.itd.meter.opf.bean.branch.ObjectFactory.class})
#SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface OpfImpl {
#WebMethod(action = "http://service.opf.meter.itd.it/getOpf")
#WebResult(name = "getOpfResponse", targetNamespace = "http://service.opf.meter.itd.it", partName = "getOpfResponse")
public GetOpfResponse getOpf(
#WebParam(partName = "getOpfRequest", name = "getOpfRequest", targetNamespace = "http://service.opf.meter.itd.it")
GetOpfRequest getOpfRequest
);
}
so the implementation:
#javax.jws.WebService(
serviceName = "OpfImpl",
portName = "DummyOpf",
targetNamespace = "http://service.opf.meter.itd.it",
wsdlLocation = "file:/home/meter/workdir/OptimalPowerFlow/src/main/resources/wsdl/OpfImpl.wsdl",
endpointInterface = "it.itd.meter.opf.service.OpfImpl")
public class DummyOpf implements OpfImpl {
private static final Logger LOG = Logger.getLogger(DummyOpf.class.getName());
#Override
public GetOpfResponse getOpf(GetOpfRequest getOpfRequest) {
System.out.println(getOpfRequest);
LOG.info(getOpfRequest.toString());
try{
OpfBean data = populateOpf();
GetOpfResponse getOpfResponse = new GetOpfResponse();
getOpfResponse.setGetOpfReturn(data);
return getOpfResponse;
}catch(Exception e){
e.printStackTrace();
return null;
}
}
}
Finally, the route configuration:
camel-cxf.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd">
<cxf:cxfEndpoint id="getOpfEndpoint"
address="/OptimalPowerFlow/"
serviceClass="it.itd.meter.opf.service.OpfImpl"
wsdlURL="wsdl/OpfImpl.wsdl"/>
<bean id="getDummyOpf" class=" it.itd.meter.OptimalPowerFlow.DummyOpf"/>
</beans>
camel-route.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<import resource="classpath:META-INF/spring/camel-cxf.xml" />
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<!-- route starts from the cxf webservice, see camel-cxf.xml for details -->
<from uri="cxf:bean:getOpfEndpoint" />
<bean ref="getDummyOpf"/>
<to uri="seda:incomingOrders" />
<!-- and then create the OK reply for the webservice which is still waiting for a reply -->
<transform>
<constant>OK</constant>
</transform>
</route>
<!-- test route -->
<route>
<from uri="seda:incomingOrders" />
<to uri="mock:end"/>
</route>
</camelContext>
</beans>
Any suggestion?

Related

Oracle APEX and WSDL service

I have a simple Java class deployed on WebLogic 12c as an application.
Application Express 5.0.3.00.03.
package wsdltest;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
#WebService
public class Class1 {
public Class1() {
super();
}
#WebMethod
public String getA(#WebParam(name = "arg0") String a) {
return a;
}
}
wsdl
<!--
Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.3.0-b170407.2038 svn-revision#2eaca54d17a59d265c6fe886b7fd0027836c766c.
-->
<!--
Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.3.0-b170407.2038 svn-revision#2eaca54d17a59d265c6fe886b7fd0027836c766c.
-->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://wsdltest/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://wsdltest/" name="Class1Service">
<types>
<xsd:schema>
<xsd:import namespace="http://wsdltest/" schemaLocation="http://172.28.36.23:7001/Raznosti-WSDLTest-context-root/Class1Port?xsd=1"/>
</xsd:schema>
</types>
<message name="getA">
<part name="parameters" element="tns:getA"/>
</message>
<message name="getAResponse">
<part name="parameters" element="tns:getAResponse"/>
</message>
<portType name="Class1">
<operation name="getA">
<input wsam:Action="http://wsdltest/Class1/getARequest" message="tns:getA"/>
<output wsam:Action="http://wsdltest/Class1/getAResponse" message="tns:getAResponse"/>
</operation>
</portType>
<binding name="Class1PortBinding" type="tns:Class1">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="getA">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="Class1Service">
<port name="Class1Port" binding="tns:Class1PortBinding">
<soap:address location="http://172.28.36.23:7001/Raznosti-WSDLTest-context-root/Class1Port"/>
</port>
</service>
</definitions>
I've created APEX WebService Reference (based on WSDL file) via Wizard. URL was parsed, input/output parameters was found.
I've created Form on Web service too. Input/output fields, submit button, process - all were created by Wizard, no manual work. But on every submit form I get error ns0:ClientCannot find dispatch method for {}arg0. I can successfully test this web service from JDeveloper. I can create Manual type of WebService Reference with direct configure of all params, including SOAP Envelop etc and its works.
Why standard made-by-wizard web service based on correct (as I suppose) WSDL doesn't work?

Spring-boot web-service endpoint class not working

Trying to create spring-boot project with soap web services using Maven.
Project setup is correct without any compile time issues.
Have used spring-boot-web-services dependency.
When the application is launched, i can see the wsdl correctly but when i hit the operation using chrome wizdler with appropriate input, i get Failure.
Cannot even see a print statement that is present inside my endpoint class.
Need to confirm whether i have provided proper values to annotations #PayloadRoot, #RequestPayload and #ResponsePayload based on WSDL.
Below is my WSDL and the Endpoint class:
WSDL file
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="schemas.corporate.com/col/2014/01" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="VaultNotificationService" targetNamespace="schemas.corporate.com/col/2014/01">
<wsp:Policy wsu:Id="BasicHttpBinding_IVaultNotificationService_policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false" />
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:CorporateServices" elementFormDefault="qualified" targetNamespace="urn:CorporateServices">
<xs:element name="OrderUpdate">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" form="unqualified" name="OrderUpdateItemList" type="tns:OrderUpdateItem" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="OrderUpdateItem">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" form="unqualified" name="Order_ID" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" form="unqualified" name="Order_InternalID" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" form="unqualified" name="Order_Status" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="OrderUpdateResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" form="unqualified" name="OrderUpdateItemList" type="tns:OrderUpdateItem" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="UpdateRequest">
<wsdl:part xmlns:q1="urn:CorporateServices" name="parameters" element="q1:OrderUpdate" />
</wsdl:message>
<wsdl:message name="UpdateResponse">
<wsdl:part xmlns:q2="urn:CorporateServices" name="parameters" element="q2:OrderUpdateResponse" />
</wsdl:message>
<wsdl:portType name="IVaultNotificationService">
<wsdl:operation name="Update">
<wsdl:input wsaw:Action="schemas.corporate.com/col/2014/01/IVaultNotificationService/Update" name="UpdateRequest" message="tns:UpdateRequest" />
<wsdl:output wsaw:Action="schemas.corporate.com/col/2014/01/IVaultNotificationService/UpdateResponse" name="UpdateResponse" message="tns:UpdateResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IVaultNotificationService" type="tns:IVaultNotificationService">
<wsp:PolicyReference URI="#BasicHttpBinding_IVaultNotificationService_policy" />
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Update">
<soap:operation soapAction="schemas.corporate.com/col/2014/01/IVaultNotificationService/Update" style="document" />
<wsdl:input name="UpdateRequest">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="UpdateResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="VaultNotificationService">
<wsdl:port name="BasicHttpBinding_IVaultNotificationService" binding="tns:BasicHttpBinding_IVaultNotificationService">
<soap:address location="https://app.sit.col.corporate.com/VaultNotificationService.svc" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Endpoint class
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import colservices.OrderUpdate;
import colservices.OrderUpdateItem;
import colservices.OrderUpdateResponse;
#Endpoint
public class OrderUpdateEndpoint {
private final IVaultNotificationService vaultNotificationService;
#Autowired
public OrderUpdateEndpoint(IVaultNotificationService vaultNotificationService) {
this.vaultNotificationService = vaultNotificationService;
}
#PayloadRoot(namespace = "urn:CorporateServices", localPart = "UpdateRequest")
#ResponsePayload
public OrderUpdateResponse updateOrderStatus(#RequestPayload OrderUpdate request) {
System.out.println("Enetered in endpoint");
List<OrderUpdateItem> orderUpdateItemList = vaultNotificationService
.updateOrdersStatus(request.getOrderUpdateItemList());
OrderUpdateResponse response = new OrderUpdateResponse();
response.getOrderUpdateItemList().addAll(orderUpdateItemList);
return response;
}
}
Please let me know what i have missed.
ApplicationConfig
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.ws.config.annotation.EnableWs;
import org.springframework.ws.config.annotation.WsConfigurerAdapter;
import org.springframework.ws.transport.http.MessageDispatcherServlet;
import org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition;
import org.springframework.ws.wsdl.wsdl11.Wsdl11Definition;
#EnableWs
#Configuration
public class ApplicationConfig extends WsConfigurerAdapter {
#Bean
public ServletRegistrationBean dispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/services/*");
}
#Bean(name = "orderStatusUpdator")
public Wsdl11Definition defaultWsdl11Definition() {
SimpleWsdl11Definition wsdl11Definition = new SimpleWsdl11Definition();
wsdl11Definition.setWsdl(new ClassPathResource("vaultNotificationService.wsdl"));
return wsdl11Definition;
}
}
Application
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class Application {
public static void main(String[] args) {
System.out.println("entering application");
SpringApplication.run(Application.class, args);
}
}
Got working with below changes:
1) Changed in WSDL from
<soap:address location="https://app.sit.col.corporate.com/VaultNotificationService.svc" />
to
<soap:address location="https://app.sit.col.travelex.com/services" />
Reason:
i) /services/ URI is used as base uri
ii) As servlet.setTransformWsdlLocations(true), this location would be transformed automatically as per the user request.
2) Moved Application class in parent package where endpoint classes reside to allow component scan to work.

Error cvc-elt.1.a: Cannot find the declaration of element 'soapenv:Body'

I have already tried some hints but I get this problem not solved. I validated the wsdl with xmlspy-client and it says it and the xsd are valid.
When I send a Request like this with SOAPUI I get the Exception mentioned (cvc-elt.1.a: Cannot find the declaration of element 'soapenv:Body').
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:mod="http://schemas.domain.com/wsdl/fuelprice/v1/model">
<soapenv:Header/>
<soapenv:Body>
<v1:AuthenticationHeader client="client">
<v1:token>token</v1:token>
</v1:AuthenticationHeader>
<v1:GetAreaFuelStationsRequest provider="p1" prices="true">
<v1:area>
<mod:center ellipsoid="false">
<mod:latitude>22.519172</mod:latitude>
<mod:longitude>13.406093</mod:longitude>
</mod:center>
<mod:radius>10</mod:radius>
</v1:area>
</v1:GetAreaFuelStationsRequest>
</soapenv:Body>
</soapenv:Envelope>
I have tried importing the soap schema in the wsdl. After it I got an error message:
"cvc-complex-type.2.4.a: Invalid content was found starting with element 'v1:latitude'. One of '{"http://schemas.domain.com/wsdl/fuelprice/v1/model":latitude}' is expected.".
I honestly work with rest and json and have some difficulties with this schema-configuration.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="wsdl-viewer.xsl"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" xmlns:exception="http://schemas.domain.com/wsdl/fuelprice/v1/exception" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1">
<wsdl:types>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1" elementFormDefault="qualified">
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" schemaLocation="common.xsd"/>
<xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/exception" schemaLocation="exception.xsd"/>
<xsi:element name="GetAreaFuelStationsRequest">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="area" type="model:Area"/>
</xsi:sequence>
<xsi:attribute name="provider" type="xsi:string" use="optional"/>
<xsi:attribute name="prices" type="xsi:boolean" use="required"/>
</xsi:complexType>
</xsi:element>
<xsi:element name="GetAreaFuelStationsResponse">
<xsi:complexType>
<xsi:sequence>
<xsi:element name="entry" type="model:SearchResult" minOccurs="0" maxOccurs="unbounded"/>
</xsi:sequence>
<xsi:attribute name="countTotal" type="xsi:int" use="optional"/>
</xsi:complexType>
</xsi:element>
</xsi:schema>
</wsdl:types>
<wsdl:message name="SearchAreaFuelStationsRequest">
<wsdl:part name="auth" element="tns:AuthenticationHeader"/>
<wsdl:part name="body" element="tns:GetAreaFuelStationsRequest"/>
</wsdl:message>
<wsdl:message name="SearchAreaFuelStationsResponse">
<wsdl:part name="body" element="tns:GetAreaFuelStationsResponse"/>
</wsdl:message>
<wsdl:portType name="FuelDataService">
<wsdl:operation name="GetAreaFuelStations">
<wsdl:input message="tns:GetAreaFuelStationsRequest"/>
<wsdl:output message="tns:GetAreaFuelStationsResponse"/>
<wsdl:fault name="ServiceError" message="tns:ServiceErrorFault"/>
<wsdl:fault name="AuthenticationError" message="tns:AuthenticationErrorFault"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FuelDataService" type="tns:FuelDataService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetAreaFuelStations">
<soap:operation soapAction="urn:GetAreaFuelStations"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="ServiceError"/>
<wsdl:fault name="AuthenticationError"/>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="FuelDataService">
<wsdl:port name="FuelDataService" binding="tns:FuelDataService">
<soap:address location="No target address"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
The XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" elementFormDefault="qualified">
<xsi:complexType name="FuelStation">
<xsi:sequence>
<xsi:element name="location" type="model:GeoLocation"/>
<xsi:element name="name" type="xsi:string"/>
</xsi:sequence>
<xsi:attribute name="id" type="xsi:long" use="optional"/>
</xsi:complexType>
<xsi:complexType name="GeoLocation">
<xsi:sequence>
<xsi:element name="latitude" type="xsi:double"/>
<xsi:element name="longitude" type="xsi:double"/>
</xsi:sequence>
<xsi:attribute name="ellipsoid" type="xsi:string" use="required"/>
</xsi:complexType>
<xsi:complexType name="Area">
<xsi:sequence>
<xsi:element name="center" type="model:GeoLocation"/>
<xsi:element name="radius" type="xsi:float"/>
</xsi:sequence>
</xsi:complexType>
</xsi:schema>
For me is not obvious what I should change to get this working. Does anybody knows what is wrong with the namespace setting? I would appreciate any help.
This Question was solved with the Question validating SOAP-Request with a SOAPHandler
Extracting the body of message, adding the needed namespace in the schema and validating the body as a Document did the trick.

Spring Web service unmarshalling not happening correctly

I have been trying to integrate the spring WS to test a SOAP webservice.Integration has hit a roadblock as I am not able receive the proper response in the unmarshelled object.
Below are the details:
Application Context is below:
<!-- Define the SOAP version used by the WSDL -->
<bean id="soapMessageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">
<property name="soapVersion">
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/>
</property>
</bean>
<!-- The location of the generated Java files -->
<oxm:jaxb2-marshaller id="marshaller" contextPath="com.uk.fs.generatedsources"/>
<!-- Configure Spring Web Services -->
<bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
<constructor-arg ref="soapMessageFactory"/>
<property name="marshaller" ref="marshaller"/>
<property name="unmarshaller" ref="marshaller"/>
<property name="defaultUri" value="http://192.168.243.21/test/services/testservice?wsdl"/>
</bean>
Below is the method which invokes marshalSendAndReceive:
public List<FSChild> getFSChildren() {
GetFSChildren getFSChildren= new ObjectFactory().createGetFSChildren();
getFSChildren.setCountry("CA");
getFSChildren.setFsCode("5010");
getFSChildren.setLimit(6);
GetFSChildrenResponse response = (GetFSChildrenResponse) webServiceTemplate.marshalSendAndReceive(
getFSChildren);
return response.getGetFSChildrenReturn();
}
Class GetFSChildrenResponse is as below:
#XmlAccessorType(XmlAccessType.FIELD)
#XmlType(name = "", propOrder = {
"getHSChildrenReturn"
})
#XmlRootElement(name = "getFSChildrenResponse")
public class GetFSChildrenResponse {
#XmlElement(required = true)
protected List<FSChild> getFSChildrenReturn;
public List<FSChild> getGetFSChildrenReturn() {
if (getFSChildrenReturn == null) {
getFSChildrenReturn = new ArrayList<FSChild>();
}
return this.getFSChildrenReturn;
}
}
class FSChild is as below:
#XmlAccessorType(XmlAccessType.FIELD)
#XmlType(name = "FSChild", namespace = "http://hs.uk.com", propOrder = {
"description",
"fsCode"
})
public class FSChild {
#XmlElement(required = true, nillable = true)
protected String description;
#XmlElement(required = true, nillable = true)
protected String fsCode;
public String getDescription() {
return description;
}
public void setDescription(String value) {
this.description = value;
}
public String getFsCode() {
return hsCode;
}
public void setFsCode(String value) {
this.hsCode = value;
}
}
I feel like quite close to get it working..
Request is properly marshalled and even request is sent properly to webservice which logs the response and returns it properly.
but when try to extract the response like below:
GetFSChildrenResponse response = (GetFSChildrenResponse) webServiceTemplate.marshalSendAndReceive( getFSChildren);
now at this point when I debug,I find that response object is populated and it contains 1 getHSChildrenReturn list containing one item which was expected but code and description in fschild is set to null.
I have even turned on TRACE logs for messages.I see response xml properly returning data which is as below:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getHSChildrenResponse xmlns="http://service.hs.pb.com">
<getHSChildrenReturn>
<description>Silk: Silk-worm cocoons suitable for reeling.</description>
<fsCode>5001000000</hsCode>
</getFSChildrenReturn>
</getFSChildrenResponse>
</soapenv:Body>
</soapenv:Envelope>
Please find below the wsdl from which classes were generated:
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://service.fs.uk.com" xmlns:intf="http://service.fs.uk.com" xmlns:tns1="http://fs.uk.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.fs.uk.com">
<!--
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)
-->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://service.fs.uk.com">
<import namespace="http://fs.uk.com"/>
<element name="getCountries">
<complexType/>
</element>
<element name="getCountriesResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="getCountriesReturn" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getFSChildren">
<complexType>
<sequence>
<element name="fsCode" type="xsd:string"/>
<element name="country" type="xsd:string"/>
<element name="limit" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="getFSChildrenResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded" name="getFSChildrenReturn" type="tns1:FSChild"/>
</sequence>
</complexType>
</element>
</schema>
<schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://fs.uk.com">
<complexType name="FSChild">
<sequence>
<element name="description" nillable="true" type="xsd:string"/>
<element name="fsCode" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="getCountriesResponse">
<wsdl:part element="impl:getCountriesResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="getCountriesRequest">
<wsdl:part element="impl:getCountries" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="getFSChildrenRequest">
<wsdl:part element="impl:getFSChildren" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="getFSChildrenResponse">
<wsdl:part element="impl:getFSChildrenResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="FSService">
<wsdl:operation name="getCountries">
<wsdl:input message="impl:getCountriesRequest" name="getCountriesRequest"></wsdl:input>
<wsdl:output message="impl:getCountriesResponse" name="getCountriesResponse"></wsdl:output>
</wsdl:operation>
<wsdl:operation name="getFSChildren">
<wsdl:input message="impl:getFSChildrenRequest" name="getFSChildrenRequest"></wsdl:input>
<wsdl:output message="impl:getFSChildrenResponse" name="getFSChildrenResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="FSServiceSoapBinding" type="impl:FSService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getCountries">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getCountriesRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getCountriesResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getFSChildren">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getFSChildrenRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getFSChildrenResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="testserviceService">
<wsdl:port binding="impl:FSServiceSoapBinding" name="testservice">
<wsdlsoap:address location="http://192.168.240.87/FSWS/testservice/FSService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Answering my own question after getting frustrated for hours.There seems to be problem with the namespaces in wsdl.I changed following 2things in wsdl and generated the classes again resulting in proper responses.
xmlns:tns1="http://fs.uk.com" to xmlns:tns1="http://service.fs.uk.com"
targetNamespace="http://fs.uk.com" to targetNamespace="http://service.fs.uk.com"
for element FSChild.
It was little surprising for me as original wsdl without changes works perfectly with SOAPUI. If anyone can explain this,I will award him the bounty

Failed to parse WSDL during deploying app on jboss - maybe Woodstox

I've a problem during deploying application on jboss. I found some information that changing version of woodstox might help, but it wasn't...
Log:
16:58:09,079 INFO [stdout] (MSC service thread 1-2) [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Failed to parse WSDL
16:58:09,080 INFO [stdout] (MSC service thread 1-2) javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
16:58:09,080 INFO [stdout] (MSC service thread 1-2) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:257)
16:58:09,104 INFO [stdout] (MSC service thread 1-2) Caused by: java.lang.RuntimeException: Cannot create a secure XMLInputFactory
16:58:09,104 INFO [stdout] (MSC service thread 1-2) at org.apache.cxf.staxutils.StaxUtils.createXMLInputFactory(StaxUtils.java:312)
16:58:09,514 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-2) Context initialization failed: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for endpoint: Endpoint[cxf://bean:adapter.NotificationService?dataFormat=PAYLOAD]. Reason: org.apache.cxf.service.factory.ServiceConstructionException: No valid WSDL classpath:/interface/adapter/notification-service/v10/NotificationService.wsdl nor service class is specified.
at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:409) [camel-core-2.12.3.jar:2.12.3]
at org.apache.camel.impl.ProducerCache.acquireProducer(ProducerCache.java:123) [camel-core-2.12.3.jar:2.12.3]
I've absolutely no idea what else can i check... My environment:
svn 1.7.9 (r1462340) Apache Maven 3.1.1
(0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 Maven home:
Java version: 1.7.0_45, vendor: Oracle Corporation OS name: "linux",
version: "3.11.0-12-generic", arch: "amd64", family: "unix" javac
1.7.0_45 java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Woodstox inside jboss: 4.1.1 (I was changing it to 4.2.1 and 4.2.0)
My wsdl definition:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions name="NotificationService"
targetNamespace="http://service/NotificationService/v10"
xmlns:tns="http://service/NotificationService/v10"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xs:schema
targetNamespace="http://service/NotificationService/v10">
<xs:include schemaLocation="NotificationService.xsd" />
</xs:schema>
</wsdl:types>
<!-- notifyPaymentStatus message-->
<wsdl:message name="notifyPaymentStatusParameters">
<wsdl:part name="notifyPaymentStatusPart" element="tns:notifyPaymentStatusRQ">
</wsdl:part>
</wsdl:message>
<wsdl:message name="notifyPaymentStatusResult">
<wsdl:part name="notifyPaymentStatusPart" element="tns:notifyPaymentStatusRS">
</wsdl:part>
</wsdl:message>
<!-- notifyError message-->
<wsdl:message name="notifyErrorParameters">
<wsdl:part name="notifyErrorPart" element="tns:notifyErrorRQ">
</wsdl:part>
</wsdl:message>
<wsdl:message name="notifyErrorResult">
<wsdl:part name="notifyErrorPart" element="tns:notifyErrorRS">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="NotificationService">
<wsdl:operation name="notifyPaymentStatus">
<wsdl:input name="notifyPaymentStatusParameters" message="tns:notifyPaymentStatusParameters" />
<wsdl:output name="notifyPaymentStatusResult" message="tns:notifyPaymentStatusResult" />
</wsdl:operation>
<wsdl:operation name="notifyError">
<wsdl:input name="notifyErrorParameters" message="tns:notifyErrorParameters" />
<wsdl:output name="notifyErrorResult" message="tns:notifyErrorResult" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NotificationServiceBinding" type="tns:NotificationService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="notifyPaymentStatus">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="notifyError">
<soap:operation soapAction="" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NotificationService">
<wsdl:port name="NotificationServicePort" binding="tns:NotificationServiceBinding">
<soap:address location="http://www.example.org/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
and endpoint:
<cxf:cxfEndpoint id="adapter.NotificationService"
endpointName="s:NotificationServicePort" serviceName="s:NotificationService"
wsdlURL="classpath:/interface/adapter/notification-service/v10/NotificationService.wsdl"
xmlns:s="http://service/NotificationService/v10">
<cxf:properties>
<entry key="schema-validation-enabled"
value="true" />
</cxf:properties>
<cxf:inInterceptors>
<ref bean="logInInterceptor" />
</cxf:inInterceptors>
<cxf:inFaultInterceptors>
<ref bean="logInInterceptor" />
</cxf:inFaultInterceptors>
<cxf:outInterceptors>
<ref bean="logOutInterceptor" />
</cxf:outInterceptors>
<cxf:outFaultInterceptors>
<ref bean="logOutInterceptor" />
</cxf:outFaultInterceptors>
</cxf:cxfEndpoint>
When i was debugging i found some property, which is called:
org.apache.cxf.stax.allowInsecureParser. How can I set it on true? In these case probably I won't have any problems with parsing wsdl.
this one workaround works fine for me:
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject">
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="java.lang.System" />
<property name="targetMethod" value="getProperties" />
</bean>
</property>
<property name="targetMethod" value="putAll" />
<property name="arguments">
<util:properties>
<prop key="org.apache.cxf.stax.allowInsecureParser">true</prop>
</util:properties>
</property>
</bean>
from :
CXF 2.7.x Woodstox Compatibility via Maven
I found that in my dependencies I've correct lib: 4-2-0, but I don't know why jboss is using another lib from somewhere... In my opinion better sollution would be to set on jboss to not overwrite libraries. In another case I'm still getting warning like this:
2014-06-27 12:59:58,932 WARN (MSC service thread 1-16) [org.apache.cxf.staxutils.StaxUtils] Could not create a secure Stax XMLInputFactory. Found class com.ctc.wstx.stax.WstxInputFactory. Suggest Woodstox 4.2.0 or newer.

Resources