Ajuda com EJB3 e WEBSERVICE

olá a todos…to enroscado num erro do webservice que estou precisando implementar para o meu servico

estou usando o jboss 4.2.1,ejb3 para aplicação

bom vo postar o código da minha classe de teste e o cliente

HelloUserWs.java

package com.br.prt.implementacao;
import javax.ejb.*;
import javax.jws.*;

@Stateless
@WebService(serviceName="Greeter",portName="GreeterPort")
public class HelloUserWS{
	@WebMethod
	public String hello()
	{
		System.out.println("hello()Ws");
		return "Hello,World!!";
	}
}

arquivo do cliente

package com.br.prt.util;
import java.net.URL;
import javax.xml.ws.Service;
import javax.xml.namespace.QName;
import com.br.prt.implementacao.HelloUserWS;

public class ClientWebService {
	static String host="localhost";
	static String portType="helloUserWS";
	static String serviceName="Greeter";
	static String serviceEndPointAddress="http://"+host+":8080/"+serviceName;
	static String nameSpace="http://implementacao.prt.br.com";
	
	public static void main(String[] args){
		//http://127.0.0.1:8080/HelloUserWSService/HelloUserWS
			//URL wsdlLocation=new URL(serviceEndPointAddress+"/"+portType+"?WSDL");
			try{
				URL wsdlLocation=new URL("http://localhost:8080/HelloUserWSService/HelloUserWS?WSDL");	
				QName serviceNameQ=new QName(nameSpace,serviceName);
				Service service=Service.create(wsdlLocation,serviceNameQ);
				HelloUserWS a= service.getPort(HelloUserWS.class);
				System.out.println("1:"+a.hello());
			}
			catch(Exception e)
			{
				e.printStackTrace();
			}
			
	}
}

agora o maldito erro…

Cannot create Service instance, service {http://implementacao.prt.br.com:GreeterPort}Greeter not found in the WSDL http://localhost:8080/HelloUserWSService/HelloUserWS?WSDL
	at com.sun.xml.internal.ws.client.ServiceContextBuilder.build(ServiceContextBuilder.java:66)
	at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:125)
	at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:52)
	at javax.xml.ws.Service.<init>(Service.java:57)
	at javax.xml.ws.Service.create(Service.java:302)
	at com.br.prt.util.ClientWebService.main(ClientWebService.java:21)

e por ultimo meu WSDL

<definitions name="Greeter" targetNamespace="http://implementacao.prt.br.com/">
&#8722;
	<types>
&#8722;
	<xs:schema targetNamespace="http://implementacao.prt.br.com/" version="1.0">
<xs:element name="hello" type="tns:hello"/>
<xs:element name="helloResponse" type="tns:helloResponse"/>
<xs:complexType name="hello"/>
&#8722;
	<xs:complexType name="helloResponse">
&#8722;
	<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
&#8722;
	<message name="HelloUserWS_helloResponse">
<part element="tns:helloResponse" name="helloResponse"/>
</message>
&#8722;
	<message name="HelloUserWS_hello">
<part element="tns:hello" name="hello"/>
</message>
&#8722;
	<portType name="HelloUserWS">
&#8722;
	<operation name="hello" parameterOrder="hello">
<input message="tns:HelloUserWS_hello"/>
<output message="tns:HelloUserWS_helloResponse"/>
</operation>
</portType>
&#8722;
	<binding name="HelloUserWSBinding" type="tns:HelloUserWS">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
&#8722;
	<operation name="hello">
<soap:operation soapAction=""/>
&#8722;
	<input>
<soap:body use="literal"/>
</input>
&#8722;
	<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
&#8722;
	<service name="Greeter">
&#8722;
	<port binding="tns:HelloUserWSBinding" name="GreeterPort">
<soap:address location="http://127.0.0.1:8080/HelloUserWSService/HelloUserWS"/>
</port>
</service>
</definitions>

parece que está tudo ok no servidor …to dando furo em que?se puderem me ajudar …valeuz…abraços

boneazul,

Acredito que para funcionar o Web Services voce precisa implementar uma Interface nessa sua Classe.

public class MyWebService implements MyWebServiceInterface

E nesta sua interface vc precisa colocar as annotations @WebService e @Remote.

Tenta fazer isso e ve o q acontece…e posta aih os resultados…

[]'sss