I have a JAX-WS web service that is working fine when it gets called from any clients (i.e. Java destkop application) but not from JavaScript.
My WS interface looks like this:
@WebService
public interface LicenseService {
@WebMethod
String getLicense(
@WebParam(name="coupon") String coupon,
@WebParam(name="licenseCode") String licenseCode,
@WebParam(name="secret") String secret);
}
and I call it from javascript like this:
var request = new XMLHttpRequest();
request.open("POST", url, false);
request.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
request.send(envelope);
and the sent envelope
looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getLicense xmlns="http://ws.licenseman.elevelcbt.eu/">
<coupon>SYcj1J9I</coupon>
<licenseCode>BEPRO</licenseCode>
<secret>1234567890</secret>
</getLicense>
</soap:Body>
</soap:Envelope>
The method gets called (I can track on the Java side) but all passed parameters are null. There must be something wrong on my envelope
format/contents.