質問

Spring 3.0.4.Releaseを備えたWSを作成して、Axis2を使用してTomcatで実行する必要があります。私はこのドキュメントをフォローしています: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/remoting.html#remoting-web-services-jaxws-export-ri (その段落を「doc」と呼ぶことができる場合)

わかりました、ここに詳細があります:

Javaクラス:

package foo;
@WebService(serviceName="MyService")
public class MyService{
  @WebMethod  
  public String getString(){
    return "Hello StackOverflow";
  }  
}  

Web-inf/spring-ws.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" xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://jax-ws.dev.java.net/spring/core https://jax-ws.dev.java.net/spring/core.xsd  
    http://jax-ws.dev.java.net/spring/servlet https://jax-ws.dev.java.net/spring/servlet.xsd">

  <wss:binding url="/myService" service="#myService" />

  <ws:service id="myService"
    impl="foo.MyService" />

</beans>

web-inf/web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="myService" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>my Service</display-name>
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring-ws.xml</param-value>
</context-param>
<!-- this is for Spring -->
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- these are for JAX-WS -->
<servlet>
    <servlet-name>jaxws-servlet</servlet-name>
    <servlet-class>com.sun.xml.ws.transport.http.servlet.WSSpringServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>jaxws-servlet</servlet-name>
    <url-pattern>/myService</url-pattern>
</servlet-mapping>

そして最後ですが、それほど重要ではありません エラーTomcat 6.0.29を開始します:

Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://jax-ws.dev.java.net/spring/servlet]
Offending resource: ServletContext resource [/WEB-INF/spring-ws.xml]  

誰かが何が起こっているのかという手がかりがありますか?すべての構成は正しいですか? Springを使用してWSを展開する方法を示すための単純な(動作)WSを持っている人はいますか?

前もって感謝します

役に立ちましたか?

解決

また、しばらく前にこの問題を経験し、「https://」に問題があることがわかりました。 http://に戻してください。ただし、http://を使用する場合、Eclipseはhttp://からhttps://にスキーマURLを自動的にリダイレクトできないため、Eclipseでスキーマ検証エラーを取得します。そして、どうやらnetbeansがそれができるようです。

もう一つ。 Xbeans-Springも必要です。正直に言って、それはかなり愚かな依存だと思います。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top