You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Alberto Nobile <al...@gmail.com> on 2007/01/13 14:52:07 UTC
cdc web service client
Hi.
I'm developing a cdc web service client app but I have some problems.
First I've used the j2me wireless toolkit to build the stub from the wsdl
file and when i try to run the app, i have this error:
Exception in thread "main" java.lang.SecurityException: Package name
not allowed - 'java.rmi'
at java.lang.Throwable.<init>(Throwable.java:54)
at java.lang.Throwable.<init>(Throwable.java:68)
at java.lang.ClassLoader.checkClassName(ClassLoader.java:167)
at java.lang.ClassLoader.defineClass(ClassLoader.java:208)
So, I've tried with the axis libraries to build the stub, but when I run the
app I get this error:
java.lang.ExceptionInInitializerError
at java.lang.Class.runStaticInitializers(Class.java:1617)
at NET.webserviceX.www.GlobalWeatherSoapStub._initOperationDesc1(GlobalWeatherSoapStub.java:26)
at NET.webserviceX.www.GlobalWeatherSoapStub.<clinit>(GlobalWeatherSoapStub.java:20)
at java.lang.Class.runStaticInitializers(Class.java:1596)
at prototipoesselunga.Main.run(Main.java:108)
at java.lang.Thread.run(Thread.java:691)
at java.lang.Thread.startup(Thread.java:753)
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.ExceptionInInitializerError (Caused by
java.lang.ExceptionInInitializerError)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:538)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370)
at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:37)
at org.apache.axis.description.OperationDesc.<clinit>(OperationDesc.java:65)
at java.lang.Class.runStaticInitializers(Class.java:1596)
... 6 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.runStaticInitializers(Class.java:1617)
at org.apache.log4j.Logger.getLogger(Logger.java:85)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
at java.lang.reflect.Constructor.newInstance(Constructor.java:266)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
... 11 more
Caused by: java.lang.SecurityException: Prohibited *package* name: java.beans
at sun.misc.Launcher$AppClassLoader.handlePackage(Launcher.java:472)
at sun.misc.Launcher$AppClassLoader.defineClassPrivate(Launcher.java:516)
at sun.misc.Launcher$AppClassLoader.access$500(Launcher.java:325)
at sun.misc.Launcher$4.run(Launcher.java:546)
at java.security.AccessController.doPrivileged(AccessController.java:332)
at java.security.AccessController.doPrivileged(AccessController.java:301)
at sun.misc.Launcher$AppClassLoader.doClassFind(Launcher.java:540)
at sun.misc.Launcher$AppClassLoader.findClass(Launcher.java:588)
at java.lang.ClassLoader.loadClass(ClassLoader.java:320)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:401)
at java.lang.ClassLoader.loadClass(ClassLoader.java:263)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:333)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:640)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:603)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:500)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:406)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:432)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
at java.lang.Class.runStaticInitializers(Class.java:1596)
... 16 more
I've used only the emulator provided by netbeans and websphere studio device
developer.
what can I do?
RE: unexpected xmlns:tns in soap response xml.
Posted by Giuseppe Sarno <gs...@nortel.com>.
Hi I cloned the RawInOutReceiver
removing those lines about target namespace, and everything worked out
just fine.
I'm wondering is there any danger in doing so ?
Why those lines ?
result.declareNamespace(service.getTargetNamespace(),
service.getTargetNamespacePrefix());
Thanks.
________________________________
From: Sarno, Giuseppe (MOP:GM15)
Sent: 15 January 2007 16:13
To: axis-user@ws.apache.org
Subject: RE: unexpected xmlns:tns in soap response xml.
Hi,
just got this:
>From the RawInOutReceiver:
At some point it adds the tns namespace to result:
if (result != null) {
AxisService service = msgContext.getAxisService();
result.declareNamespace(service.getTargetNamespace(),
service.getTargetNamespacePrefix());
envelope.getBody().addChild(result);
}
Why is that ? Why tns is mand in the response ?
Full funtion code:
public void invokeBusinessLogic(MessageContext msgContext,
MessageContext newmsgContext)
throws AxisFault {
try {
// get the implementation class for the Web Service
Object obj = getTheImplementationObject(msgContext);
// find the WebService method
Class implClass = obj.getClass();
AxisOperation opDesc = msgContext.getAxisOperation();
Method method = findOperation(opDesc, implClass);
if (method != null) {
OMElement result = (OMElement) method.invoke(
obj, new
Object[]{msgContext.getEnvelope().getBody().getFirstElement()});
SOAPFactory fac = getSOAPFactory(msgContext);
SOAPEnvelope envelope = fac.getDefaultEnvelope();
if (result != null) {
AxisService service = msgContext.getAxisService();
result.declareNamespace(service.getTargetNamespace(),
service.getTargetNamespacePrefix());
envelope.getBody().addChild(result);
}
newmsgContext.setEnvelope(envelope);
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 16:04
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
I'm sorry. You can specify the namespace only when you create the SOAP
elements "by hand".
Michele
On 15 Jan 2007, at 15:36, Giuseppe Sarno wrote:
Hi,
I don't understand I looked at the api and the only way to
create an OMFactory is to call
OMFactory fac = OMAbstractFactory.getOMFactory();
there is no option for namespace.
Also I printed the XML just before returning and the XML haven't
changed.
It really looks like it's something whithin AXIS:
SERVER SIDE CODE:
OMElement res = XMLStringToOMElement(reply);
System.out.println(OMElementToString(res)); -->
this doesn't show any xmlns:tns
return res;
Functions used below:
public String OMElementToString(OMElement elm) throws
XMLStreamException, Facto
ryConfigurationError
{
StringWriter sw= new StringWriter();
XMLStreamWriter writer =
XMLOutputFactory.newInstance().createXMLStreamW
riter(
sw);
elm.serialize(writer);
writer.flush();
return sw.toString();
}
public OMElement XMLStringToOMElement(String xml) throws
XMLStreamException,
FactoryConfigurationError
{
StringReader sr = new StringReader(xml);
XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamRe
ader(sr);
StAXOMBuilder builder =
new StAXOMBuilder(OMAbstractFactory.getOMFactory(),
parser);
OMElement documentElement =
builder.getDocumentElement();
return documentElement;
}
---------------------------------------
CLIENT SIDE CODE:
OMElement res = sender.sendReceive(msg);
System.out.println("done");
String response = OMElementToString(res);
System.out.println("response:"+res); --->
This contains the xmlns:tns
regards.
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 15:09
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
try to provide a "full" configured OMFactory object (i.e. with
the namespace - null is a legal value).
Michele
On 15 Jan 2007, at 15:01, Giuseppe Sarno wrote:
Thanks,
Hi, thanks for your reply,
This is how I convert the XML from a String to an
OMElement.
Do you see anything wrong with it ?
public OMElement XMLStringToOMElement(String xml) throws
XMLStreamException, F
actoryConfigurationError
{
StringReader sr = new StringReader(xml);
XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamRe
ader(sr);
StAXOMBuilder builder =
new
StAXOMBuilder(OMAbstractFactory.getOMFactory(), parser);
OMElement documentElement =
builder.getDocumentElement();
return documentElement;
}
Regards.
________________________________
From: Michele Mazzucco
[mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 14:57
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
if I'm right the xmlns:tns element value comes from the
factory object used to create the SOAP elements, while you get those
numbers before and after the SOAP message because you have the chunked
option enabled in axis2.xml (please check the transport out section).
Hope this helps,
Michele
On 15 Jan 2007, at 13:54, Giuseppe Sarno wrote:
Hi I used Tcpmon:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA
(build: CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5
Set-Cookie:
JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6; Path=/
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Jan 2007 13:49:00 GMT
144
<?xml version='1.0'
encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/>
"><soapenv:Header /><soapenv:Body><samlp:x
xmlns:tns="http://<reverse>.<package <http://<reverse>.<package> >"
xmlns:samlp="ww"
xmlns="ff">blah</samlp:x></soapenv:Body></soapenv:Envelope>
0
(I also get those numbers 144 at the beginning
of the SOAP message and 0 at the end, what are those ?)
XML I want to be sent back :
<samlp:x xmlns:samlp="ww"
xmlns="ff">blah</samlp:x>
Many thanks.
________________________________
From: Michele Mazzucco
[mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 13:32
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap
response xml.
Hi Giuseppe,
try to post the full SOAP message please.
Thanks,
Michele
On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
Hi,
can anyone tell me at least if this
could be a bug ? or intended behaviour ?
Thanks.
________________________________
From: Sarno, Giuseppe (MOP:GM15)
Sent: 13 January 2007 23:58
To: axis-user@ws.apache.org
Subject: unexpected xmlns:tns in soap
response xml.
Hi,
I'm using AXIOM and I have a basic
client/server similar to the one in the sample dir (quickstartaxiom)
the main difference is that I exchange
request and response XML reading then from a String (which I than
convert in OMElement and vice versa).
I noticed that in the response (at the
client side) along with the expected namespaces declaration, I get a
xmlns:tns="http//<package>.<directory>" in the root element which I
didn't put in my response XML at the Server side..
Does anyone know why ?
How can I get rid of it (as I don't want
my request/response to be changed by AXIS)?
regards.
Giuseppe.
RE: unexpected xmlns:tns in soap response xml.
Posted by Giuseppe Sarno <gs...@nortel.com>.
Hi,
just got this:
>From the RawInOutReceiver:
At some point it adds the tns namespace to result:
if (result != null) {
AxisService service = msgContext.getAxisService();
result.declareNamespace(service.getTargetNamespace(),
service.getTargetNamespacePrefix());
envelope.getBody().addChild(result);
}
Why is that ? Why tns is mand in the response ?
Full funtion code:
public void invokeBusinessLogic(MessageContext msgContext,
MessageContext newmsgContext)
throws AxisFault {
try {
// get the implementation class for the Web Service
Object obj = getTheImplementationObject(msgContext);
// find the WebService method
Class implClass = obj.getClass();
AxisOperation opDesc = msgContext.getAxisOperation();
Method method = findOperation(opDesc, implClass);
if (method != null) {
OMElement result = (OMElement) method.invoke(
obj, new
Object[]{msgContext.getEnvelope().getBody().getFirstElement()});
SOAPFactory fac = getSOAPFactory(msgContext);
SOAPEnvelope envelope = fac.getDefaultEnvelope();
if (result != null) {
AxisService service = msgContext.getAxisService();
result.declareNamespace(service.getTargetNamespace(),
service.getTargetNamespacePrefix());
envelope.getBody().addChild(result);
}
newmsgContext.setEnvelope(envelope);
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 16:04
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
I'm sorry. You can specify the namespace only when you create the SOAP
elements "by hand".
Michele
On 15 Jan 2007, at 15:36, Giuseppe Sarno wrote:
Hi,
I don't understand I looked at the api and the only way to
create an OMFactory is to call
OMFactory fac = OMAbstractFactory.getOMFactory();
there is no option for namespace.
Also I printed the XML just before returning and the XML haven't
changed.
It really looks like it's something whithin AXIS:
SERVER SIDE CODE:
OMElement res = XMLStringToOMElement(reply);
System.out.println(OMElementToString(res)); -->
this doesn't show any xmlns:tns
return res;
Functions used below:
public String OMElementToString(OMElement elm) throws
XMLStreamException, Facto
ryConfigurationError
{
StringWriter sw= new StringWriter();
XMLStreamWriter writer =
XMLOutputFactory.newInstance().createXMLStreamW
riter(
sw);
elm.serialize(writer);
writer.flush();
return sw.toString();
}
public OMElement XMLStringToOMElement(String xml) throws
XMLStreamException,
FactoryConfigurationError
{
StringReader sr = new StringReader(xml);
XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamRe
ader(sr);
StAXOMBuilder builder =
new StAXOMBuilder(OMAbstractFactory.getOMFactory(),
parser);
OMElement documentElement =
builder.getDocumentElement();
return documentElement;
}
---------------------------------------
CLIENT SIDE CODE:
OMElement res = sender.sendReceive(msg);
System.out.println("done");
String response = OMElementToString(res);
System.out.println("response:"+res); --->
This contains the xmlns:tns
regards.
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 15:09
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
try to provide a "full" configured OMFactory object (i.e. with
the namespace - null is a legal value).
Michele
On 15 Jan 2007, at 15:01, Giuseppe Sarno wrote:
Thanks,
Hi, thanks for your reply,
This is how I convert the XML from a String to an
OMElement.
Do you see anything wrong with it ?
public OMElement XMLStringToOMElement(String xml) throws
XMLStreamException, F
actoryConfigurationError
{
StringReader sr = new StringReader(xml);
XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamRe
ader(sr);
StAXOMBuilder builder =
new
StAXOMBuilder(OMAbstractFactory.getOMFactory(), parser);
OMElement documentElement =
builder.getDocumentElement();
return documentElement;
}
Regards.
________________________________
From: Michele Mazzucco
[mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 14:57
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
if I'm right the xmlns:tns element value comes from the
factory object used to create the SOAP elements, while you get those
numbers before and after the SOAP message because you have the chunked
option enabled in axis2.xml (please check the transport out section).
Hope this helps,
Michele
On 15 Jan 2007, at 13:54, Giuseppe Sarno wrote:
Hi I used Tcpmon:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA
(build: CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5
Set-Cookie:
JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6; Path=/
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Jan 2007 13:49:00 GMT
144
<?xml version='1.0'
encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/>
"><soapenv:Header /><soapenv:Body><samlp:x
xmlns:tns="http://<reverse>.<package <http://<reverse>.<package> >"
xmlns:samlp="ww"
xmlns="ff">blah</samlp:x></soapenv:Body></soapenv:Envelope>
0
(I also get those numbers 144 at the beginning
of the SOAP message and 0 at the end, what are those ?)
XML I want to be sent back :
<samlp:x xmlns:samlp="ww"
xmlns="ff">blah</samlp:x>
Many thanks.
________________________________
From: Michele Mazzucco
[mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 13:32
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap
response xml.
Hi Giuseppe,
try to post the full SOAP message please.
Thanks,
Michele
On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
Hi,
can anyone tell me at least if this
could be a bug ? or intended behaviour ?
Thanks.
________________________________
From: Sarno, Giuseppe (MOP:GM15)
Sent: 13 January 2007 23:58
To: axis-user@ws.apache.org
Subject: unexpected xmlns:tns in soap
response xml.
Hi,
I'm using AXIOM and I have a basic
client/server similar to the one in the sample dir (quickstartaxiom)
the main difference is that I exchange
request and response XML reading then from a String (which I than
convert in OMElement and vice versa).
I noticed that in the response (at the
client side) along with the expected namespaces declaration, I get a
xmlns:tns="http//<package>.<directory>" in the root element which I
didn't put in my response XML at the Server side..
Does anyone know why ?
How can I get rid of it (as I don't want
my request/response to be changed by AXIS)?
regards.
Giuseppe.
Re: unexpected xmlns:tns in soap response xml.
Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Giuseppe,
I'm sorry. You can specify the namespace only when you create the
SOAP elements "by hand".
Michele
On 15 Jan 2007, at 15:36, Giuseppe Sarno wrote:
> Hi,
> I don't understand I looked at the api and the only way to create
> an OMFactory is to call
> OMFactory fac = OMAbstractFactory.getOMFactory();
> there is no option for namespace.
>
> Also I printed the XML just before returning and the XML haven't
> changed.
> It really looks like it's something whithin AXIS:
>
> SERVER SIDE CODE:
>
>
> OMElement res = XMLStringToOMElement(reply);
> System.out.println(OMElementToString(res)); --> this
> doesn't show any xmlns:tns
> return res;
>
> Functions used below:
>
>
> public String OMElementToString(OMElement elm) throws
> XMLStreamException, Facto
> ryConfigurationError
> {
>
> StringWriter sw= new StringWriter();
> XMLStreamWriter writer = XMLOutputFactory.newInstance
> ().createXMLStreamW
> riter(
> sw);
> elm.serialize(writer);
> writer.flush();
> return sw.toString();
>
> }
> public OMElement XMLStringToOMElement(String xml) throws
> XMLStreamException,
> FactoryConfigurationError
> {
> StringReader sr = new StringReader(xml);
>
> XMLStreamReader parser = XMLInputFactory.newInstance
> ().createXMLStreamRe
> ader(sr);
> StAXOMBuilder builder =
> new StAXOMBuilder(OMAbstractFactory.getOMFactory(),
> parser);
> OMElement documentElement = builder.getDocumentElement();
>
> return documentElement;
> }
>
> ---------------------------------------
>
> CLIENT SIDE CODE:
>
> OMElement res = sender.sendReceive(msg);
> System.out.println("done");
>
> String response = OMElementToString(res);
> System.out.println("response:"+res); --->
> This contains the xmlns:tns
>
>
> regards.
>
>
> From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
> Sent: 15 January 2007 15:09
> To: axis-user@ws.apache.org
> Subject: Re: unexpected xmlns:tns in soap response xml.
>
> Giuseppe,
>
> try to provide a "full" configured OMFactory object (i.e. with the
> namespace - null is a legal value).
>
>
> Michele
>
> On 15 Jan 2007, at 15:01, Giuseppe Sarno wrote:
>
>> Thanks,
>>
>> Hi, thanks for your reply,
>> This is how I convert the XML from a String to an OMElement.
>> Do you see anything wrong with it ?
>>
>> public OMElement XMLStringToOMElement(String xml) throws
>> XMLStreamException, F
>> actoryConfigurationError
>> {
>> StringReader sr = new StringReader(xml);
>>
>> XMLStreamReader parser = XMLInputFactory.newInstance
>> ().createXMLStreamRe
>> ader(sr);
>> StAXOMBuilder builder =
>> new StAXOMBuilder(OMAbstractFactory.getOMFactory(),
>> parser);
>> OMElement documentElement = builder.getDocumentElement();
>>
>> return documentElement;
>> }
>> Regards.
>>
>> From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
>> Sent: 15 January 2007 14:57
>> To: axis-user@ws.apache.org
>> Subject: Re: unexpected xmlns:tns in soap response xml.
>>
>> Giuseppe,
>>
>> if I'm right the xmlns:tns element value comes from the factory
>> object used to create the SOAP elements, while you get those
>> numbers before and after the SOAP message because you have the
>> chunked option enabled in axis2.xml (please check the transport
>> out section).
>>
>>
>> Hope this helps,
>> Michele
>>
>>
>> On 15 Jan 2007, at 13:54, Giuseppe Sarno wrote:
>>
>>> Hi I used Tcpmon:
>>>
>>> HTTP/1.1 200 OK
>>> Server: Apache-Coyote/1.1
>>> X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build:
>>> CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5
>>> Set-Cookie: JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6; Path=/
>>> Content-Type: text/xml;charset=UTF-8
>>> Transfer-Encoding: chunked
>>> Date: Mon, 15 Jan 2007 13:49:00 GMT
>>>
>>>
>>>
>>> 144
>>>
>>> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
>>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>>> "><soapenv:Header /><soapenv:Body><samlp:x xmlns:tns="http://
>>> <reverse>.<package>" xmlns:samlp="ww" xmlns="ff">blah</samlp:x></
>>> soapenv:Body></soapenv:Envelope>
>>>
>>> 0
>>>
>>> (I also get those numbers 144 at the beginning of the SOAP
>>> message and 0 at the end, what are those ?)
>>>
>>>
>>> XML I want to be sent back :
>>>
>>> <samlp:x xmlns:samlp="ww" xmlns="ff">blah</samlp:x>
>>>
>>> Many thanks.
>>>
>>>
>>>
>>> From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
>>> Sent: 15 January 2007 13:32
>>> To: axis-user@ws.apache.org
>>> Subject: Re: unexpected xmlns:tns in soap response xml.
>>>
>>> Hi Giuseppe,
>>>
>>> try to post the full SOAP message please.
>>>
>>>
>>> Thanks,
>>> Michele
>>>
>>>
>>> On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
>>>
>>>> Hi,
>>>> can anyone tell me at least if this could be a bug ? or intended
>>>> behaviour ?
>>>>
>>>> Thanks.
>>>>
>>>> From: Sarno, Giuseppe (MOP:GM15)
>>>> Sent: 13 January 2007 23:58
>>>> To: axis-user@ws.apache.org
>>>> Subject: unexpected xmlns:tns in soap response xml.
>>>>
>>>> Hi,
>>>> I'm using AXIOM and I have a basic client/server similar to the
>>>> one in the sample dir (quickstartaxiom)
>>>>
>>>> the main difference is that I exchange request and response XML
>>>> reading then from a String (which I than convert in OMElement
>>>> and vice versa).
>>>>
>>>> I noticed that in the response (at the client side) along with
>>>> the expected namespaces declaration, I get a xmlns:tns="http//
>>>> <package>.<directory>" in the root element which I didn't put in
>>>> my response XML at the Server side..
>>>>
>>>> Does anyone know why ?
>>>> How can I get rid of it (as I don't want my request/response to
>>>> be changed by AXIS)?
>>>>
>>>> regards.
>>>> Giuseppe.
>>>
>>
>
RE: unexpected xmlns:tns in soap response xml.
Posted by Giuseppe Sarno <gs...@nortel.com>.
Hi,
I don't understand I looked at the api and the only way to create an
OMFactory is to call
OMFactory fac = OMAbstractFactory.getOMFactory();
there is no option for namespace.
Also I printed the XML just before returning and the XML haven't
changed.
It really looks like it's something whithin AXIS:
SERVER SIDE CODE:
OMElement res = XMLStringToOMElement(reply);
System.out.println(OMElementToString(res)); --> this
doesn't show any xmlns:tns
return res;
Functions used below:
public String OMElementToString(OMElement elm) throws
XMLStreamException, Facto
ryConfigurationError
{
StringWriter sw= new StringWriter();
XMLStreamWriter writer =
XMLOutputFactory.newInstance().createXMLStreamW
riter(
sw);
elm.serialize(writer);
writer.flush();
return sw.toString();
}
public OMElement XMLStringToOMElement(String xml) throws
XMLStreamException,
FactoryConfigurationError
{
StringReader sr = new StringReader(xml);
XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamRe
ader(sr);
StAXOMBuilder builder =
new StAXOMBuilder(OMAbstractFactory.getOMFactory(), parser);
OMElement documentElement = builder.getDocumentElement();
return documentElement;
}
---------------------------------------
CLIENT SIDE CODE:
OMElement res = sender.sendReceive(msg);
System.out.println("done");
String response = OMElementToString(res);
System.out.println("response:"+res); ---> This
contains the xmlns:tns
regards.
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 15:09
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
try to provide a "full" configured OMFactory object (i.e. with the
namespace - null is a legal value).
Michele
On 15 Jan 2007, at 15:01, Giuseppe Sarno wrote:
Thanks,
Hi, thanks for your reply,
This is how I convert the XML from a String to an OMElement.
Do you see anything wrong with it ?
public OMElement XMLStringToOMElement(String xml) throws
XMLStreamException, F
actoryConfigurationError
{
StringReader sr = new StringReader(xml);
XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamRe
ader(sr);
StAXOMBuilder builder =
new StAXOMBuilder(OMAbstractFactory.getOMFactory(),
parser);
OMElement documentElement =
builder.getDocumentElement();
return documentElement;
}
Regards.
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 14:57
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
if I'm right the xmlns:tns element value comes from the factory
object used to create the SOAP elements, while you get those numbers
before and after the SOAP message because you have the chunked option
enabled in axis2.xml (please check the transport out section).
Hope this helps,
Michele
On 15 Jan 2007, at 13:54, Giuseppe Sarno wrote:
Hi I used Tcpmon:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build:
CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5
Set-Cookie: JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6;
Path=/
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Jan 2007 13:49:00 GMT
144
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/>
"><soapenv:Header /><soapenv:Body><samlp:x
xmlns:tns="http://<reverse>.<package <http://<reverse>.<package> >"
xmlns:samlp="ww"
xmlns="ff">blah</samlp:x></soapenv:Body></soapenv:Envelope>
0
(I also get those numbers 144 at the beginning of the
SOAP message and 0 at the end, what are those ?)
XML I want to be sent back :
<samlp:x xmlns:samlp="ww" xmlns="ff">blah</samlp:x>
Many thanks.
________________________________
From: Michele Mazzucco
[mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 13:32
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Hi Giuseppe,
try to post the full SOAP message please.
Thanks,
Michele
On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
Hi,
can anyone tell me at least if this could be a
bug ? or intended behaviour ?
Thanks.
________________________________
From: Sarno, Giuseppe (MOP:GM15)
Sent: 13 January 2007 23:58
To: axis-user@ws.apache.org
Subject: unexpected xmlns:tns in soap response
xml.
Hi,
I'm using AXIOM and I have a basic client/server
similar to the one in the sample dir (quickstartaxiom)
the main difference is that I exchange request
and response XML reading then from a String (which I than convert in
OMElement and vice versa).
I noticed that in the response (at the client
side) along with the expected namespaces declaration, I get a
xmlns:tns="http//<package>.<directory>" in the root element which I
didn't put in my response XML at the Server side..
Does anyone know why ?
How can I get rid of it (as I don't want my
request/response to be changed by AXIS)?
regards.
Giuseppe.
Re: unexpected xmlns:tns in soap response xml.
Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Giuseppe,
try to provide a "full" configured OMFactory object (i.e. with the
namespace - null is a legal value).
Michele
On 15 Jan 2007, at 15:01, Giuseppe Sarno wrote:
> Thanks,
>
> Hi, thanks for your reply,
> This is how I convert the XML from a String to an OMElement.
> Do you see anything wrong with it ?
>
> public OMElement XMLStringToOMElement(String xml) throws
> XMLStreamException, F
> actoryConfigurationError
> {
> StringReader sr = new StringReader(xml);
>
> XMLStreamReader parser = XMLInputFactory.newInstance
> ().createXMLStreamRe
> ader(sr);
> StAXOMBuilder builder =
> new StAXOMBuilder(OMAbstractFactory.getOMFactory(),
> parser);
> OMElement documentElement = builder.getDocumentElement();
>
> return documentElement;
> }
> Regards.
>
> From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
> Sent: 15 January 2007 14:57
> To: axis-user@ws.apache.org
> Subject: Re: unexpected xmlns:tns in soap response xml.
>
> Giuseppe,
>
> if I'm right the xmlns:tns element value comes from the factory
> object used to create the SOAP elements, while you get those
> numbers before and after the SOAP message because you have the
> chunked option enabled in axis2.xml (please check the transport out
> section).
>
>
> Hope this helps,
> Michele
>
>
> On 15 Jan 2007, at 13:54, Giuseppe Sarno wrote:
>
>> Hi I used Tcpmon:
>>
>> HTTP/1.1 200 OK
>> Server: Apache-Coyote/1.1
>> X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build:
>> CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5
>> Set-Cookie: JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6; Path=/
>> Content-Type: text/xml;charset=UTF-8
>> Transfer-Encoding: chunked
>> Date: Mon, 15 Jan 2007 13:49:00 GMT
>>
>>
>>
>> 144
>>
>> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
>> "><soapenv:Header /><soapenv:Body><samlp:x xmlns:tns="http://
>> <reverse>.<package>" xmlns:samlp="ww" xmlns="ff">blah</samlp:x></
>> soapenv:Body></soapenv:Envelope>
>>
>> 0
>>
>> (I also get those numbers 144 at the beginning of the SOAP message
>> and 0 at the end, what are those ?)
>>
>>
>> XML I want to be sent back :
>>
>> <samlp:x xmlns:samlp="ww" xmlns="ff">blah</samlp:x>
>>
>> Many thanks.
>>
>>
>>
>> From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
>> Sent: 15 January 2007 13:32
>> To: axis-user@ws.apache.org
>> Subject: Re: unexpected xmlns:tns in soap response xml.
>>
>> Hi Giuseppe,
>>
>> try to post the full SOAP message please.
>>
>>
>> Thanks,
>> Michele
>>
>>
>> On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
>>
>>> Hi,
>>> can anyone tell me at least if this could be a bug ? or intended
>>> behaviour ?
>>>
>>> Thanks.
>>>
>>> From: Sarno, Giuseppe (MOP:GM15)
>>> Sent: 13 January 2007 23:58
>>> To: axis-user@ws.apache.org
>>> Subject: unexpected xmlns:tns in soap response xml.
>>>
>>> Hi,
>>> I'm using AXIOM and I have a basic client/server similar to the
>>> one in the sample dir (quickstartaxiom)
>>>
>>> the main difference is that I exchange request and response XML
>>> reading then from a String (which I than convert in OMElement and
>>> vice versa).
>>>
>>> I noticed that in the response (at the client side) along with
>>> the expected namespaces declaration, I get a xmlns:tns="http//
>>> <package>.<directory>" in the root element which I didn't put in
>>> my response XML at the Server side..
>>>
>>> Does anyone know why ?
>>> How can I get rid of it (as I don't want my request/response to
>>> be changed by AXIS)?
>>>
>>> regards.
>>> Giuseppe.
>>
>
RE: unexpected xmlns:tns in soap response xml.
Posted by Giuseppe Sarno <gs...@nortel.com>.
Thanks,
Hi, thanks for your reply,
This is how I convert the XML from a String to an OMElement.
Do you see anything wrong with it ?
public OMElement XMLStringToOMElement(String xml) throws
XMLStreamException, F
actoryConfigurationError
{
StringReader sr = new StringReader(xml);
XMLStreamReader parser =
XMLInputFactory.newInstance().createXMLStreamRe
ader(sr);
StAXOMBuilder builder =
new StAXOMBuilder(OMAbstractFactory.getOMFactory(), parser);
OMElement documentElement = builder.getDocumentElement();
return documentElement;
}
Regards.
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 14:57
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Giuseppe,
if I'm right the xmlns:tns element value comes from the factory object
used to create the SOAP elements, while you get those numbers before and
after the SOAP message because you have the chunked option enabled in
axis2.xml (please check the transport out section).
Hope this helps,
Michele
On 15 Jan 2007, at 13:54, Giuseppe Sarno wrote:
Hi I used Tcpmon:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build:
CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5
Set-Cookie: JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6; Path=/
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Jan 2007 13:49:00 GMT
144
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/>
"><soapenv:Header /><soapenv:Body><samlp:x
xmlns:tns="http://<reverse>.<package <http://<reverse>.<package> >"
xmlns:samlp="ww"
xmlns="ff">blah</samlp:x></soapenv:Body></soapenv:Envelope>
0
(I also get those numbers 144 at the beginning of the SOAP
message and 0 at the end, what are those ?)
XML I want to be sent back :
<samlp:x xmlns:samlp="ww" xmlns="ff">blah</samlp:x>
Many thanks.
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 13:32
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Hi Giuseppe,
try to post the full SOAP message please.
Thanks,
Michele
On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
Hi,
can anyone tell me at least if this could be a bug ? or
intended behaviour ?
Thanks.
________________________________
From: Sarno, Giuseppe (MOP:GM15)
Sent: 13 January 2007 23:58
To: axis-user@ws.apache.org
Subject: unexpected xmlns:tns in soap response xml.
Hi,
I'm using AXIOM and I have a basic client/server similar
to the one in the sample dir (quickstartaxiom)
the main difference is that I exchange request and
response XML reading then from a String (which I than convert in
OMElement and vice versa).
I noticed that in the response (at the client side)
along with the expected namespaces declaration, I get a
xmlns:tns="http//<package>.<directory>" in the root element which I
didn't put in my response XML at the Server side..
Does anyone know why ?
How can I get rid of it (as I don't want my
request/response to be changed by AXIS)?
regards.
Giuseppe.
Re: unexpected xmlns:tns in soap response xml.
Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Giuseppe,
if I'm right the xmlns:tns element value comes from the factory
object used to create the SOAP elements, while you get those numbers
before and after the SOAP message because you have the chunked option
enabled in axis2.xml (please check the transport out section).
Hope this helps,
Michele
On 15 Jan 2007, at 13:54, Giuseppe Sarno wrote:
> Hi I used Tcpmon:
>
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build:
> CVSTag=JBoss_4_0_4_GA date=200605151000)/Tomcat-5.5
> Set-Cookie: JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6; Path=/
> Content-Type: text/xml;charset=UTF-8
> Transfer-Encoding: chunked
> Date: Mon, 15 Jan 2007 13:49:00 GMT
>
>
>
> 144
>
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
> "><soapenv:Header /><soapenv:Body><samlp:x xmlns:tns="http://
> <reverse>.<package>" xmlns:samlp="ww" xmlns="ff">blah</samlp:x></
> soapenv:Body></soapenv:Envelope>
>
> 0
>
> (I also get those numbers 144 at the beginning of the SOAP message
> and 0 at the end, what are those ?)
>
>
> XML I want to be sent back :
>
> <samlp:x xmlns:samlp="ww" xmlns="ff">blah</samlp:x>
>
> Many thanks.
>
>
>
> From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
> Sent: 15 January 2007 13:32
> To: axis-user@ws.apache.org
> Subject: Re: unexpected xmlns:tns in soap response xml.
>
> Hi Giuseppe,
>
> try to post the full SOAP message please.
>
>
> Thanks,
> Michele
>
>
> On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
>
>> Hi,
>> can anyone tell me at least if this could be a bug ? or intended
>> behaviour ?
>>
>> Thanks.
>>
>> From: Sarno, Giuseppe (MOP:GM15)
>> Sent: 13 January 2007 23:58
>> To: axis-user@ws.apache.org
>> Subject: unexpected xmlns:tns in soap response xml.
>>
>> Hi,
>> I'm using AXIOM and I have a basic client/server similar to the
>> one in the sample dir (quickstartaxiom)
>>
>> the main difference is that I exchange request and response XML
>> reading then from a String (which I than convert in OMElement and
>> vice versa).
>>
>> I noticed that in the response (at the client side) along with the
>> expected namespaces declaration, I get a xmlns:tns="http//
>> <package>.<directory>" in the root element which I didn't put in
>> my response XML at the Server side..
>>
>> Does anyone know why ?
>> How can I get rid of it (as I don't want my request/response to be
>> changed by AXIS)?
>>
>> regards.
>> Giuseppe.
>
RE: unexpected xmlns:tns in soap response xml.
Posted by Giuseppe Sarno <gs...@nortel.com>.
Hi I used Tcpmon:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA
date=200605151000)/Tomcat-5.5
Set-Cookie: JSESSIONID=562AF18DB095A4637FCB5E666BAD1FD6; Path=/
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 15 Jan 2007 13:49:00 GMT
144
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
<http://schemas.xmlsoap.org/soap/envelope/>
"><soapenv:Header /><soapenv:Body><samlp:x
xmlns:tns="http://<reverse>.<package <http://<reverse>.<package> >"
xmlns:samlp="ww"
xmlns="ff">blah</samlp:x></soapenv:Body></soapenv:Envelope>
0
(I also get those numbers 144 at the beginning of the SOAP message and 0
at the end, what are those ?)
XML I want to be sent back :
<samlp:x xmlns:samlp="ww" xmlns="ff">blah</samlp:x>
Many thanks.
________________________________
From: Michele Mazzucco [mailto:Michele.Mazzucco@ncl.ac.uk]
Sent: 15 January 2007 13:32
To: axis-user@ws.apache.org
Subject: Re: unexpected xmlns:tns in soap response xml.
Hi Giuseppe,
try to post the full SOAP message please.
Thanks,
Michele
On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
Hi,
can anyone tell me at least if this could be a bug ? or intended
behaviour ?
Thanks.
________________________________
From: Sarno, Giuseppe (MOP:GM15)
Sent: 13 January 2007 23:58
To: axis-user@ws.apache.org
Subject: unexpected xmlns:tns in soap response xml.
Hi,
I'm using AXIOM and I have a basic client/server similar to the
one in the sample dir (quickstartaxiom)
the main difference is that I exchange request and response XML
reading then from a String (which I than convert in OMElement and vice
versa).
I noticed that in the response (at the client side) along with
the expected namespaces declaration, I get a
xmlns:tns="http//<package>.<directory>" in the root element which I
didn't put in my response XML at the Server side..
Does anyone know why ?
How can I get rid of it (as I don't want my request/response to
be changed by AXIS)?
regards.
Giuseppe.
Re: unexpected xmlns:tns in soap response xml.
Posted by Michele Mazzucco <Mi...@ncl.ac.uk>.
Hi Giuseppe,
try to post the full SOAP message please.
Thanks,
Michele
On 15 Jan 2007, at 10:44, Giuseppe Sarno wrote:
> Hi,
> can anyone tell me at least if this could be a bug ? or intended
> behaviour ?
>
> Thanks.
>
> From: Sarno, Giuseppe (MOP:GM15)
> Sent: 13 January 2007 23:58
> To: axis-user@ws.apache.org
> Subject: unexpected xmlns:tns in soap response xml.
>
> Hi,
> I'm using AXIOM and I have a basic client/server similar to the one
> in the sample dir (quickstartaxiom)
>
> the main difference is that I exchange request and response XML
> reading then from a String (which I than convert in OMElement and
> vice versa).
>
> I noticed that in the response (at the client side) along with the
> expected namespaces declaration, I get a xmlns:tns="http//
> <package>.<directory>" in the root element which I didn't put in my
> response XML at the Server side..
>
> Does anyone know why ?
> How can I get rid of it (as I don't want my request/response to be
> changed by AXIS)?
>
> regards.
> Giuseppe.
RE: unexpected xmlns:tns in soap response xml.
Posted by Giuseppe Sarno <gs...@nortel.com>.
Hi,
can anyone tell me at least if this could be a bug ? or intended
behaviour ?
Thanks.
________________________________
From: Sarno, Giuseppe (MOP:GM15)
Sent: 13 January 2007 23:58
To: axis-user@ws.apache.org
Subject: unexpected xmlns:tns in soap response xml.
Hi,
I'm using AXIOM and I have a basic client/server similar to the one in
the sample dir (quickstartaxiom)
the main difference is that I exchange request and response XML reading
then from a String (which I than convert in OMElement and vice versa).
I noticed that in the response (at the client side) along with the
expected namespaces declaration, I get a
xmlns:tns="http//<package>.<directory>" in the root element which I
didn't put in my response XML at the Server side..
Does anyone know why ?
How can I get rid of it (as I don't want my request/response to be
changed by AXIS)?
regards.
Giuseppe.
unexpected xmlns:tns in soap response xml.
Posted by Giuseppe Sarno <gs...@nortel.com>.
Hi,
I'm using AXIOM and I have a basic client/server similar to the one in the sample dir (quickstartaxiom)
the main difference is that I exchange request and response XML reading then from a String (which I than convert in OMElement and vice versa).
I noticed that in the response (at the client side) along with the expected namespaces declaration, I get a xmlns:tns="http//<package>.<directory>" in the root element which I didn't put in my response XML at the Server side..
Does anyone know why ?
How can I get rid of it (as I don't want my request/response to be changed by AXIS)?
regards.
Giuseppe.