读书人

jax-ws webservice有关问题

发布时间: 2012-05-20 16:03:12 作者: rapoo

jax-ws webservice问题
客户端发送的soap消息中只包含调用的方法名和参数信息,服务端如何判断调用哪个服务类来处理这次请求,请知道原理的给解释下,谢谢~

[解决办法]
你的wsdl不是已经对应好到相应的处理类了么
[解决办法]
具体我也不是很清楚,这里有文档解释:
http://www.w3.org/TR/wsdl
一般如果自己有架设webservice,对比着看下马上就清楚了,楼主要知道这个的目的是什么呢?一般用处不到啊

Types a container for data type definitions using some type system (such as XSD).
Message an abstract, typed definition of the data being communicated.
Operation an abstract description of an action supported by the service.
Port Typean abstract set of operations supported by one or more endpoints.
Binding a concrete protocol and data format specification for a particular port type.
Port a single endpoint defined as a combination of a binding and a network address.
Service a collection of related endpoints.




Example 1 SOAP 1.1 Request/Response via HTTP

<?xml version="1.0"?>
<definitions name="StockQuote"

targetNamespace="http://example.com/stockquote.wsdl"
xmlns:tns="http://example.com/stockquote.wsdl"
xmlns:xsd1="http://example.com/stockquote.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/">

<types>
<schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema">
<element name="TradePriceRequest">
<complexType>
<all>
<element name="tickerSymbol" type="string"/>
</all>
</complexType>
</element>
<element name="TradePrice">
<complexType>
<all>
<element name="price" type="float"/>
</all>
</complexType>
</element>
</schema>
</types>

<message name="GetLastTradePriceInput">
<part name="body" element="xsd1:TradePriceRequest"/>
</message>

<message name="GetLastTradePriceOutput">
<part name="body" element="xsd1:TradePrice"/>
</message>

<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/>
<output message="tns:GetLastTradePriceOutput"/>
</operation>
</portType>

<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="GetLastTradePrice">
<soap:operation soapAction="http://example.com/GetLastTradePrice"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>

<service name="StockQuoteService">
<documentation>My first service</documentation>
<port name="StockQuotePort" binding="tns:StockQuoteBinding">
<soap:address location="http://example.com/stockquote"/>


</port>
</service>

</definitions>


[解决办法]
好好看下WSDL的相关文档,我觉得不需要服务端做具体判断调用哪个服务类,因为这些接口和参数本身是透明的,服务端不是已经做好对应了吗,还需要做什么判断吗?

读书人网 >J2EE开发

热点推荐