Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Tutorial

  1. #11
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    6

    Default Tutorial Help

    Thanks Arjen , i was able to finish the spring ws tutorial http://static.springframework.org/sp.../tutorial.html.

    Here are the steps i did for those who have the same problem.
    (“plugin … does not exist” error, maven could not download the files from the repo)

    1. removed the ${HOME}/.m2/repository
    2. edited my maven2 settings.xml, i added my proxy settings (wer using web proxy at the office)
    3. executed "maven install" with error:
    [ERROR] BUILD ERROR
    [INFO] Failed to resolve artifact.
    Missing:
    ----------
    1) javax.activation:activation:jar:1.0.2

    4. downloaded activation jar version 1.0.2 and manually installed it
    5. executed "maven install" again and the command created a new maven project

    I have a new question though: HOW could i IMPORT the genereated project to ECLIPSE IDE?

  2. #12
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Just run mvn eclipse:eclipse, that will create a project for you, which you can import into your workspace. See http://maven.apache.org/plugins/maven-eclipse-plugin/
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #13
    Join Date
    Nov 2007
    Posts
    2

    Default soapAction=""

    Hi There,

    After following
    http://static.springframework.org/sp.../tutorial.html
    and
    http://static.springframework.org/sp...tutorial2.html

    I managed to get http://localhost:8080/holidayService/holiday.wsdl generated. But inside the binding, soapAction=""
    Code:
    <?xml version="1.0" encoding="UTF-8" ?> 
    - <wsdl:definitions xmlns:schema="http://mycompany.com/hr/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://mycompany.com/hr/definitions" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://mycompany.com/hr/definitions">
    - <wsdl:types>
    - <xs:schema xmlns:hr="http://mycompany.com/hr/schemas" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://mycompany.com/hr/schemas">
    - <xs:element name="HolidayRequest">
    - <xs:complexType>
    - <xs:all>
      <xs:element name="Holiday" type="hr:HolidayType" /> 
      <xs:element name="Employee" type="hr:EmployeeType" /> 
      </xs:all>
      </xs:complexType>
      </xs:element>
    - <xs:complexType name="HolidayType">
    - <xs:sequence>
      <xs:element name="StartDate" type="xs:date" /> 
      <xs:element name="EndDate" type="xs:date" /> 
      </xs:sequence>
      </xs:complexType>
    - <xs:complexType name="EmployeeType">
    - <xs:sequence>
      <xs:element name="Number" type="xs:integer" /> 
      <xs:element name="FirstName" type="xs:string" /> 
      <xs:element name="LastName" type="xs:string" /> 
      </xs:sequence>
      </xs:complexType>
      </xs:schema>
      </wsdl:types>
    - <wsdl:message name="HolidayRequest">
      <wsdl:part element="schema:HolidayRequest" name="HolidayRequest" /> 
      </wsdl:message>
    - <wsdl:portType name="HumanResource">
    - <wsdl:operation name="Holiday">
      <wsdl:input message="tns:HolidayRequest" name="HolidayRequest" /> 
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:binding name="HumanResourceBinding" type="tns:HumanResource">
      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
    - <wsdl:operation name="Holiday">
      <soap:operation soapAction="" /> - <wsdl:input name="HolidayRequest">
      <soap:body use="literal" /> 
      </wsdl:input>
      </wsdl:operation>
      </wsdl:binding>
    - <wsdl:service name="HumanResourceService">
    - <wsdl:port binding="tns:HumanResourceBinding" name="HumanResourcePort">
      <soap:address location="http://localhost:8080/holidayService/" /> 
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>
    Here is the hr.xsd
    Code:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns:hr="http://mycompany.com/hr/schemas"
            elementFormDefault="qualified"
            targetNamespace="http://mycompany.com/hr/schemas">
        <xs:element name="HolidayRequest">
            <xs:complexType>
                <xs:all>
                    <xs:element name="Holiday" type="hr:HolidayType"/>
                    <xs:element name="Employee" type="hr:EmployeeType"/>
                </xs:all>
            </xs:complexType>
        </xs:element>
        <xs:complexType name="HolidayType">
            <xs:sequence>
                <xs:element name="StartDate" type="xs:date"/>
                <xs:element name="EndDate" type="xs:date"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="EmployeeType">
            <xs:sequence>
                <xs:element name="Number" type="xs:integer"/>
                <xs:element name="FirstName" type="xs:string"/>
                <xs:element name="LastName" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:schema>
    Here is the servlet xml
    Code:
    <?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 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
    
            <bean id="hrService" class="com.mycompany.hr.service.HumanResourceService"/>
    	
    	<bean id="holidayEndpoint" class="com.mycompany.hr.ws.HolidayEndpoint" init-method="init">
    	    <constructor-arg ref="hrService"/>
    	</bean>
    
    	<bean class="org.springframework.ws.server.endpoint.mapping.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.interceptor.PayloadLoggingInterceptor"/>
    	    </property>
    	</bean>
    	
    	<bean id="holiday" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">
    	    <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/holidayService/"/>
    	            <property name="targetNamespace" value="http://mycompany.com/hr/definitions"/>
    	        </bean>
    	    </property>
    	</bean>
    
    </beans>
    Any idea what could be missed?

    Thanks
    Last edited by jstone; Nov 19th, 2007 at 10:25 PM.

  4. #14
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    6

    Default re soap=""

    hey jstone,

    i have the same wsdl as you do and it is working just fine with me

    ....
    <soap:operation soapAction=""/>
    <wsdl:input name="HolidayRequest">
    <soap:body use="literal"/>
    </wsdl:input>
    ....
    have you tried testing it? log the name, age, date, etc and try using soapUI v1.7.6 as a sample client to consume your web service

    or are you referring to the sample wsdl that is in the tutorial?, then yes it is different and i dont know y it still works.

  5. #15
    Join Date
    Nov 2007
    Posts
    2

    Default

    Hey Opinioag,

    Thanks for the heads-up. Yeah, I was expecting
    <soap:operation soapAction="http://mycompany.com/RequestHoliday"/>
    to show up as being described in Chapter 3
    http://static.springframework.org/sp.../tutorial.html

    I tried soapUI and it works well with another sample code (echoservice) that I was playing around. But it seems to have type problem with "date" in holiday service. I fed in
    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://mycompany.com/hr/schemas">
       <soapenv:Header/>
       <soapenv:Body>
          <sch:HolidayRequest>
             <sch:Holiday>
                <sch:StartDate>2007-06-10</sch:StartDate>
                <sch:EndDate>2007-09-20</sch:EndDate>
             </sch:Holiday>
             <sch:Employee>
                <sch:Number>1</sch:Number>
                <sch:FirstName>Hi</sch:FirstName>
                <sch:LastName>There</sch:LastName>
             </sch:Employee>
          </sch:HolidayRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    And I saw the error in soapUI reads like
    Code:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
       <SOAP-ENV:Header/>
       <SOAP-ENV:Body>
          <SOAP-ENV:Fault>
             <faultcode>SOAP-ENV:Server</faultcode>
             <faultstring xml:lang="en">Unparseable date: ""</faultstring>      </SOAP-ENV:Fault>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Any idea how to fix it?

    Thanks in advance!

  6. #16
    Join Date
    Oct 2007
    Location
    Manila, Philippines
    Posts
    6

    Default jaxb2 problem

    Hey guys,

    I am trying the jaxb2 marshaller as shown in the tutorial http://static.springframework.org/sp.../html/oxm.html
    I have encountered this error when viewing the wsdl:

    org.springframework.beans.factory.CannotLoadBeanCl assException: Error loading class [org.springframework.oxm.jaxb.Jaxb2Marshaller] for bean with name 'jaxb2Marshaller' defined in ServletContext resource [/WEB-INF/spring-ws-servlet.xml]: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/oxm/mime/MimeMarshaller

    I need help and i dont understand the error.
    what is this MimeMarshaller? and where could i get it?


    Thanks,
    Alvin Opinion
    Software Developer
    Manila, Philippines

  7. #17
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    The MimeMarshaller is part of the spring-oxm module.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  8. #18
    Join Date
    Jan 2008
    Posts
    2

    Default

    Quote Originally Posted by Arjen Poutsma View Post
    I've finally had the time to finish writing the tutorial for Spring-WS. It starts at http://static.springframework.org/sp...tutorial1.html (old stuff), an continues at http://static.springframework.org/sp...tutorial2.html (new stuff).

    Let me know what you think!
    Hi Arjen,

    I can't access the link. It says:

    Not Found

    The requested URL /spring-ws/site/tutorial/tutorial2.html was not found on this server.

  9. #19
    Join Date
    Jan 2008
    Posts
    18

    Default

    Thanks Arjen.
    I was trying the example given in tutorial 1 with ant build file to create ear & deployed it to WAS6.
    When I'm accessing wsdl file from the localhost url, its giving me exception as:

    Error 404: SRVE0203E: Servlet [spring-ws]: org.springframework.ws.transport.http.MessageDispa tcherServlet was found, but is missing another required class. SRVE0206E: This error typically implies that the servlet was originally compiled with classes which cannot be located by the server. SRVE0187E: Check your classpath to ensure that all classes required by the servlet are present

    I read previous posts regarding similar issue. The above exception suggests to check the classpath. But the classpath for the deployed ear has spring related jars.

    Is there anything that I'm missing?

    Thanks,
    Sulabha

  10. #20

    Question ::confused::confused:


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •