का उत्पादन नहीं कर रहा है, मैं मेवेन प्लगइन का उपयोग करके WADL का उत्पादन करने की कोशिश कर रहा हूं। परियोजना बनाता है और सेवा काम करता है। यहाँ प्लगइन के साथ पोम का हिस्सा है:मेवेन WADL प्लगइन एक प्रयोग योग्य WADL
<plugin>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>maven-wadl-plugin</artifactId>
<version>1.19.2</version>
<executions>
<execution>
<id>generate</id>
<goals>
<goal>generate</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<wadlFile>${basedir}/src/main/docs/ThingREST.wadl</wadlFile>
<formatWadlFile>true</formatWadlFile>
<baseUri>http://localhost:8080/ThingREST</baseUri>
<packagesResourceConfig>
<param>samp.rest.ws.controller</param>
</packagesResourceConfig>
<wadlGenerators>
<wadlGeneratorDescription>
<className>com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc
</className>
<properties>
<property>
<name>applicationDocsFile</name>
<value>${basedir}/src/main/docs/xml/app-wadl-doc.xml</value>
</property>
</properties>
</wadlGeneratorDescription>
<wadlGeneratorDescription>
<className>com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport
</className>
<properties>
<property>
<name>grammarsFile</name>
<value>${basedir}/src/main/docs/xml/app-wadl-grammar.xml</value>
</property>
</properties>
</wadlGeneratorDescription>
</wadlGenerators>
</configuration>
</plugin>
applicationDocFile और grammarFile मौजूद हैं, लेकिन वे किसी भी महत्वपूर्ण जानकारी शामिल नहीं है। मुझे यकीन नहीं है कि क्या शामिल करना है।
package samp.rest.ws.controller;
import java.util.List;
import samp.rest.ws.ThingDB;
import samp.rest.ws.vo.Thing;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
*
* @author Grayson
*/
@RestController
public class ThingController {
@RequestMapping(value = "/things", method = RequestMethod.GET, headers = "Accept=application/json") //produces = "application/json")
public List<Thing> getThings() {
return ThingDB.getThings();
}
@RequestMapping(value = "/thing/{id}", method = RequestMethod.GET, headers = "Accept=application/json")
public Thing getThingById(@PathVariable int id) {
return ThingDB.getThing(id);
}
@RequestMapping(value = "/thingy/{id}", method = RequestMethod.GET)
public String getThingy(@PathVariable int id) {
return ThingDB.getThing(id).toString();
}
@RequestMapping(value = "/addthing", method = RequestMethod.PUT) //, headers = "Accept=application/json")
public void addThing(@RequestBody Thing thing) {
ThingDB.addThing(thing);
List<Thing> lt = ThingDB.getThings();
for (Thing t : lt) {
System.out.println(" Post add: " + t.toString());
}
}
}
अंत में, यहाँ WADL उत्पादित है:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://wadl.dev.java.net/2009/02">
<doc
jersey:generatedBy="Jersey: 1.19.2 08/25/2016 12:00 AM"
xmlns:jersey="http://jersey.java.net/"/>
<doc
title="Maven Spring REST Sample WADL"
xml:lang="en"><![CDATA[
This is the Web Application Description Language (WADL) for
a Maven Spring REST Service. This service is intended to serve as
a workign model/sample.
]]></doc>
<grammars/>
<resources base="http://localhost:8080/ThingREST"/>
</application>
मैं उपलब्ध सेवा कॉल शामिल करने के लिए और भी इनपुट प्रकारों की पहचान WADL उम्मीद कर रहा हूँ
यहाँ नियंत्रक है। जाहिर है, मुझे यह नहीं मिल रहा है।
मैंने इस प्लगइन का उपयोग करने के लिए उदाहरण और दस्तावेज़ीकरण के लिए उच्च और निम्न खोज की है। किसी भी और सभी की मदद की बहुत सराहना की जाएगी। अफसोस की बात है, जो दस्तावेज/उदाहरण मौजूद हैं, वे पुराने लगते हैं।
अग्रिम धन्यवाद।
यह वसंत बाकी की तरह नहीं दिखता संदर्भ के लिए, आप वेब सेवा के रूप में इस जनरेटर देख सकते हैं मॉड्यूल समर्थन WADL पीढ़ी, देखें [एसपीआर -8705] (https://jira.spring.io/browse/SPR-8705)। – Tunaki
@ टुनकी - धन्यवाद। इनपुट के लिए – Grayson