Commits

Hector Miuler Malpica Gallegos  committed f9f462a

ya funciona :D

  • Participants
  • Parent commits d35b8c5

Comments (0)

Files changed (8)

 target
+\.idea
+.*\.iml
 			<artifactId>spring-web</artifactId>
 			<version>3.1.2.RELEASE</version>
 		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-api</artifactId>
+			<version>1.6.6</version>
+		</dependency>
+		<dependency>
+			<groupId>ch.qos.logback</groupId>
+			<artifactId>logback-classic</artifactId>
+			<version>1.0.6</version>
+		</dependency>
 	</dependencies>
 
 	<build>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-compiler-plugin</artifactId>
 				<configuration>
-					<source>1.5</source>
-					<target>1.5</target>
+					<source>1.6</source>
+					<target>1.6</target>
 				</configuration>
 			</plugin>
 		</plugins>

File src/main/java/com/miuler/demo/cxf_spring/HelloWorld.java

 package com.miuler.demo.cxf_spring;
 
+import javax.jws.WebMethod;
 import javax.jws.WebService;
 
 
 @WebService
 public interface HelloWorld {
+
+	@WebMethod
     String sayHi(String text);
 }
 

File src/main/java/com/miuler/demo/cxf_spring/HelloWorld.wsdl

+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="HelloWorldService" targetNamespace="http://cxf_spring.demo.miuler.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://cxf_spring.demo.miuler.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+  <wsdl:types>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://cxf_spring.demo.miuler.com/" elementFormDefault="unqualified" targetNamespace="http://cxf_spring.demo.miuler.com/" version="1.0">
+<xs:element name="sayHi" type="tns:sayHi"/>
+<xs:element name="sayHiResponse" type="tns:sayHiResponse"/>
+<xs:complexType name="sayHi">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="arg0" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+<xs:complexType name="sayHiResponse">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="return" type="xs:string"/>
+    </xs:sequence>
+  </xs:complexType>
+</xs:schema>
+  </wsdl:types>
+  <wsdl:message name="sayHi">
+    <wsdl:part name="parameters" element="tns:sayHi">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="sayHiResponse">
+    <wsdl:part name="parameters" element="tns:sayHiResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="HelloWorld">
+    <wsdl:operation name="sayHi">
+      <wsdl:input name="sayHi" message="tns:sayHi">
+    </wsdl:input>
+      <wsdl:output name="sayHiResponse" message="tns:sayHiResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="HelloWorldServiceSoapBinding" type="tns:HelloWorld">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="sayHi">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="sayHi">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="sayHiResponse">
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="HelloWorldService">
+    <wsdl:port name="HelloWorldPort" binding="tns:HelloWorldServiceSoapBinding">
+      <!--<soap:address location="http://localhost:9090/HelloWorldPort"/>-->
+      <soap:address location="http://localhost:8080/cxf-spring/ws/HelloWorld"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

File src/main/java/com/miuler/demo/cxf_spring/HelloWorldImpl.java

-package com.miuler.demo.cxf_spring;
-
-import javax.jws.WebService;
-
-@WebService(endpointInterface = "com.miuler.demo.cxf_spring.HelloWorld")
-public class HelloWorldImpl implements HelloWorld {
-
-    public String sayHi(String text) {
-        return "Hello " + text;
-    }
-}
-

File src/main/java/com/miuler/demo/cxf_spring/HelloWorldWS.java

+package com.miuler.demo.cxf_spring;
+
+import javax.jws.WebService;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@WebService(endpointInterface = "com.miuler.demo.cxf_spring.HelloWorld",
+			serviceName="HelloWorldWS")
+public class HelloWorldWS implements HelloWorld {
+
+	private static final Logger log = LoggerFactory.getLogger(HelloWorldWS.class);
+
+	@Override
+    public String sayHi(String text) {
+		log.debug("Prueba 1");
+		log.info("Prueba 1");
+		log.warn("Prueba 1");
+        return "Hello " + text;
+    }
+}
+

File src/main/webapp/WEB-INF/beans.xml

 
 	<jaxws:endpoint 
 	  id="helloWorld" 
-	  implementor="com.miuler.demo.cxf_spring.HelloWorldImpl"
+	  implementor="com.miuler.demo.cxf_spring.HelloWorldWS"
 	  address="/HelloWorld" />
 	  
 </beans>

File src/main/webapp/WEB-INF/web.xml

 
 	<servlet-mapping>
 		<servlet-name>CXFServlet</servlet-name>
-		<url-pattern>/*</url-pattern>
+		<url-pattern>/ws/*</url-pattern>
 	</servlet-mapping>
 </web-app>