[jboss-user] [JBossWS] - Re: Help: how to consume webservice in ejb3 ?

michea do-not-reply at jboss.com
Sun Feb 18 20:26:22 EST 2007


"thomas.diesler at jboss.com" wrote : @WebServiceRef is supported in jbossws-1.2.0

Doesn't work better with the annotation.

Here is the ejb

  | 
  | @Stateless()
  | @WebService()
  | public class jbossWebService {
  |     @WebServiceRef()
  |     org.manaty.mvno.webservice.SimuCRMBeanService simuCRMBeanService;
  |     
  |     @WebMethod
  |     public String identProxy(@WebParam(name = "login") String login, @WebParam(name = "password") String password) {
  |      String result="pb";
  |        org.manaty.mvno.webservice.SimuCRMBeanLocal _simuCRMBeanPort = simuCRMBeanService.getSimuCRMBeanPort();
  |        result =  _simuCRMBeanPort.identification(login,password);
  |     return result;
  |  }
  | 

the webservice called works perfectly well, it is another EJB endpoint on the same server.

I successfully used wscompile ant task to generate the artifacts 


  |    <wsconsume fork="true" verbose="true" destdir="build/jar" sourcedestdir="src/java"
  |        keep="true" debug="true"  package="org.manaty.mvno.webservice" wsdl="http://127.0.0.1:8080/simuCRMBilling/simuCRMBean?wsdl"  >
  |     </wsconsume>
  | 

and the wsdl is quite simple


  | ?
  | 	<definitions name="simuCRMBeanService" targetNamespace="http://simu.mvno.manaty.org/">
  | ?
  | 	<types>
  | ?
  | 	<xs:schema targetNamespace="http://simu.mvno.manaty.org/" version="1.0">
  | <xs:element name="changePassword" type="tns:changePassword"/>
  | <xs:element name="changePasswordResponse" type="tns:changePasswordResponse"/>
  | <xs:element name="customerInfo" type="tns:customerInfo"/>
  | <xs:element name="customerInfoResponse" type="tns:customerInfoResponse"/>
  | <xs:element name="identification" type="tns:identification"/>
  | <xs:element name="identificationResponse" type="tns:identificationResponse"/>
  | <xs:element name="orderList" type="tns:orderList"/>
  | <xs:element name="orderListResponse" type="tns:orderListResponse"/>
  | <xs:element name="subscriptionInfo" type="tns:subscriptionInfo"/>
  | <xs:element name="subscriptionInfoResponse" type="tns:subscriptionInfoResponse"/>
  | <xs:element name="subscriptionList" type="tns:subscriptionList"/>
  | <xs:element name="subscriptionListResponse" type="tns:subscriptionListResponse"/>
  | ?
  | 	<xs:complexType name="subscriptionList">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="login" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="subscriptionListResponse">
  | ?
  | 	<xs:sequence>
  | <xs:element maxOccurs="unbounded" minOccurs="0" name="subscriptions" type="tns:subscriptionListObject"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="subscriptionListObject">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="offer" type="xs:string"/>
  | <xs:element minOccurs="0" name="subScriptionNumber" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="identification">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="login" type="xs:string"/>
  | <xs:element minOccurs="0" name="password" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="identificationResponse">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="return" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="customerInfo">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="login" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="customerInfoResponse">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="return" type="tns:customerInfoObject"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="customerInfoObject">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="address1" type="xs:string"/>
  | <xs:element minOccurs="0" name="address2" type="xs:string"/>
  | <xs:element minOccurs="0" name="address3" type="xs:string"/>
  | <xs:element minOccurs="0" name="address4" type="xs:string"/>
  | <xs:element minOccurs="0" name="city" type="xs:string"/>
  | <xs:element minOccurs="0" name="customerNumber" type="xs:string"/>
  | <xs:element minOccurs="0" name="firstname" type="xs:string"/>
  | <xs:element minOccurs="0" name="lastname" type="xs:string"/>
  | <xs:element minOccurs="0" name="postalCode" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="subscriptionInfo">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="login" type="xs:string"/>
  | <xs:element minOccurs="0" name="subscriptionNumber" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="subscriptionInfoResponse">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="return" type="tns:subscriptionInfoObject"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="subscriptionInfoObject">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="contractDuration" type="xs:string"/>
  | <xs:element minOccurs="0" name="offerType" type="xs:string"/>
  | <xs:element maxOccurs="unbounded" minOccurs="0" name="options" nillable="true" type="tns:option"/>
  | <xs:element maxOccurs="unbounded" minOccurs="0" name="plans" nillable="true" type="tns:plan"/>
  | <xs:element minOccurs="0" name="price" type="xs:string"/>
  | <xs:element maxOccurs="unbounded" minOccurs="0" name="services" nillable="true" type="tns:service"/>
  | <xs:element minOccurs="0" name="totalMonthlyPrice" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="option">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="description" type="xs:string"/>
  | <xs:element minOccurs="0" name="monthlyPrice" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="plan">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="description" type="xs:string"/>
  | <xs:element minOccurs="0" name="monthlyPrice" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="service">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="description" type="xs:string"/>
  | <xs:element minOccurs="0" name="monthlyPrice" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="orderList">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="login" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="orderListResponse">
  | ?
  | 	<xs:sequence>
  | <xs:element maxOccurs="unbounded" minOccurs="0" name="return" type="tns:orderObject"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="orderObject">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="date" type="xs:string"/>
  | <xs:element minOccurs="0" name="orderDate" type="xs:string"/>
  | <xs:element minOccurs="0" name="orderNumber" type="xs:string"/>
  | <xs:element minOccurs="0" name="status" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="changePassword">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="login" type="xs:string"/>
  | <xs:element minOccurs="0" name="oldPassword" type="xs:string"/>
  | <xs:element minOccurs="0" name="newPassword" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | ?
  | 	<xs:complexType name="changePasswordResponse">
  | ?
  | 	<xs:sequence>
  | <xs:element minOccurs="0" name="return" type="xs:string"/>
  | </xs:sequence>
  | </xs:complexType>
  | </xs:schema>
  | </types>
  | ?
  | 	<message name="SimuCRMBeanLocal_identificationResponse">
  | <part element="tns:identificationResponse" name="identificationResponse"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_customerInfoResponse">
  | <part element="tns:customerInfoResponse" name="customerInfoResponse"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_subscriptionInfoResponse">
  | <part element="tns:subscriptionInfoResponse" name="subscriptionInfoResponse"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_subscriptionList">
  | <part element="tns:subscriptionList" name="subscriptionList"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_changePasswordResponse">
  | <part element="tns:changePasswordResponse" name="changePasswordResponse"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_changePassword">
  | <part element="tns:changePassword" name="changePassword"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_subscriptionListResponse">
  | <part element="tns:subscriptionListResponse" name="subscriptionListResponse"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_identification">
  | <part element="tns:identification" name="identification"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_orderListResponse">
  | <part element="tns:orderListResponse" name="orderListResponse"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_orderList">
  | <part element="tns:orderList" name="orderList"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_customerInfo">
  | <part element="tns:customerInfo" name="customerInfo"/>
  | </message>
  | ?
  | 	<message name="SimuCRMBeanLocal_subscriptionInfo">
  | <part element="tns:subscriptionInfo" name="subscriptionInfo"/>
  | </message>
  | ?
  | 	<portType name="SimuCRMBeanLocal">
  | ?
  | 	<operation name="changePassword" parameterOrder="changePassword">
  | <input message="tns:SimuCRMBeanLocal_changePassword"/>
  | <output message="tns:SimuCRMBeanLocal_changePasswordResponse"/>
  | </operation>
  | ?
  | 	<operation name="customerInfo" parameterOrder="customerInfo">
  | <input message="tns:SimuCRMBeanLocal_customerInfo"/>
  | <output message="tns:SimuCRMBeanLocal_customerInfoResponse"/>
  | </operation>
  | ?
  | 	<operation name="identification" parameterOrder="identification">
  | <input message="tns:SimuCRMBeanLocal_identification"/>
  | <output message="tns:SimuCRMBeanLocal_identificationResponse"/>
  | </operation>
  | ?
  | 	<operation name="orderList" parameterOrder="orderList">
  | <input message="tns:SimuCRMBeanLocal_orderList"/>
  | <output message="tns:SimuCRMBeanLocal_orderListResponse"/>
  | </operation>
  | ?
  | 	<operation name="subscriptionInfo" parameterOrder="subscriptionInfo">
  | <input message="tns:SimuCRMBeanLocal_subscriptionInfo"/>
  | <output message="tns:SimuCRMBeanLocal_subscriptionInfoResponse"/>
  | </operation>
  | ?
  | 	<operation name="subscriptionList" parameterOrder="subscriptionList">
  | <input message="tns:SimuCRMBeanLocal_subscriptionList"/>
  | <output message="tns:SimuCRMBeanLocal_subscriptionListResponse"/>
  | </operation>
  | </portType>
  | ?
  | 	<binding name="SimuCRMBeanLocalBinding" type="tns:SimuCRMBeanLocal">
  | <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  | ?
  | 	<operation name="changePassword">
  | <soap:operation soapAction=""/>
  | ?
  | 	<input>
  | <soap:body use="literal"/>
  | </input>
  | ?
  | 	<output>
  | <soap:body use="literal"/>
  | </output>
  | </operation>
  | ?
  | 	<operation name="customerInfo">
  | <soap:operation soapAction=""/>
  | ?
  | 	<input>
  | <soap:body use="literal"/>
  | </input>
  | ?
  | 	<output>
  | <soap:body use="literal"/>
  | </output>
  | </operation>
  | ?
  | 	<operation name="identification">
  | <soap:operation soapAction=""/>
  | ?
  | 	<input>
  | <soap:body use="literal"/>
  | </input>
  | ?
  | 	<output>
  | <soap:body use="literal"/>
  | </output>
  | </operation>
  | ?
  | 	<operation name="orderList">
  | <soap:operation soapAction=""/>
  | ?
  | 	<input>
  | <soap:body use="literal"/>
  | </input>
  | ?
  | 	<output>
  | <soap:body use="literal"/>
  | </output>
  | </operation>
  | ?
  | 	<operation name="subscriptionInfo">
  | <soap:operation soapAction=""/>
  | ?
  | 	<input>
  | <soap:body use="literal"/>
  | </input>
  | ?
  | 	<output>
  | <soap:body use="literal"/>
  | </output>
  | </operation>
  | ?
  | 	<operation name="subscriptionList">
  | <soap:operation soapAction=""/>
  | ?
  | 	<input>
  | <soap:body use="literal"/>
  | </input>
  | ?
  | 	<output>
  | <soap:body use="literal"/>
  | </output>
  | </operation>
  | </binding>
  | ?
  | 	<service name="simuCRMBeanService">
  | ?
  | 	<port binding="tns:SimuCRMBeanLocalBinding" name="simuCRMBeanPort">
  | <soap:address location="http://DIVIOSOFT:8080/simuCRMBilling/simuCRMBean"/>
  | </port>
  | </service>
  | </definitions>
  | 

As for JAXRPC this is not possible to use it as for other WS in the same application I have a complex binding that require jaxb2.

I would be grateful of any hint or example

Sebastien

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018641#4018641

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018641



More information about the jboss-user mailing list