doedje / jquery.soap

This script uses $.ajax to send a SOAP:Envelope. It can take XML DOM, XML string or JSON as input and the response can be returned as either XML DOM, XML string or JSON too.
352 stars 147 forks source link

the server doesn't work #96

Closed yuanlin-work closed 8 years ago

yuanlin-work commented 8 years ago

i had process the web service like this: `import javax.jws.*; import javax.xml.ws.Endpoint;

@WebService public class WebServiceAjax{

@WebMethod 
@WebResult  
public String say(@WebParam String name)
{

    System.out.println(name);
    return "hello "+name;

}

public static void main(String[] args)
{

    Endpoint.publish("http://localhost:9001/Service/WebServiceAjax", new WebServiceAjax());

    System.out.println("success");
}

}` and run the main method,and i can acccess the url 'http://localhost:9001/Service/WebServiceAjax?wsdl' who give me the right message,but when i use the query.soap.js to access the service,it give me some warns and make anything to happend,the warning message like this: may 08, 2016 13:54:58 com.sun.xml.internal.ws.transport.http.server.WSHttpHandler handleExchange warning: Cannot handle HTTP method: OPTIONS,and i don't know why

yuanlin-work commented 8 years ago

i had make it right by IE brower,but the chrome doesn't work anyway

doedje commented 8 years ago

Same origin policy, read the readme, it has some info on the matter. OPTIONS is part of CORS. Two options: 1) make server CORS compatible 2) use a proxy on http://localhost