PDA

View Full Version : endpoint.publish



eclipse_my_edition
یک شنبه 19 خرداد 1387, 19:25 عصر
سلام من می خوام وب سرویس رو با استفاده از Endpoint.publish روی local host بگذارم ولی این پیغام رو بهم می ده

Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerExcept ion: runtime modeler error: Wrapper class service.jaxws.Add is not found. Have you run APT to generate them?
at com.sun.xml.internal.ws.model.RuntimeModeler.getCl ass(RuntimeModeler.java:256)
at com.sun.xml.internal.ws.model.RuntimeModeler.proce ssDocWrappedMethod(RuntimeModeler.java:567)
at com.sun.xml.internal.ws.model.RuntimeModeler.proce ssMethod(RuntimeModeler.java:514)
at com.sun.xml.internal.ws.model.RuntimeModeler.proce ssClass(RuntimeModeler.java:341)
at com.sun.xml.internal.ws.model.RuntimeModeler.build RuntimeModel(RuntimeModeler.java:227)
at com.sun.xml.internal.ws.server.EndpointFactory.cre ateSEIModel(EndpointFactory.java:308)
at com.sun.xml.internal.ws.server.EndpointFactory.cre ateEndpoint(EndpointFactory.java:174)
at com.sun.xml.internal.ws.api.server.WSEndpoint.crea te(WSEndpoint.java:420)
at com.sun.xml.internal.ws.api.server.WSEndpoint.crea te(WSEndpoint.java:439)
at com.sun.xml.internal.ws.transport.http.server.Endp ointImpl.createEndpoint(EndpointImpl.java:208)
at com.sun.xml.internal.ws.transport.http.server.Endp ointImpl.publish(EndpointImpl.java:138)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAnd PublishEndpoint(ProviderImpl.java:90)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at service.AddService.main(AddService.java:25)
Java Result: 1

چطور می تونم این کلاس Wrapper رو ایجاد کنم.
از wsgen هم استفاده کردم ولی باز به مشکل برخوردم. کسی می تونه کمکم کنه؟ حسابی گیر کردم.
اینم کد:
package service;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;

@WebService
public class AddService {

@WebMethod
public int add(

@WebParam(name = "value1") int value1,

@WebParam(name = "value2") int value2) {
return value1 + value2;
}

public static void main(String args[]) {
AddService addService = new AddService();
String address = args[0];
String port = args[1];
String url = "http://" + address + ":" + port + "/AddService";
Endpoint.publish(url, addService);
}
}
از netbeans استفاده می کنم.
ممنون

eclipse_my_edition
دوشنبه 20 خرداد 1387, 12:16 عصر
با استفاده از WSGEN تونستم حلش کنم. نحوه ی استفادم مشکل داشت.