Announcement Announcement Module
Collapse
No announcement yet.
does any one have Spring-WS Tutorial working on JBoss 4.2.2.GA Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • does any one have Spring-WS Tutorial working on JBoss 4.2.2.GA

    I followed the tutorial, build the tutorial with maven which produced war file in the target directory, which I copied into JBoss default server's deploy directory.

    server console log:
    20:19:21,838 INFO [TomcatDeployer] undeploy, ctxPath=/tutorial, warUrl=.../tmp/deploy/tmp17824tutorial-exp.war/
    20:19:22,213 INFO [TomcatDeployer] deploy, ctxPath=/tutorial, warUrl=.../tmp/deploy/tmp17825tutorial-exp.war/
    now when trying to access the webservice with URL http://localhost/holidayService/holiday.wsdl

    modified port to match my JBoss port.
    <bean id="holiday" class="org.springframework.ws.wsdl.wsdl11.DynamicW sdl11Definition">
    <property name="builder">
    <bean class="org.springframework.ws.wsdl.wsdl11.builder. XsdBasedSoap11Wsdl4jDefinitionBuilder">
    <property name="schema" value="/WEB-INF/hr.xsd"/>
    <property name="portTypeName" value="HumanResource"/>
    <property name="locationUri" value="http://localhost/holidayService/"/>
    <property name="targetNamespace" value="http://mycompany.com/hr/definitions"/>
    </bean>
    </property>
    </bean>
    nothing happens in the console. but I got error in the browser

    HTTP Status 404 - /holidayService/holiday.wsdl

    type Status report

    message /holidayService/holiday.wsdl

    description The requested resource (/holidayService/holiday.wsdl) is not available.


    please help, trying hard to find out the requirements, limitations.
    -Praveen

    After copying
    resolver.jar
    saaj-api-1.3.jar
    saaj-impl-1.3.jar
    serializer.jar
    stax-api-1.0.1.jar
    xalan.jar
    xercesImpl.jar
    xml-apis.jar

    into endorsed directory I see surprisingly WSDL file with URL http://localhost/tutorial/holiday.wsdl, from eclipse web service explorer when invoking the service geting following error
    IWAB0379E Unable to open http://localhost:8080/tutorial/.
    IWAB0135E An unexpected error has occurred.
    WSDLException
    WSDLException: faultCode=OTHER_ERROR: Server returned HTTP response code: 405 for URL: http://localhost:8080/tutorial/


    every time I think getting closer to understanding how this work, only finding just scratching the surface.
    Last edited by pkbhavani; Mar 27th, 2008, 12:00 AM.

  • #2
    The http://localhost:8080/tutorial location gives back a 405, because that servlet is handling the SOAP POST requests (not GET request). Pointing your service explorer at the WSDL should work.

    You could also try running the embedded jetty from maven, by using jetty:run.

    Comment


    • #3
      same, nothing happens,
      with URL http://localhost:8080/holidayService/holiday.xml
      Here is the mvn jetty:run console output
      Maven version: 2.0.8
      Java version: 1.6.0_02
      OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

      C:\Software\Java\spring\spring-ws-1.0.3-full\spring-ws-1.0.3\samples\tutorial>mvn jetty:run
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'jetty'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Spring WS Holiday Service Tutorial
      [INFO] task-segment: [jetty:run]
      [INFO] ------------------------------------------------------------------------
      [INFO] Preparing jetty:run
      [INFO] [resources:resources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:compile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [resources:testResources]
      [INFO] Using default encoding to copy filtered resources.
      [INFO] [compiler:testCompile]
      [INFO] Nothing to compile - all classes are up to date
      [INFO] [jetty:run]
      [INFO] Configuring Jetty for project: Spring WS Holiday Service Tutorial
      [INFO] Webapp source directory = C:\Software\Java\spring\spring-ws-1.0.3-full\spring-ws-1.0.3\samples\tutorial\src\main\webapp
      [INFO] web.xml file = C:\Software\Java\spring\spring-ws-1.0.3-full\spring-ws-1.0.3\samples\tutorial\src\main\webapp\WEB-INF\web.xml
      [INFO] Classes = C:\Software\Java\spring\spring-ws-1.0.3-full\spring-ws-1.0.3\samples\tutorial\target\classes
      2008-03-27 08:54:00.229::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
      [INFO] Context path = /tutorial
      [INFO] Tmp directory = determined at runtime
      [INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
      [INFO] Web overrides = none
      [INFO] Webapp directory = C:\Software\Java\spring\spring-ws-1.0.3-full\spring-ws-1.0.3\samples\tutorial\src\main\webapp
      [INFO] Starting jetty 6.1.8 ...
      2008-03-27 08:54:01.306::INFO: jetty-6.1.8
      2008-03-27 08:54:01.413::INFO: No Transaction manager found - if your webapp requires one, please configure one.
      2008-03-27 08:54:01.628::INFO: Started [email protected]:8080
      [INFO] Started Jetty Server
      browser window
      http://localhost:8080/holidayService/holiday.xml

      HTTP ERROR: 404

      NOT_FOUND

      RequestURI=/holidayService/holiday.xml

      Powered by jetty://
      Last edited by pkbhavani; Mar 27th, 2008, 10:12 AM.

      Comment


      • #4
        can someone please answer, am I missing anything

        Comment


        • #5
          Changed the Spring-WS Tutorial spring-ws-servlet.xml file to following
          <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-2.0.xsd">

          <bean id="holidayEndpoint" class="com.mycompany.hr.ws.HolidayEndpoint">
          <constructor-arg ref="hrService"/>
          </bean>

          <bean id="hrService" class="com.mycompany.hr.service.StubHumanResourceS ervice"/>

          <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootQNameEndpointMapping">
          <property name="mappings">
          <props>
          <prop key="{http://mycompany.com/hr/schemas}HolidayRequest">holidayEndpoint</prop>
          </props>
          </property>
          <property name="interceptors">
          <bean class="org.springframework.ws.server.endpoint.inte rceptor.PayloadLoggingInterceptor"/>
          </property>
          </bean>

          <bean id="holiday" class="org.springframework.ws.wsdl.wsdl11.DynamicW sdl11Definition">
          <property name="builder">
          <bean class="org.springframework.ws.wsdl.wsdl11.builder. XsdBasedSoap11Wsdl4jDefinitionBuilder">
          <property name="schema" value="/WEB-INF/hr.xsd"/>
          <property name="portTypeName" value="HumanResource"/>
          <property name="locationUri" value="http://localhost:8080/tutorial/"/>
          <property name="targetNamespace" value="http://mycompany.com/hr/definitions"/>
          </bean>
          </property>
          </bean>


          <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMe ssageFactory">
          <property name="messageFactory">
          <bean class="com.sun.xml.messaging.saaj.soap.ver1_1.SOAP MessageFactory1_1Impl"></bean>
          </property>
          </bean>
          Jboss console output with URL http://localhost:8080/tutorial/holiday.wsdl. Using eclipse webservice explorer send the request ...

          15:42:18,672 INFO [STDOUT] 2008-03-27 15:42:18,672 DEBUG [org.springframework.ws.server.MessageTracing] - Received request [SaajSoapMessage {http:
          //mycompany.com/hr/schemas}HolidayRequest]
          15:42:18,672 INFO [STDOUT] 2008-03-27 15:42:18,672 DEBUG [org.springframework.ws.server.endpoint.mapping.Pay loadRootQNameEndpointMapping] - Lookin
          g up endpoint for [{http://mycompany.com/hr/schemas}HolidayRequest]
          15:42:18,672 INFO [STDOUT] 2008-03-27 15:42:18,672 DEBUG [org.springframework.ws.soap.server.SoapMessageDisp atcher] - Endpoint mapping [org.spring
          framework.ws.server.endpoint.mapping.PayloadRootQN ameEndpointMapping@1c3d029] maps request to endpoint [com.mycompany.hr.ws.HolidayEndpoint@dd67cf]

          15:42:18,672 INFO [STDOUT] 2008-03-27 15:42:18,672 DEBUG [org.springframework.ws.server.endpoint.interceptor .PayloadLoggingInterceptor] - Request:
          <q0:HolidayRequest xmlns:q0="http://mycompany.com/hr/schemas">
          <q0:Holiday>
          <q0:StartDate>2008-03-10</q0:StartDate>
          <q0:EndDate>2008-03-21</q0:EndDate>
          </q0:Holiday>
          <q0:Employee>
          <q0:Number>543543</q0:Number>
          <q0:FirstName>test</q0:FirstName>
          <q0:LastName>holiday</q0:LastName>
          </q0:Employee>
          </q0:HolidayRequest>
          15:42:18,672 INFO [STDOUT] 2008-03-27 15:42:18,672 DEBUG [org.springframework.ws.soap.server.SoapMessageDisp atcher] - Testing endpoint adapter [or
          g.springframework.ws.server.endpoint.adapter.Messa geEndpointAdapter@aa2594]
          15:42:18,688 INFO [STDOUT] 2008-03-27 15:42:18,688 DEBUG [org.springframework.ws.soap.server.SoapMessageDisp atcher] - Testing endpoint adapter [or
          g.springframework.ws.server.endpoint.adapter.Paylo adEndpointAdapter@1eacdc4]
          15:42:18,688 INFO [STDOUT] 2008-03-27 15:42:18,688 INFO [com.mycompany.hr.service.StubHumanResourceService] - Booking holiday for [Mon Mar 10 00:0
          0:00 CDT 2008-Fri Mar 21 00:00:00 CDT 2008] for [test holiday]
          15:42:18,688 INFO [STDOUT] 2008-03-27 15:42:18,688 DEBUG [org.springframework.ws.server.MessageTracing] - MessageDispatcher with name 'spring-ws'
          sends no response for request [SaajSoapMessage {http://mycompany.com/hr/schemas}HolidayRequest]
          15:42:18,688 INFO [STDOUT] 2008-03-27 15:42:18,688 DEBUG [org.springframework.ws.transport.http.MessageDispa tcherServlet] - Successfully completed
          request
          then worked, not sure if this is correct way to invoke service ?
          war file is tutorial.war dont know why the url in the tutorial is like http://localhost:8080/holidayService/ and why it is not working.
          Last edited by pkbhavani; Mar 27th, 2008, 05:07 PM.

          Comment


          • #6
            I got same problem! I don't know why I can't run tutorial sample. After I change holidayService to tutorial,
            It work fine. but I can not understand.
            Do you think tutorial is so bad? !!!

            Comment


            • #7
              Originally posted by quannv View Post
              I got same problem! I don't know why I can't run tutorial sample. After I change holidayService to tutorial,
              It work fine. but I can not understand.
              Do you think tutorial is so bad? !!!
              We will get good tutorial in 1.5.3 version. http://jira.springframework.org/browse/SWS-380

              Comment


              • #8
                Hi guys,

                This is a known issue which will be corrected in the next release. As a simple work-around, you could change the locationUri property to http://localhost:8080/tutorial/holidayService/

                Comment

                Working...
                X