2012-12-05 17 views
8

मैं खुले ढांचे के लिए नया हूं (मैं जावा पर आधारित एक समाधान इंजीनियर हूं) और एक बनाने की कोशिश कर रहा हूं सीएक्सएफ परियोजना।जहां सीएक्सएफ/सीएक्सएफ.एक्सएमएल, सीएक्सएफ-एक्सटेंशन-साबैप.एक्सएमएल, सीएक्सएफ-सर्वलेट.एक्सएमएल

मैं समझता हूँ कि मैं की तरह

<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 
xmlns:cxf="http://cxf.apache.org/core" xmlns:jaxws="http://cxf.apache.org/jaxws" 
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
     http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.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/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd"> 

<import resource="classpath:META-INF/cxf/cxf.xml" /> 
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> 

<http-conf:conduit name="*.http-conduit"> 
    <http-conf:client ReceiveTimeout=“300000“ AllowChunking="false"/> 
</http-conf:conduit> 

<import resource="classpath:META-INF/cxf/cxf.xml" /> 
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> 

<cxf:bus> 
    <cxf:features> 
     <cxf:logging /> 
    </cxf:features> 
</cxf:bus> 

</beans> 
उस में

applicationContext.xml फ़ाइल और सामग्री कुछ है की जरूरत है।

अब मुझे आश्चर्य है कि मैं
cxf/cxf.xml, cxf-extension-soap.xml, cxf-servlet.xml फ़ाइलों को डाउनलोड कर सकता हूं।

या मैंने एक डायनामिक वेब प्रोजेक्ट बनाया है तो गलत है? क्या कुछ अन्य प्रोजेक्ट प्रकार स्वचालित रूप से उन फ़ाइलों को उत्पन्न करता है?

+0

या बुनियादी CFX वातावरण की स्थापना के लिए किसी भी गाइड में और अधिक जानकारी प्राप्त? लोग? –

उत्तर

3

इनमें से प्रत्येक फाइल सीएक्सएफ जार में पाई जा सकती है जिसे आपको अपनी परियोजना के साथ शामिल करने की आवश्यकता होगी।

cxf-servlet.xml

cxf.xml

cxf-extension-soap.xml

मैं हमेशा एक CXF परियोजना को ठीक और चालू करने के लिए सबसे तेज़ तरीका मिल गया है एक Maven मूलरूप उपयोग करने के लिए है।

+3

कई सीएक्सएफ जार हैं। उपयोगकर्ता जानना चाहता था कि कौन सा। –

7

मैं जानता हूँ कि यह एक पुरानी पोस्ट है, लेकिन यह दूसरों की मदद कर सकते हैं

cxf-extension-soap.xmlcxf-rt-binding-soap जार में है, लेकिन आप cxf-rt-frontend-jaxws

cxf-servlet.xml की आवश्यकता होगी cxf-rt-transports-http जार

cxf.xmlcxf-rt-core जार में है (जो उपरोक्त की एक पारस्परिक निर्भरता है)

इसलिए, यदि आप 0 शामिल करते हैं निर्भरता के रूप मेंऔर cxf-rt-transports-http (उदाहरण के लिए, मेवेन के साथ) आपकी परियोजना को सही तरीके से काम करना चाहिए।

2

या मैंने एक डायनामिक वेब प्रोजेक्ट बनाया है तो गलत है? क्या कुछ अन्य प्रोजेक्ट प्रकार स्वचालित रूप से उन फ़ाइलों को उत्पन्न करता है?

आपके द्वारा बनाए गए आम तौर पर सिर्फ META-INF निर्देशिका MANIFEST.MF कहा जाता है के तहत एक मैनिफ़ेस्ट फ़ाइल होगा युद्ध फ़ाइल। इस फ़ाइल में आपकी मेटा जानकारी है। मेरे लिए मेरे पास

Manifest-Version: 1.0 
Gradle-Version: 2.0-rc-2 
Created-By: 1.6.0_31 (Sun Microsystems Inc.) 
Version: 10.51 
Build: dev 
Build-Timestamp: 10/01/2015 12:53:32 
Build-User: athakur 
Build-Host: ATHAKUR 

यह निर्देशिका स्वचालित रूप से बनाई जाती है जब आप एक जार या युद्ध बनाने के लिए अपनी परियोजना बनाते हैं। इसमें अन्य विशेषताओं के साथ-साथ मुख्य श्रेणी [Refer this Q] भी हो सकती है।

