0 Replies Latest reply on Feb 20, 2006 8:01 PM by Irfan Jaffery

    Error getting in Webservice Client

    Irfan Jaffery Newbie

      I am new to web service. I have successfullydeployed a webservice on jboss server which similar like provided on http://wiki.jboss.org/wiki/Wiki.jsp?page=WSServerEJB

      But while I am writing my client I am getting error:

      could not find service: {http://com.usfi.css.ejb.session.interfaces}TestEjbWSEndPoint in the specified WSDL file. The service names found were: {http://com.usfi.css.ejb.session.interfaces/}TestService

      Here is my webservice.xml:

      <webservices xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:impl="http://com.underworld.crimeportal/ws4ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd"
       version="1.1">
      
       <webservice-description>
       <webservice-description-name>TestEjbWSEndPoint</webservice-description-name>
       <wsdl-file>META-INF/wsdl/TestService.wsdl</wsdl-file>
       <jaxrpc-mapping-file>META-INF/Test_Mapping.xml</jaxrpc-mapping-file>
       <port-component>
       <port-component-name>TestService</port-component-name>
       <wsdl-port>TestWebSerice1Port</wsdl-port>
       <service-endpoint-interface>com.usfi.css.ejb.session.interfaces.TestWebSerice1</service-endpoint-interface>
       <service-impl-bean>
       <ejb-link>TestService</ejb-link>
       </service-impl-bean>
       </port-component>
       </webservice-description>
      </webservices>


      and mapping xml is:
      <?xml version="1.0" encoding="UTF-8"?>
      <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
       <package-mapping>
       <package-type>com.usfi.css.ejb.session.interfaces</package-type>
       <namespaceURI>
       http://com.usfi.css.ejb.session.interfaces/types
       </namespaceURI>
       </package-mapping>
       <package-mapping>
       <package-type>com.usfi.css.ejb.session.interfaces</package-type>
       <namespaceURI>
       http://com.usfi.css.ejb.session.interfaces/
       </namespaceURI>
       </package-mapping>
       <service-interface-mapping>
       <service-interface>
       com.usfi.css.ejb.session.interfaces.TestService
       </service-interface>
       <wsdl-service-name
       xmlns:serviceNS="http://com.usfi.css.ejb.session.interfaces/">
       serviceNS:TestService
       </wsdl-service-name>
       <port-mapping>
       <port-name>TestWebSerice1Port</port-name>
       <java-port-name>TestWebSerice1Port</java-port-name>
       </port-mapping>
       </service-interface-mapping>
       <service-endpoint-interface-mapping>
       <service-endpoint-interface>
       com.usfi.css.ejb.session.interfaces.TestWebSerice1
       </service-endpoint-interface>
       <wsdl-port-type
       xmlns:portTypeNS="http://com.usfi.css.ejb.session.interfaces/">
       portTypeNS:TestWebSerice1
       </wsdl-port-type>
       <wsdl-binding
       xmlns:bindingNS="http://com.usfi.css.ejb.session.interfaces/">
       bindingNS:TestWebSerice1Binding
       </wsdl-binding>
       <service-endpoint-method-mapping>
       <java-method-name>getTestName</java-method-name>
       <wsdl-operation>getTestName</wsdl-operation>
       <wsdl-return-value-mapping>
       <method-return-value>
       java.lang.String
       </method-return-value>
       <wsdl-message
       xmlns:wsdlMsgNS="http://com.usfi.css.ejb.session.interfaces/">
       wsdlMsgNS:TestWebSerice1_getTestNameResponse
       </wsdl-message>
       <wsdl-message-part-name>result</wsdl-message-part-name>
       </wsdl-return-value-mapping>
       </service-endpoint-method-mapping>
       </service-endpoint-interface-mapping>
      </java-wsdl-mapping>


      and I am calling it in my cliet like this:

      URL url = new URL("http://localhost:8080/css-ejb/TestService?wsdl");
       QName serviceName = new QName("http://com.usfi.css.ejb.session.interfaces", "TestEjbWSEndPoint");
      
      
       ServiceFactoryImpl factory = (ServiceFactoryImpl )ServiceFactory.newInstance();
       Service service = factory.createService(url,serviceName);
      
       TestWebSerice1 testWebSerice1 = (TestWebSerice1) service.getPort(TestWebSerice1.class);


      Any idea why it is happening?

      Cheers,

      Irfan Jaffery