开发者

Does Spring 3.0 provides a service definition file?

I'm wondering about Spring 3.0 whether 开发者_如何学Goit provides an automatically generated service definition page after I defined services.

With SOAP we have a WSDL file which contains WHAT, HOW and WHERE we can call a service.

Is that possible with Spring 3.0 or not?


Yes it does. Just add "?WSDL" to the URL of your Spring-generated web service and you'll get the definition. Also you can append "?xsd=1" instead and you'll get the schema you need (this is referenced also from the WSDL).


You can use an MBeanExporter to expose all of your services via JMX, which would be viewable through a JMX dashboard on your container (IE Tomcat, Jboss, etc). This is an easy way to account for 'what is deployed'. Your question is not entirely clear what sort of artifact you're looking for though.

<bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
     <property name="autodetect" value="true"/>
</bean>

Will automatically export all of your defined beans as MBeans. Usually that's not entirely what you want, so alternatively, you'll specify them manually.

 <bean id="exporter" class="org.springframework.jmx.export.MBeanExporter">
    <property name="beans">
       <map>
         <entry key="bean:name=testBean1" value-ref="testBean"/>
       </map>
    </property>
 </bean>


I agree with Chochos.

These[?wsdl, ?xsd=N] are universal standard to find the service definition file and any Datacontract defined in the wsdl.

example:

if http://localhost:8080/MyService is your service endpoint then it is service container's responsibility to make the WSDl available at http://localhost:8080/MyService, by default.


The answer is Yes,

Use tag in your message dispatcher spring context file.

if your message dispatcher bean id is spring-ws then the spring context file for it would be spring-ws-servlet.xml.

In that context file,

import the namespace http://www.springframework.org/schema/web-services/web-services-2.0.xsd

xmlns:sws="http://www.springframework.org/schema/web-services".

then use the tag dynamic-wsdl from this namespace.

Also, you can set attributes for it like portType, binding and id. This will generate the wsdl file for you. You can view it by querying for it in the browser

/.wsdl

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