| Цитата | 2. Операции эквивалент методов сервиса, т.е. пример 1.
|
т.е. получается что этот кусок wsdl:
| Код | <wsdl:operation name="GetDevelopmentPlan"> <wsdl:input wsaw:Action="http://dp.minregion.ru/ServiceDevelopmentPlan/GetDevelopmentPlan" name="RequestMessage" message="tns:RequestMessage"/> <wsdl:output wsaw:Action="http://dp.minregion.ru/ServiceDevelopmentPlan/GetDevelopmentPlanResponse" name="ResponseMessage" message="tns:ResponseMessage"/> </wsdl:operation>
|
грубо говоря будет выглядеть так:
| Код | public class Class{ public GetDevelopmentPlan() { } }
|
это понятно.
А это как понимать:
| Цитата | RequestMessage - класс, тоже должен быть, он тут возвращается сервисом.
|
Каждое сообщение в wsdl - это класс??? Так что ли?
| Код |
public class RequestMessage{ ... } public class RequestMessage_Headers{ ... }
|
Че то не то по моему вы, priam220, ответили, нет? ============================================== AntonSaburov, у вас имена сообщений и имена операций одинаковые я немного не понял Допустим есть такой wsdl (поменял имя сообщения с hello1 на meshello1):
| Код | <?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1 (branches/2.1-6728; 2011-02-03T14:14:58+0000) JAXWS-RI/2.2.3 JAXWS/2.2. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1 (branches/2.1-6728; 2011-02-03T14:14:58+0000) JAXWS-RI/2.2.3 JAXWS/2.2. --> <definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.javacourse.edu/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.javacourse.edu/" name="NewWebService"> <types> <xsd:schema> <xsd:import namespace="http://ws.javacourse.edu/" schemaLocation="http://gsru0015:8080/NewWebService/NewWebService?xsd=1" /> </xsd:schema> </types> <message name="meshello1"> <part name="parameters" element="tns:hello1" /> </message> <message name="hello1Response"> <part name="parameters" element="tns:hello1Response" /> </message> <message name="meshello2"> <part name="parameters" element="tns:hello2" /> </message> <message name="hello2Response"> <part name="parameters" element="tns:hello2Response" /> </message> <portType name="NewWebService"> <operation name="hello1"> <input wsam:Action="http://ws.javacourse.edu/NewWebService/hello1Request" message="tns:meshello1" /> <output wsam:Action="http://ws.javacourse.edu/NewWebService/hello1Response" message="tns:hello1Response" /> </operation> <operation name="hello2"> <input wsam:Action="http://ws.javacourse.edu/NewWebService/hello2Request" message="tns:meshello2" /> <output wsam:Action="http://ws.javacourse.edu/NewWebService/hello2Response" message="tns:hello2Response" /> </operation> </portType> <binding name="NewWebServicePortBinding" type="tns:NewWebService"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="hello1"> <soap:operation soapAction="" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> <operation name="hello2"> <soap:operation soapAction="" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> </binding> <service name="NewWebService"> <port name="NewWebServicePort" binding="tns:NewWebServicePortBinding"> <soap:address location="http://gsru0015:8080/NewWebService/NewWebService" /> </port> </service> </definitions>
|
тогда код для него будет такой(поменял имена методов)?
| Код | @WebService(serviceName = "NewWebService") @Stateless() public class NewWebService { /** This is a sample web service operation */ @WebMethod(operationName = "hello1") public String hello1(@WebParam(name = "name") String txt) { return "Hello " + txt + " !"; } @WebMethod(operationName = "hello2") public String hello2(@WebParam(name = "name") String txt) { return "Hello " + txt + " !"; } }
|
А запрос soap такой(ничего не менял)?
| Код | <?xml version="1.0" encoding="UTF-8"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Header/> <S:Body> <ns2:hello1 xmlns:ns2="http://ws.javacourse.edu/"> <name>12</name> </ns2:hello1> </S:Body> </S:Envelope>
|
Правильно?
И еще:
| Код | <S:Body> <ns2:hello1 xmlns:ns2="http://ws.javacourse.edu/">
|
Имя первого дочернего тега после body (в данном случае hello1) должно быть именем метода, ведь так? |