You could also look at Axis2 which was designed to support sending XML bodies simply using the ServiceClient API.
Paul On Feb 11, 2008 10:51 AM, WJ Krpelan <[EMAIL PROTECTED]> wrote: > > Hi, > Its very clear that we have a technical problem when > deserializing cause the second ns1:"" overwrites the > first. My question is how this serialization comes > about? AXIS 1.4 wasnt built with sending arbitrary > XML-Messages around in mind. I'd suggest start anew > with a WSDL-first approach. > Cheers Wolfgang > > > --- Ryan Champlin <[EMAIL PROTECTED]> wrote: > > > All, > > I'm also running into the same exact issue as this > > prior post (below) to this mailing list. Are there > > any resolutions out there for this???? > > This issue is preventing Axis clients as well as > > others from properly consuming the response SOAP > > document. I need a resolution or proper workaround > > for this issue. > > > > Thanks, > > Ryan > > > > > > > > Hi All, > > > > I've been struggling with the following error that > > has > > to do with deserializing a soapEnvelope, can anyone > > help? Thanks much. > > > > Frank > > > ===================================================== > > I am using AXIS 1.4 for my web service needs. I try > > to > > send an XML message over HTTP, the XML message > > defines > > a namespace at the root element like this: > > > > xmlns:ns1="somthing" > > > > Let me assume this xml string as xmltext, now I > > create > > a soap envelope with this XML message as body, the > > soapEnvelope object seems good to me in my debugger, > > > > but a problem occurs when I try to deserialize it > > using soapEnvelope.toString() or > > soapEnvelope.getAsString().I notice that for every > > local element in the original xml such as this: > > > > <ns1:rec>xxx</ns1:rec>, > > > > in the output string, I get the the following: > > > > <ns1:rec xmlns:ns1="">xxx</ns1:rec> > > > > That is, there is an extra attribute with empty > > value. > > This causes problems for the receivers of the http > > response. > > > > Here is the soapEnvelope dump: > > > > <soapenv:Envelope > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > <soapenv:Body> > > <ns1:RecordSet > > xmlns:ns1="http://xxxx.com/yyy_out" > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > > > > <ns1:Record xmlns:ns1=""> > > <ns1:PROSPECT_NUMBER > > xmlns:ns1="">10</ns1:PROSPECT_NUMBER> > > <ns1:FIRM xmlns:ns1="">Business > > Objects</ns1:FIRM> > > <ns1:FIRST_NAME > > xmlns:ns1="">Ryan</ns1:FIRST_NAME> > > <ns1:MIDDLE_NAME xmlns:ns1=""/> > > <ns1:LAST_NAME > > xmlns:ns1="">Champlin</ns1:LAST_NAME> > > </ns1:Record> > > </ns1:RecordSet> > > </soapenv:Body> > > </soapenv:Envelope> > > > > Here are my code snappet: > > > > =================================================== > > SOAPEnvelope soapEnvelope = new SOAPEnvelope(); > > Element bodyElement = > > createDocument(xmltext).getDocumentElement(); > > org.apache.axis.message.SOAPBodyElement > > messageElement = new > > > org.apache.axis.message.SOAPBodyElement(bodyElement); > > > > > soapEnvelope.addBodyElement((SOAPBodyElement)messageElement); > > > > The createDocument(xmlText) calls the following > > APIs: > > > > InputSource source = new InputSource( new > > StringReader( xmlText ) ) ; > > DocumentBuilderFactory factory = > > DocumentBuilderFactory.newInstance(); > > > > > > factory.setIgnoringElementContentWhitespace(false); > > DocumentBuilder docBuilder = > > factory.newDocumentBuilder(); > > return docBuilder.parse(source); > > > > > > > > > ____________________________________________________________________________________ > > Be a better friend, newshound, and > > know-it-all with Yahoo! Mobile. Try it now. > > > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ > > > > > > > > > ____________________________________________________________________________________ > Looking for last minute shopping deals? > Find them fast with Yahoo! Search. > http://tools.search.yahoo.com/newsearch/category.php?category=shopping > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Paul Fremantle Co-Founder and VP of Technical Sales, WSO2 OASIS WS-RX TC Co-chair blog: http://pzf.fremantle.org [EMAIL PROTECTED] "Oxygenating the Web Service Platform", www.wso2.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
