jaxrs with embedded jetty configuration problem - java

I'm trying to get a web service up using jaxrs and jetty:
This is my jaxrms.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<!-- import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /-->
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<bean id="restService" class="com.as.rover.service.rest.RestService" >
</bean>
<jaxrs:server id="jaxrsRestService" address="/rest/">
<jaxrs:serviceBeans>
<ref bean="restService" />
</jaxrs:serviceBeans>
</jaxrs:server>
</beans>
This is my jetty.xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean class="com.as.rover.service.JettyManager" factory-method="getInstance" id="jettyManager">
<property name="server" >
<bean id="jetty-server" class="org.eclipse.jetty.server.Server" init-method="start" destroy-method="stop">
<property name="connectors">
<list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<property name="port" value="8080"/>
</bean>
</list>
</property>
<property name="handler">
<bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerList">
<property name="handlers">
<list>
<ref bean="servletContextHandler"></ref>
<!--bean class="org.eclipse.jetty.server.handler.ResourceHandler">
<property name="directoriesListed" value="true"/>
<property name="welcomeFiles">
<list>
<value>index.html</value>
</list>
</property>
<property name="resourceBase" value="."/>
</bean>
<bean class="org.eclipse.jetty.server.handler.DefaultHandler"/-->
<!-- add more handlers here -->
</list>
</property>
</bean>
</property>
</bean>
</property>
</bean>
<bean id="web-context" class="org.eclipse.jetty.webapp.WebAppContext">
<property name="resourceBase" value="./src/main/web"></property>
<property name="contextPath" value="/services/*"></property>
<bean id="servletContextHandler" class="org.eclipse.jetty.servlet.ServletContextHandler">
<property name="contextPath" value="/" />
</bean>
<bean id="javaVersion" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="servletContextHandler"/>
<property name="targetMethod" value="addServlet"/>
<property name="arguments">
<list>
<bean class="org.eclipse.jetty.servlet.ServletHolder">
<property name="name" value="services" />
<property name="servlet">
<bean class="org.apache.cxf.transport.servlet.CXFServlet"/>
</property>
</bean>
<value>/</value>
</list>
</property>
</bean>
</beans>
My rest service class looks like this:
#Path("/test") // bind to versionnr in path
public class RestService{
#GET
public long get() {
return 1L;
}
}
Whenever I make a request to localhost:8080/services/test I get the following error message:
service not found.
I want to configure my embedded jetty server with jaxrs but it doesn't seem to work. Have I misconfigured jetty?

If you are using Spring, and all your dependencies are well placed, the only thing you need to expose a restful service is your first file.
cxf-rt-transports-http-jetty will take care of the link between your service code and the jetty server.
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
<context:annotation-config />
<bean id="serviceImpl" class="com.as.rover.service.rest.serviceImpl" ></bean>
<!-- CXF -->
<import resource="classpath:META-INF/cxf/cxf.xml" />
<jaxrs:server id="JaxrsService" address="http://localhost:6066/services">
<jaxrs:serviceBeans>
<ref bean="serviceImpl" />
</jaxrs:serviceBeans>
</jaxrs:server>
Hope it helps.

Related

How to create cache expiry policy in ignite server by xml?

