web services - Trying to find out why one of those two SOAP requests does not work (java.lang.IllegalArgumentException) -
i have running jax-ws webservice has working endpoints. i'm having following issue:
i'm having 2 different soap requests here , don't understand why first 1 works second 1 not.
the obvious difference in requests first 1 specifies namespace in <envelope>
tag while second 1 specifies when calling method <getmolddatahistory>
.
soap request 1 - not working (namespace specified @ method call)
<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>
soap request 2 - working (namespace specified in <envelope>
tag)
<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>
the soap error message i'm getting when making first (not working) request.
<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>
the stacktrace of exception thrown server when receiving first soap request.
java.lang.illegalargumentexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.trampoline.invoke(unknown source) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ sun.reflect.misc.methodutil.invoke(unknown source) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ com.sun.xml.internal.ws.api.server.methodutil.invoke(unknown source) @ com.sun.xml.internal.ws.api.server.instanceresolver$1.invoke(unknown source) @ com.sun.xml.internal.ws.server.invokertube$2.invoke(unknown source) @ com.sun.xml.internal.ws.server.sei.endpointmethodhandler.invoke(unknown source) @ com.sun.xml.internal.ws.server.sei.seiinvokertube.processrequest(unknown source) @ com.sun.xml.internal.ws.api.pipe.fiber.__dorun(unknown source) @ com.sun.xml.internal.ws.api.pipe.fiber._dorun(unknown source) @ com.sun.xml.internal.ws.api.pipe.fiber.dorun(unknown source) @ com.sun.xml.internal.ws.api.pipe.fiber.runsync(unknown source) @ com.sun.xml.internal.ws.server.wsendpointimpl$2.process(unknown source) @ com.sun.xml.internal.ws.transport.http.httpadapter$httptoolkit.handle(unknown source) @ com.sun.xml.internal.ws.transport.http.httpadapter.handle(unknown source) @ com.sun.xml.internal.ws.transport.http.server.wshttphandler.handleexchange(unknown source) @ com.sun.xml.internal.ws.transport.http.server.wshttphandler.handle(unknown source) @ com.sun.net.httpserver.filter$chain.dofilter(unknown source) @ sun.net.httpserver.authfilter.dofilter(unknown source) @ com.sun.net.httpserver.filter$chain.dofilter(unknown source) @ sun.net.httpserver.serverimpl$exchange$linkhandler.handle(unknown source) @ com.sun.net.httpserver.filter$chain.dofilter(unknown source) @ sun.net.httpserver.serverimpl$exchange.run(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ java.lang.thread.run(unknown source)
so i'm trying figure out why first request not working despite being valid soap request. there need configure @ server allow such requests?
edit:
after doing more testing found out position of namespace declaration not matter if method call has 0 parameters. parameter required stops working.
edit 2:
now stumpled upon this thread here . have same issue. c# client makes requests not use namespace int method tag. after add it works.
still how can tell jax-ws deal this.
does not work:
<getmolddatahistory xmlns="http://history.production.soap.webservices.product.company.at/">
works:
<his:getmolddatahistory xmlns:his="http://history.production.soap.webservices.product.company.at/">
when using prefix bound namespace in
<his:getmolddatahistory xmlns:his="http://history.production.soap.webservices.product.company.at/"> <machineid>92623-15853588</machineid> <start>0</start> <end>0</end> </his:getmolddatahistory>
then element getmolddatahistory
put specified namespace. reason syntax xmlns:his="..."
declares prefix. must used @ all elements want in specified namespace. in code snippet, element getmolddatahistory
.
using xmlns="..."
syntax in
<getmolddatahistory xmlns="http://history.production.soap.webservices.product.company.at/"> <machineid>92623-15853588</machineid> <start>0</start> <end>0</end> </getmolddatahistory>
not declares namespace, puts associated element , all child elements namespace.
conclusion: these 2 xml snippets not semantically equivalent.
if there such thing "expanded element name" syntax, these xml snippets ...
first one:
<{http://history.production.soap.webservices.product.company.at/}getmolddatahistory> <{}machineid>92623-15853588</{}machineid> <{}start>0</{}start> <{}end>0</{}end> </{http://history.production.soap.webservices.product.company.at/}getmolddatahistory>
second one:
<{http://history.production.soap.webservices.product.company.at/}getmolddatahistory> <{http://history.production.soap.webservices.product.company.at/}machineid>92623-15853588</{http://history.production.soap.webservices.product.company.at/}machineid> <{http://history.production.soap.webservices.product.company.at/}start>0</{http://history.production.soap.webservices.product.company.at/}start> <{http://history.production.soap.webservices.product.company.at/}end>0<{/http://history.production.soap.webservices.product.company.at/}end> </{http://history.production.soap.webservices.product.company.at/}getmolddatahistory>
Comments
Post a Comment