dev@jax-ws.java.net

Re: StreamMessage.copy() for multiple parts in a SOAP message body

From: LeRoy Hall <leroy_e_hall_at_yahoo.com>
Date: Mon, 8 Jan 2007 08:29:32 -0800 (PST)

FYI - Similarly there is a problem with jax-ws consuming a wsdl where a message is defined to have multiple parts.
   
  For example, the following parts of a wsdl will cause jax-ws to fail when generating artifacts:
   
  <wsdl:message name="someMsgNameInput">
    <wsdl:part name="Header" element="someElementName"/>
    <wsdl:part name="Message" element="someElementName"/>
  </wsdl:message>
  ...
  <wsdl:portType name="SomePortType">
    <wsdl:operation name="someOperation">
      <wsdl:input message="intf:someMsgNameInput"/>
      <wsdl:output message="intf:someMsgNameOutput"/>
    </wsdl:operation>
  </wsdl:portType>
  ...
   
  

Vivek Pandey <Vivek.Pandey_at_Sun.COM> wrote:
  Hi Paul/Kohsuke,

There is an issue regarding jaxws not able to consume SOAP message body
having multiple parts. For example message such as :


xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">






This should work atleast for Dispatch and
Provider mode given there is no intermediate message
conversion other than to SAAJMessage etc.

With some changes its kind of working except when there is a DumpTube,
which calls StreamMessage.copy(). This is what I am trying to do inside
StreamMessage.copy():

-----
MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
StreamReaderBufferCreator c = new
StreamReaderBufferCreator(xsb);

//write all the soapenv:Body parts
while(reader.getEventType() !=
XMLStreamConstants.END_DOCUMENT){
String name = reader.getLocalName();
String nsUri = reader.getNamespaceURI();
if(name.equals("Body") &&
nsUri.equals(soapVersion.nsUri) || (reader.getEventType() ==
XMLStreamConstants.END_DOCUMENT))
break;

c.create(reader);
}

reader = xsb.readAsXMLStreamReader();
clone = xsb.readAsXMLStreamReader();

------

Above I assume that c.create() will append the second body part to the
document being created. Meaning when I do nextTag() in a loop till
END_DOCUMENT event is reach I will get 2 tages. Latter on when I get
StreamReaderBufferProcessor from XMLStreamBuffer, then while reading the
elements from it I will get both the body parts.

Problem is that when I read latter from StreamReaderBufferProcessor, it
gives me only one body part. After reading the first element it gives
the next event as END_DOCUMENT and somehow does not give me the second
one, even though it was written on the XMLStreamBuffer.

What do I need to do to get such functionality?

-vivek.





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_jax-ws.dev.java.net
For additional commands, e-mail: dev-help_at_jax-ws.dev.java.net



 __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com