This is my example-default.xml,
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<bean abstract="true" id="ignite.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
<!-- Set to true to enable distributed class loading for examples, default is false. -->
<property name="peerClassLoadingEnabled" value="true"/>
<!-- Enable task execution events for examples. -->
<property name="includeEventTypes">
<list>
<!--Task execution events-->
<util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED"/>
<!--Cache events-->
<util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ"/>
<util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED"/>
</list>
</property>
<property name="CacheExpiryPolicy">
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="expiryPolicyFactory">
<bean class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf">
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="MINUTES"/>
<constructor-arg value="5"/>
</bean>
</constructor-arg>
</bean>
</property>
</bean>
</property>
But the above gives Bean property 'CacheExpiryPolicy' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
How I can solve this?
I found an apache-ignite-users forum question on this.
Please refer to this here
So, the final updated xml according to that forum reference is :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<!-- Added cache expiry policy -->
<bean id="cacheExpiryPolicy"
class="javax.cache.configuration.FactoryBuilder$SingletonFactory">
<constructor-arg>
<bean class="javax.cache.expiry.CreatedExpiryPolicy">
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="MINUTES" />
<constructor-arg value="5" />
</bean>
</constructor-arg>
</bean>
</constructor-arg>
</bean>
<bean abstract="true" id="ignite.cfg"
class="org.apache.ignite.configuration.IgniteConfiguration">
<!-- Set to true to enable distributed class loading for examples, default
is false. -->
<property name="peerClassLoadingEnabled" value="true" />
<!-- Enable task execution events for examples. -->
<property name="includeEventTypes">
<list>
<!--Task execution events -->
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_STARTED" />
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_FINISHED" />
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_FAILED" />
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_TIMEDOUT" />
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_SESSION_ATTR_SET" />
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_TASK_REDUCED" />
<!--Cache events -->
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT" />
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_READ" />
<util:constant
static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_REMOVED" />
</list>
</property>
<!-- set the cacheConfiguration property -->
<property name="cacheConfiguration">
<list>
<bean
class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="default" />
<property name="atomicityMode" value="ATOMIC" />
<property name="expiryPolicyFactory">
<bean parent="cacheExpiryPolicy" />
</property>
</bean>
</list>
</property>
</bean>
</beans>
Here is the example from the documentation:
<property name="cacheConfiguration">
<list>
<bean class="org.apache.ignite.configuration.CacheConfiguration">
<property name="name" value="cacheWithExpiryPolicy"/>
<property name="expiryPolicyFactory">
<bean class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf">
<constructor-arg>
<bean class="javax.cache.expiry.Duration">
<constructor-arg value="MINUTES"/>
<constructor-arg value="5"/>
</bean>
</constructor-arg>
</bean>
</property>
</bean>
</list>
</property>

Getting compile error while using <context:component-scan> annotation in spring xml

I am trying to annotation to auto-wire but getting compile error, I am not able to get the error message, there is only red cross at that line in spring XML. where I am doing wrong?
spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
https://www.springframework.org/schema/context/spring-context.xsd"
xmlns:context="http://www.springframework.org/schema/context/">
<!--commenting it out as we are using component annotation for this class-->
<!-- <bean id="circle" class="org.devesh.learning.spring.Circle">
</bean>
-->
<bean id ="pointA" class="org.devesh.learning.spring.Point">
<property name="x" value="${pointA.pointX}"></property>
<property name="y" value="${pointA.pointY}"></property>
</bean>
<bean id = "center" class="org.devesh.learning.spring.Point">
<property name="x" value="20"></property>
<property name="y" value="0"></property>
</bean>
<bean id = "pointC" class="org.devesh.learning.spring.Point">
<qualifier value="circle related"></qualifier>
<property name="x" value="-20"></property>
<property name="y" value="0"></property>
</bean>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations" value="pointconfig.properties"></property>
</bean>
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"></bean>
<context:component-scan base-package="org.devesh.learning.spring"/>
</beans>
Is it a possible typo?
as is:
xmlns:context="http://www.springframework.org/schema/context/
to be :
xmlns:context="http://www.springframework.org/schema/context

Spring social provider = ?error

When i click on /signIn/facebook button it redirect me to facebook page i authorize and then it redirect me to my redirectUrl but with parametr error=provider. What i do wrong? As far as i know it shoud redirect to SignInAdapter and to compare userIds or something like this. How can i debug these. Why it's not working. My signInController should to redirect me to the signup page isn't it? here is my configuration:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
default-lazy-init="true">
<bean id="connectionFactoryLocator"
class="org.springframework.social.connect.support.ConnectionFactoryRegistry">
<property name="connectionFactories">
<list>
<bean
class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
<constructor-arg value="${facebook.appId}" />
<constructor-arg value="${facebook.appSecret}" />
</bean>
</list>
</property>
</bean>
<bean id="usersConnectionRepository"
class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
<constructor-arg ref="dataSource" />
<constructor-arg ref="connectionFactoryLocator" />
<constructor-arg ref="textEncryptor" />
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/shop" />
<property name="username" value="root" />
<property name="password" value="root" />
</bean>
<bean id="connectionRepository" factory-method="createConnectionRepository"
factory-bean="usersConnectionRepository" scope="request">
<constructor-arg value="guest" />
<aop:scoped-proxy proxy-target-class="false" />
</bean>
<bean class="org.springframework.social.connect.web.ProviderSignInController">
<constructor-arg ref="simpleSignInAdapter" />
<property name="applicationUrl" value="${application.url}" />
<property name="signUpUrl" value="/signup" />
</bean>
<bean id="simpleSignInAdapter" class="com.social.SimpleSignInAdapter" />
<bean class="org.springframework.social.connect.web.ConnectController">
<!-- relies on by-type autowiring for the constructor-args -->
<property name="applicationUrl" value="${application.url}" />
</bean>
<bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
factory-method="noOpText" />
</beans>

