J'ai un service Web JAX-WS en cours d'exécution qui comporte déjà des points de terminaison fonctionnels. Maintenant j'ai le problème suivant:Recherche d'une raison pour laquelle l'une de ces deux requêtes SOAP ne fonctionne pas (java.lang.IllegalArgumentException)
J'ai deux demandes SOAP différentes ici et je ne comprends pas pourquoi le premier fonctionne mais pas le second. La seule différence évidente dans les requêtes est que la première spécifie un espace de noms dans la balise <Envelope>
alors que la seconde le spécifie lors de l'appel de la méthode <getMoldDataHistory>
.
demande SOAP 1 - ne fonctionne pas (namespace est spécifié à l'appel de méthode)
<s:Envelope
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
>
<s:Body
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<getMoldDataHistory
xmlns="http://history.production.soap.webservices.product.company.at/">
<machineId>92623-15853588</machineId>
<start>0</start>
<end>0</end>
</getMoldDataHistory>
</s:Body>
</s:Envelope>
demande SOAP 2 - travail (namespace est spécifié dans la balise <Envelope>
)
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:his="http://history.production.soap.webservices.product.company.at/">
<soapenv:Header/>
<soapenv:Body>
<his:getMoldDataHistory>
<machineId>92623-15853588</machineId>
<start>0</start>
<end>0</end>
</his:getMoldDataHistory>
</soapenv:Body>
</soapenv:Envelope>
Le message d'erreur SOAP que je reçois lors de la première demande (ne fonctionne pas).
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
<faultcode>S:Server</faultcode>
<faultstring>java.lang.IllegalArgumentException</faultstring>
</S:Fault>
</S:Body>
</S:Envelope>
Le stacktrace de l'exception lancée à partir du serveur lors de la réception de la première requête SOAP.
java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.Trampoline.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.xml.internal.ws.api.server.MethodUtil.invoke(Unknown Source)
at com.sun.xml.internal.ws.api.server.InstanceResolver$1.invoke(Unknown Source)
at com.sun.xml.internal.ws.server.InvokerTube$2.invoke(Unknown Source)
at com.sun.xml.internal.ws.server.sei.EndpointMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.server.sei.SEIInvokerTube.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.server.WSEndpointImpl$2.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.HttpAdapter$HttpToolkit.handle(Unknown Source)
at com.sun.xml.internal.ws.transport.http.HttpAdapter.handle(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExchange(Unknown Source)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
at com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
at sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
J'essaie essentiellement de comprendre pourquoi la première demande ne fonctionne pas bien que ce soit une requête SOAP valide. Y a-t-il quelque chose que je dois configurer sur mon serveur pour permettre de telles demandes?
EDIT:
Après avoir fait quelques tests plus j'ai découvert que la position de la déclaration d'espace de noms ne compte pas si la méthode que j'appelle a 0 paramètres. Dès que le paramètre est requis, il cesse de fonctionner.
EDIT 2:
Maintenant, je stumpled sur this thread here. J'ai le même problème. Mon client C# qui effectue les demandes n'utilise pas l'espace de noms dans la méthode TAG. Après l'avoir ajouté, ça fonctionne.
Encore comment puis-je dire à JAX-WS de gérer cela.
ne fonctionne pas:
<getMoldDataHistory xmlns="http://history.production.soap.webservices.product.company.at/">
Travaux:
<his:getMoldDataHistory xmlns:his="http://history.production.soap.webservices.product.company.at/">
Merci beaucoup d'avoir signalé cela. Je n'étais pas au courant de ça! – Markus