Petals BC SOAP

duplication of namespace attribute

Details

  • Type: Bug Bug
  • Status: Inaccurate Inaccurate
  • Resolution: Cannot Reproduce
  • Affects Version/s: 4.0.3
  • Fix Version/s: None
  • Component/s: None
  • Security Level: Public
  • Description:
    Hide

    I just want to report a bug concerning duplicate attribute in SOAP body and the way I deal with it.
    I'm right now using 4.0.3-SNAPSHOT version.

    After had a look on sources, the way I did is to convert SOAP's body content to string, delete the whole string of this attribute and recreate OMElement of body content.

    This is a kind of stupid way but quick one that solves this duplicate attribute problem.

    Show
    I just want to report a bug concerning duplicate attribute in SOAP body and the way I deal with it. I'm right now using 4.0.3-SNAPSHOT version. After had a look on sources, the way I did is to convert SOAP's body content to string, delete the whole string of this attribute and recreate OMElement of body content. This is a kind of stupid way but quick one that solves this duplicate attribute problem.
  • Environment:
    window

Activity

Hide
noddoux added a comment - Thu, 6 Jan 2011 - 14:23:52 +0100

Hello

Could you provide me your SU to reproduce the problem and if possible the correction you did so that I integrate it to the BC SOAP 4.1 please ?

Thank you

Show
noddoux added a comment - Thu, 6 Jan 2011 - 14:23:52 +0100 Hello Could you provide me your SU to reproduce the problem and if possible the correction you did so that I integrate it to the BC SOAP 4.1 please ? Thank you
Hide
Netty Rajsiri added a comment - Thu, 6 Jan 2011 - 14:39:35 +0100

I dont have SU but I have an external client. This is the error:

com.sun.xml.internal.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,502]
Message: Attribute "xmlns:wstop" was already specified for element "wstop:TopicSet".
at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source

I modified the method createSOAPBody in the class Marshaller in this package org.ow2.petals.binding.soap.util. Here is the modification:

final XMLStreamReader parser = StaxUtils.createXMLStreamReader(source);
final StAXOMBuilder builder = new StAXOMBuilder(factory, parser);
final OMElement bodyContent = builder.getDocumentElement();

//dealing with duplicate attribute
String newContent = bodyContent.toString().replaceFirst("xmlns:wstop\="....", "");

InputStream toSOAP = new ByteArrayInputStream(newContent.getBytes());

XMLStreamReader parser1 = StAXUtils.getXMLInputFactory().createXMLStreamReader(toSOAP);

final StAXOMBuilder builder1 = new StAXOMBuilder(factory, parser1);
final OMElement bodyContent2 = builder1.getDocumentElement();

//create soapbody and add new body content
body = factory.createSOAPBody(envelope);

body.addChild(bodyContent2);

System.out.println("soap body: "+ body.toString());

Show
Netty Rajsiri added a comment - Thu, 6 Jan 2011 - 14:39:35 +0100 I dont have SU but I have an external client. This is the error: com.sun.xml.internal.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: XML reader error: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,502] Message: Attribute "xmlns:wstop" was already specified for element "wstop:TopicSet". at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(Unknown Source) at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source I modified the method createSOAPBody in the class Marshaller in this package org.ow2.petals.binding.soap.util. Here is the modification: final XMLStreamReader parser = StaxUtils.createXMLStreamReader(source); final StAXOMBuilder builder = new StAXOMBuilder(factory, parser); final OMElement bodyContent = builder.getDocumentElement(); //dealing with duplicate attribute String newContent = bodyContent.toString().replaceFirst("xmlns:wstop\="....", ""); InputStream toSOAP = new ByteArrayInputStream(newContent.getBytes()); XMLStreamReader parser1 = StAXUtils.getXMLInputFactory().createXMLStreamReader(toSOAP); final StAXOMBuilder builder1 = new StAXOMBuilder(factory, parser1); final OMElement bodyContent2 = builder1.getDocumentElement(); //create soapbody and add new body content body = factory.createSOAPBody(envelope); body.addChild(bodyContent2); System.out.println("soap body: "+ body.toString());
Hide
noddoux added a comment - Thu, 6 Jan 2011 - 16:29:05 +0100

I do not understand how you can use the BC SOAP without SU.

Do you use JDOM anywhere in the use case ?

Show
noddoux added a comment - Thu, 6 Jan 2011 - 16:29:05 +0100 I do not understand how you can use the BC SOAP without SU. Do you use JDOM anywhere in the use case ?
Hide
Netty Rajsiri added a comment - Thu, 6 Jan 2011 - 17:34:51 +0100

I use bc soap to communicate with ws-notification broker deployed in Petals. I create an external web client and when my client tries to get a soap message back from Petals, it throws me the error of duplicate attribute.

Show
Netty Rajsiri added a comment - Thu, 6 Jan 2011 - 17:34:51 +0100 I use bc soap to communicate with ws-notification broker deployed in Petals. I create an external web client and when my client tries to get a soap message back from Petals, it throws me the error of duplicate attribute.
Hide
noddoux added a comment - Thu, 6 Jan 2011 - 17:54:17 +0100 - edited

OK. I do not know the notification subject. I do not understand what you want to do. I am not sure that the current production version of the BC SOAP still support the notifications (as you would like).

Show
noddoux added a comment - Thu, 6 Jan 2011 - 17:54:17 +0100 - edited OK. I do not know the notification subject. I do not understand what you want to do. I am not sure that the current production version of the BC SOAP still support the notifications (as you would like).
Hide
Christophe DENEUX added a comment - Thu, 6 Jan 2011 - 18:10:04 +0100

Netty,

Do you want to communicate with the ws-notification broker hoste by the SE Notification ? If yes, I think that perhaps you need to deploy a consume SU on the BC SOAP to expose the broker services to your external client.

Show
Christophe DENEUX added a comment - Thu, 6 Jan 2011 - 18:10:04 +0100 Netty, Do you want to communicate with the ws-notification broker hoste by the SE Notification ? If yes, I think that perhaps you need to deploy a consume SU on the BC SOAP to expose the broker services to your external client.
Hide
Netty Rajsiri added a comment - Thu, 6 Jan 2011 - 18:15:41 +0100

I just wanna to inform you this kind of problem happen and was initially reported by a partner who is using your product.

This problem does not concern the notification at all as the problem is not occurred at the notification level but in the way you add the xml message in the soap body for sending out.

It works fine with SOAPUI but not with an external java-based client.

Show
Netty Rajsiri added a comment - Thu, 6 Jan 2011 - 18:15:41 +0100 I just wanna to inform you this kind of problem happen and was initially reported by a partner who is using your product. This problem does not concern the notification at all as the problem is not occurred at the notification level but in the way you add the xml message in the soap body for sending out. It works fine with SOAPUI but not with an external java-based client.
Transition Status Change Time Execution Times Last Executer Last Execution Date
New New Inaccurate Inaccurate
18d 58m
1
noddoux
Mon, 24 Jan 2011 - 13:21:13 +0100