How to enable TLS/SSL in java, Spring / CXF for Web Service?

I have a simple WebService defined in Spring config:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:wsa="http://cxf.apache.org/ws/addressing"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
xsi:schemaLocation="
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
http://cxf.apache.org/ws/rm/manager http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-*.xml" />
<bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
<bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
<bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
<property name="inInterceptors">
<list>
<ref bean="logInbound"/>
</list>
</property>
<property name="outInterceptors">
<list>
<ref bean="logOutbound"/>
</list>
</property>
<property name="outFaultInterceptors">
<list>
<ref bean="logOutbound"/>
</list>
</property>
<property name="inFaultInterceptors">
<list>
<ref bean="logInbound"/>
</list>
</property>
</bean>
<httpj:engine-factory bus="cxf">
<httpj:engine port="9001">
<httpj:threadingParameters minThreads="10" maxThreads="100" />
<httpj:connector>
<bean class="org.eclipse.jetty.server.bio.SocketConnector">
<property name="port" value="9001" />
</bean>
</httpj:connector>
<httpj:handlers>
<bean class="org.eclipse.jetty.server.handler.DefaultHandler" />
</httpj:handlers>
<httpj:sessionSupport>true</httpj:sessionSupport>
</httpj:engine>
</httpj:engine-factory>
<bean id="serviceFactory" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
scope="prototype">
<property name="serviceConfigurations">
<list>
<bean class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" />
<bean
class="org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration" />
<bean class="org.apache.cxf.service.factory.DefaultServiceConfiguration" />
</list>
</property>
</bean>
<bean id="eventWebService" class="org.myapp.EventWS">
<property name="timeout" value="${timeoutWS}" />
</bean>
<jaxws:endpoint id="event" implementor="#eventWebService"
address="${event.endpoint}">
<jaxws:serviceFactory>
<ref bean="serviceFactory" />
</jaxws:serviceFactory>
</jaxws:endpoint>
It works like a simple WS at event.endpoint=http://localhost:9001/event
But now, I want to secure that connection with TLS using server private key.
I know how to do this using SSLContext ( http://download.oracle.com/javase/6/docs/api/javax/net/ssl/SSLContext.html ), but Spring is something new to me.
I guess I need to create a new Endpoint with another configuration? Or use another ServiceFactory?
You must configure the engine factory with an SSL enabled connector. Maybe this helps:
http://docs.codehaus.org/display/JETTY/How+to+configure+SSL
I've managed to create a new engine with SSL
<httpj:engine port="9101">
<httpj:tlsServerParameters>
<sec:clientAuthentication want="true"
required="true" />
</httpj:tlsServerParameters>
<httpj:threadingParameters minThreads="10"
maxThreads="100" />
<httpj:connector>
<bean class="org.eclipse.jetty.server.ssl.SslSocketConnector">
<property name="port" value="9101" />
<property name="keystore" value= "./config/keystore-gateway" />
<property name="password" value= "pass" />
<property name="keyPassword" value= "pass" />
</bean>
</httpj:connector>
<httpj:handlers>
<bean class="org.eclipse.jetty.server.handler.DefaultHandler" />
</httpj:handlers>
<httpj:sessionSupport>true</httpj:sessionSupport>
</httpj:engine>
It works in browser with SSL.
How to enable mutual authentication now ?
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://cxf.apache.org/configuration/security"
xmlns:http="http://cxf.apache.org/transports/http/configuration"
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://cxf.apache.org/transports/http-jetty/configuration http://cxf.apache.org/schemas/configuration/http-jetty.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:property-placeholder location="classpath:override.properties" ignore-resource-not-found="true" properties-ref="defaultProperties"/>
<util:properties id="defaultProperties">
<prop key="keyManager.keystore">certs/localhost.jks</prop>
</util:properties>
<http:destination name="yourDestination" />
<httpj:engine-factory>
<httpj:engine port="yourPort">
<httpj:tlsServerParameters>
<sec:keyManagers keyPassword="password">
<sec:keyStore type="JKS" password="password" file="${keys.keystore}"/>
</sec:keyManagers>
<sec:trustManagers>
<sec:keyStore type="JKS" password="password" file="certs/keystore.jks"/>
</sec:trustManagers>
<sec:cipherSuitesFilter>
<!-- these filters ensure that a ciphersuite with
export-suitable or null encryption is used,
but exclude anonymous Diffie-Hellman key change as
this is vulnerable to man-in-the-middle attacks -->
<sec:include>.*_EXPORT_.*</sec:include>
<sec:include>.*_EXPORT1024_.*</sec:include>
<sec:include>.*_WITH_DES_.*</sec:include>
<sec:include>.*_WITH_DES40_.*</sec:include>
<sec:include>.*_WITH_AES_.*</sec:include>
<sec:exclude>.*_DH_anon_.*</sec:exclude>
</sec:cipherSuitesFilter>
<!-- ### HIL
<sec:clientAuthentication want="true" required="true"/>
### HIL ENDE -->
</httpj:tlsServerParameters>
</httpj:engine>
</httpj:engine-factory>
You need to have a keystore file such as shown on line 17. You also should have a properites file with the necessary credentials to validate against the keystore. (For a introduction into keystore and keystore authentication see here: http://en.wikipedia.org/wiki/Keystore)

WSDL file schema location can not be found

While trying to use soapUI I get the error message saying it fails to load the schema request.xsd
here is how my wsdl looks like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:schema="http://www.myweb/xml/webservice"
xmlns:tns="http://www.myweb.com/xml/webservice"
targetNamespace="http://www.myweb.com/xml/webservice">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.myweb.com/xml/webservice"
schemaLocation="/WEB-INF/schemas/Request.xsd"/>
</xsd:schema>
and here is how my spring config file is:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sws="http://www.springframework.org/schema/web-services"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<bean id="payloadMapping" class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
<property name="defaultEndpoint" ref="inferenceEndPoint" />
<property name="interceptors">
<list>
<ref local="validatingInterceptor" />
<ref local="payLoadInterceptor" />
</list>
</property>
</bean>
<bean id="payLoadInterceptor"
class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor" />
<bean id="validatingInterceptor"
class="org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor">
<description>
This interceptor validates the incoming
message contents
according to the 'Request.xsd' XML
Schema file.
</description>
<property name="schema" value="/WEB-INF/schemas/Request.xsd" />
<property name="validateRequest" value="true" />
<property name="validateResponse" value="false" />
</bean>
<bean id="mwsid" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
<constructor-arg value="/WEB-INF/spring-ws.wsdl"/>
</bean>
<bean id="inferenceEndPoint" class="com.mywebsite.ws.web.InferenceEndPoint">
<property name="messageService" ref="messageService" />
</bean>
<bean id="messageService" class="com.mywebsite.ws.service.MessageService">
<property name="inferenceService" ref="inferenceService" />
</bean>
<bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema">
<property name="xsd" value="/WEB-INF/schemas/Request.xsd" />
</bean>
<bean id="inferenceService" class="com.mywebsite.ws.im.InferenceService">
<property name="webServiceConfiguration" ref="playerConfiguration" />
</bean>
<!-- <bean id="inferenceConfig" class="com.mywebsite.ws.im.InferenceService">
<constructor-arg ref="playerConfiguration"/> </bean> -->
<!-- ~~~~~~~ Application beans ~~~~~~~ -->
<bean id="playerConfiguration"
class="com.mywebsite.ws.configuration.WebServiceConfiguration"
init-method="init">
<property name="playerConfigXml" value="/WEB-INF/config/webserviceconfiguration.xml" />
<property name="executingPathResource" value="/WEB-INF" />
<property name="developmentMode" value="true" />
</bean>
I'm assuming that you're creating a new soapUI project by picking the WSDL off the local disk. The tool is reading the file and baulks when it gets to /WEB-INF/schemas/Request.xsd as this path tells it to go to the root directory and look for a directory called WEB-INF. It would also be wise to ensure consistency when discussing case (the file says Request.xsd but your problem statement says request.xsd; this matters on some platforms.
Change the import in the WSDL to:
<xsd:import namespace="http://www.myweb.com/xml/webservice"
schemaLocation="schemas/Request.xsd"/>
This assumes the XSD is in the schemas directory relative to the WSDL.
Edit your configuration files and state the schema location in full path.

Categories

Resources