अब आपके प्रश्न पर आ रहा है। कई पुस्तकालयों ने अपनी कॉन्फ़िगरेशन फ़ाइलों को संबंधित जार मेटा-आईएनएफ फ़ोल्डर में रखा है। यह सिर्फ एक और उदाहरण है और जिन जारों की आप तलाश कर रहे हैं वे सीएक्सएफ जार हैं।

enter image description here enter image description here

आप अपने build.gradle फ़ाइल

compile("org.apache.cxf:cxf-rt-frontend-jaxrs:3.1.3") 
compile("org.apache.cxf:cxf-rt-frontend-jaxws:3.1.3") 
compile("org.apache.cxf:cxf-rt-transports-http:3.1.3") 
0

web.xml इस

CXF

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>classpath:ApplicationContext-cxf.xml</param-value> 
</context-param> 

<listener> 
    <listener-class> 
     org.springframework.web.context.ContextLoaderListener 
    </listener-class> 
</listener> 

<servlet> 
    <servlet-name>CXFServlet</servlet-name> 
    <display-name>CXF Servlet</display-name> 
    <servlet-class> 
     org.apache.cxf.transport.servlet.CXFServlet 
    </servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 

<servlet-mapping> 
    <servlet-name>CXFServlet</servlet-name> 
    <url-pattern>/*</url-pattern> 
</servlet-mapping> 

की तरह हो सकता है: और मैं क्या खोज रहा हूँ cxf-rt-bindings-soap-3.1.7.jar अब है कि classpath:META-INF/cxf/cxf-extension-soap.xml

यह देख रहा है

के बाद एक काम ApplicationContext.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:jaxws="http://cxf.apache.org/jaxws" xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:cxf="http://cxf.apache.org/core" xmlns:task="http://www.springframework.org/schema/task" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xsi:schemaLocation="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 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd 
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd"> 


    <import resource="classpath:META-INF/cxf/cxf.xml"/> 
<import resource="classpath:META-INF/cxf/cxf-extension-xml.xml"/> 
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 

    <task:annotation-driven /> 

    <context:component-scan base-package="com.smoothexample"> 
     <context:include-filter type="annotation" 
      expression="org.springframework.stereotype.Service" /> 
     <context:include-filter type="annotation" 
      expression="org.springframework.stereotype.Component" /> 
     <context:include-filter type="annotation" 
      expression="org.springframework.stereotype.Repository" /> 
    </context:component-scan> 

    <context:annotation-config /> 
    <context:component-scan base-package="com.smoothexample" /> 


    <bean 
     class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor" /> 


<bean id="addressSoapService" class="com.smoothexample.cxf.soap.ws.impl.AddressSoapServiceImpl" /> 

    <jaxws:endpoint id="addressEndpointId" 
     implementorClass="com.smoothexample.cxf.soap.ws.impl.AddressSoapServiceImpl" 
     implementor="#addressSoapService" address="/addressSoapService"> 

    </jaxws:endpoint> 

</beans> 

सभी Maven निर्भरता के रूप में निम्नानुसार परिभाषित कर रहे हैं, जो CXF/cxf.xml, CXF-विस्तार-soap.xml, CXF-servlet.xml

के लिए जार भी शामिल है
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.lal.pro</groupId> 
    <artifactId>apache-cxf-soap-ws</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>apache-cxf-soap-ws Maven Webapp</name> 
    <url>http://maven.apache.org</url> 

    <properties> 
     <cxf.version>2.5.0</cxf.version> 

     <org.springframework.version>4.1.1.RELEASE</org.springframework.version> 

     <ch.qos.logback.version>1.1.3</ch.qos.logback.version> 
     <org.sl4j.version>1.7.12</org.sl4j.version> 
     <spring.ws.version>2.2.4.RELEASE</spring.ws.version> 
    </properties> 
    <dependencies> 

     <dependency> 
      <groupId>org.apache.cxf</groupId> 
      <artifactId>cxf-rt-frontend-jaxws</artifactId> 
      <version>${cxf.version}</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.cxf</groupId> 
      <artifactId>cxf-rt-transports-http</artifactId> 
      <version>${cxf.version}</version> 
     </dependency> 


     <dependency> 
      <groupId>javax.xml.bind</groupId> 
      <artifactId>jaxb-api</artifactId> 
      <version>2.1</version> 
     </dependency> 

    </dependencies> 
    <build> 
     <finalName>apache-cxf-soap-ws</finalName> 
    </build> 
</project> 

कृपया http://www.smoothexample.com/webservices/apache_cxf_soap_web_services.html

संबंधित मुद्दे