• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Adding payload to SOAP body

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

Am trying to add a hard coded payload to a SOAP message - but it's escaping the < and > characters in the payload to & lt ; and & gt ;


SOAP envelope before adding child payload

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body>soapenv:Body></soapenv:Envelope>

from this code: -



Add the payload to the SOAP envelope



gives this SOAP message

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body>& lt ;GetMyWebMethod xmlns='http://www.test.com/testGateway/' /& gt ;</soapenv:Body></soapenv:Envelope>

The SOAP message I want is: -

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><GetMyWebMethod xmlns='http://www.test.com/testGateway/' />;</soapenv:Body></soapenv:Envelope>

Any idea how to solve?

thanks
Matthew
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try using one of the fac.createOMElement(...) methods on your 'fac' object instead of createOMText(...). It looks like they've sort of reinvented DOM parsing with this Axiom API to some extent.

If you spend a few minutes and study the API documentation for your OMNode class here: http://ws.apache.org/axiom/apidocs/index.html?overview-summary.html

You will see there are constants defined in the interface that indicate what type of Node the implementing instance will be. These are commonly defined XML node types and each will be treated differently according to XML specs. If you are creating a text node and trying to add that to the body of your envelope, the Axiom framework will rightly treat it as plain text containing characters that must be escaped according to XML specification.
 
WARNING! Do not activate jet boots indoors or you will see a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic