[JAX-WS]Paramètre d'un webservice
j'utilise actuellement l'api JAX-WS sur un serveur JBoss 4.2.2 GA pour générer et déployer des web services. Je voudrais savoir comment faire pour que lors de l'import de wsdl dans .net ou flex j'ai un appel de méthode avec mes paramètres et non le besoins de passer par un objet dans lequel j'initialise mes paramètres
ex :
Je ne veux pas ça
getMethode m = new getMethode();
m.arg0 = "";
m.arg1 = "";
service.getMethode(m);
mais ça
service.getMethode(arg0, arg1);
voilà mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| @Remote
@WebService(wsdlLocation="META-INF/Media.wsdl")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL, parameterStyle= SOAPBinding.ParameterStyle.WRAPPED)
public interface MediaService {
@WebMethod(operationName="saveTheme", action="urn:saveTheme")
public String saveTheme(String type, Long idUser, String name, String dsescription, Long idTheme, Long idParent, Integer publish, Long order);
@WebMethod(operationName="getTheme", action="urn:getTheme")
public String getTheme( @WebParam(name="login" )String login,
@WebParam(name="type" )String type,
@WebParam(name="idTheme" )String idTheme);
@WebMethod(operationName="getCard", action="urn:getCard")
public String getCard(String login, String type, Long id); |
WSDL
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
| <?xml version="1.0" encoding="UTF-8"?>
<definitions name="Media" targetNamespace="http://service.media.bo.priad.com/" xmlns:tns="http://service.media.bo.priad.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xs:schema targetNamespace="http://service.media.bo.priad.com/" version="1.0" xmlns:tns="http://service.media.bo.priad.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="getCard" type="tns:getCard"/>
<xs:element name="getCardResponse" type="tns:getCardResponse"/>
<xs:element name="getTheme" type="tns:getTheme"/>
<xs:element name="getThemeResponse" type="tns:getThemeResponse"/>
<xs:element name="saveTheme" type="tns:saveTheme"/>
<xs:element name="saveThemeResponse" type="tns:saveThemeResponse"/>
<xs:complexType name="saveTheme">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string"/>
<xs:element minOccurs="0" name="arg1" type="xs:long"/>
<xs:element minOccurs="0" name="arg2" type="xs:string"/>
<xs:element minOccurs="0" name="arg3" type="xs:string"/>
<xs:element minOccurs="0" name="arg4" type="xs:long"/>
<xs:element minOccurs="0" name="arg5" type="xs:long"/>
<xs:element minOccurs="0" name="arg6" type="xs:int"/>
<xs:element minOccurs="0" name="arg7" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="saveThemeResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getTheme">
<xs:sequence>
<xs:element minOccurs="0" name="login" type="xs:string"/>
<xs:element minOccurs="0" name="type" type="xs:string"/>
<xs:element minOccurs="0" name="idTheme" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getThemeResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getCard">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string"/>
<xs:element minOccurs="0" name="arg1" type="xs:string"/>
<xs:element minOccurs="0" name="arg2" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getCardResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name="MediaService_saveTheme">
<part name="saveTheme" element="tns:saveTheme">
</part>
</message>
<message name="MediaService_getCardResponse">
<part name="getCardResponse" element="tns:getCardResponse">
</part>
</message>
<message name="MediaService_saveThemeResponse">
<part name="saveThemeResponse" element="tns:saveThemeResponse">
</part>
</message>
<message name="MediaService_getCard">
<part name="getCard" element="tns:getCard">
</part>
</message>
<message name="MediaService_getTheme">
<part name="getTheme" element="tns:getTheme">
</part>
</message>
<message name="MediaService_getThemeResponse">
<part name="getThemeResponse" element="tns:getThemeResponse">
</part>
</message>
<portType name="MediaService">
<operation name="getCard" parameterOrder="getCard">
<input message="tns:MediaService_getCard">
</input>
<output message="tns:MediaService_getCardResponse">
</output>
</operation>
<operation name="getTheme" parameterOrder="getTheme">
<input message="tns:MediaService_getTheme">
</input>
<output message="tns:MediaService_getThemeResponse">
</output>
</operation>
<operation name="saveTheme" parameterOrder="saveTheme">
<input message="tns:MediaService_saveTheme">
</input>
<output message="tns:MediaService_saveThemeResponse">
</output>
</operation>
</portType>
<binding name="MediaServiceBinding" type="tns:MediaService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getCard">
<soap:operation soapAction="urn:getCard"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="getTheme">
<soap:operation soapAction="urn:getTheme"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="saveTheme">
<soap:operation soapAction="urn:saveTheme"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="Media">
<port name="MediaBeanPort" binding="tns:MediaServiceBinding">
<soap:address location="http://192.168.10.52:8080/Priad-ejb-0.0.1-SNAPSHOT/MediaBean"/>
</port>
</service>
</definitions> |