remove xml declaration in payload response

remove xml declaration in payload response

Content Index :

remove xml declaration in payload response
Tag : wso2 , By : kdietz
Date : November 24 2020, 05:47 AM

it fixes the issue I want remove xml declaration from wso response created by payload mediator (post method). , Try with setting messageType as follows.
<property name="messageType" scope="axis2" type="STRING" value="application/xml"/>

No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Move namespace declaration from payload to envelope on an axis created web service

Tag : web-services , By : hammer_1968
Date : March 29 2020, 07:55 AM
will be helpful for those in need Your provider is wrong, the messages are semantically equivalent; yours is unqualified, theirs is qualified. Are you using Axis or Axis2? If you're using Axis, I suggest you switch to Axis2 for a more robust, standards-compliant SOAP stack (both products are bad, but Axis2 is less-bad).
I assume you are creating your client with wsdl2java? If you can't get this tool to generate the message the way you like, then your best bet is to generate the message programmatically. With Axis2, you can do this with the AXIOM API. See this link for some example API usage. Note that with most of the methods, e.g. createOMElement, you optionally pass the namespace prefix. So, if your provider requires it, then you could pass a String containing "imk" as the namespacePrefix parameter.
QName port = new QName(endpoint, "subversionsoapservice-v2");
QName serviceName = new QName(endpoint, "ISubversionSoapServiceService");

Service service = Service.create(serviceName);
service.addPort(port, SOAPBinding.SOAP11HTTP_BINDING, endpoint);

Dispatch<SOAPMessage> dispatch = service.createDispatch(port, SOAPMessage.class, Service.Mode.MESSAGE);
MessageFactory factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
SOAPMessage request = factory.createMessage();
SOAPBody body = request.getSOAPBody();

SOAPElement reindexRepository = body.addChildElement("reindexRepository", "jira", "http://soap.ext.plugin.jira.atlassian.com");
SOAPElement in0 = reindexRepository.addChildElement("in0");

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
        <jira:reindexRepository xmlns:jira="http://soap.ext.plugin.jira.atlassian.com">

Mule variable declaration using set-payload vs expression component

Tag : development , By : Harry Truman
Date : March 29 2020, 07:55 AM
This might help you There is something wrong in your question.. You cannot declare a variable using set-payload... set-payload are used to override existing message payload .. You can set variable using
Now back to your question .. Yes there are 2 types of variable in Mule :-
<set-session-variable variableName="sessionId" value="#[message.id+’@’+mule.nodeId]" />
<expression-component>sessionVars.sessionId = message.id+'@'+mule.nodeId;</expression-component>

Express response payload on response finish

Tag : javascript , By : ugufugu
Date : March 29 2020, 07:55 AM
With these it helps res.on('finish') is called once the data has been sent, so the payload doesn't necessarily exist on the server any more. You can add middleware to express to intercept every request and then override the .json method to log the data as the function is called:
router.use('/', (req, res, next) => {
  var old = res.json.bind(res);
  res.json = (body) => {
    //Do whatever

removing extra xml declaration from the soap payload

Tag : xml , By : terrestrial
Date : March 29 2020, 07:55 AM
This might help you No standards-compliant XML or XSL tool will process your sample SOAP message, as it is malformed: there can only be one XML declaration in the file, and if there is a declaration, it must be the very first thing in the file -- not even whitespace can come before it.
I infer from this that your SOAP message is not being emitted by a compliant XML or XSL tool.
(>\s+)<\?xml [^>]+>

Spring WS - Looking for Request header/payload and Response header/payload Example

Tag : spring , By : user171752
Date : March 29 2020, 07:55 AM
With these it helps I have solved the issue. I can send the SOAP header to a service and extract the response header from response also. No need for interceptors.
Main help was from blog post from Andreas Veithen. .
public class ClientSamaAccountInformation extends WebServiceGatewaySupport {

    public ClientSamaAccountInformation() {

    public FIGetAcctsInfoCallBackRs sendRequest(FIGetAcctsInfoCallBackRq request, MsgHdrRq msgHdrRq) {

        WebServiceTemplate webServiceTemplate =  getWebServiceTemplate();
        try {
            ResponseAndHeader responseAndHeader = webServiceTemplate.sendAndReceive(Constants.WEBSERVICE_URL, 
                new WebServiceMessageCallback() {
                  public void doWithMessage(WebServiceMessage message) throws IOException {
                      try {
                          Jaxb2Marshaller marshallerRq = new Jaxb2Marshaller();


                          MarshallingUtils.marshal(marshallerRq, request, message);

                          SoapHeader soapHeader = ((SoapMessage)message).getSoapHeader();
                          JAXBContext context = JAXBContext.newInstance(MsgHdrRq.class);
                          Marshaller marshaller = context.createMarshaller();
                          marshaller.marshal(msgHdrRq, soapHeader.getResult());
                      } catch (Exception e) {
                new WebServiceMessageExtractor<ResponseAndHeader>() {
                  public ResponseAndHeader extractData(WebServiceMessage message) throws IOException {

                    //Extract response payload
                    FIGetAcctsInfoCallBackRs response = null;
                    try {
                        Jaxb2Marshaller marshallerRs = new Jaxb2Marshaller();
                        response = (FIGetAcctsInfoCallBackRs) MarshallingUtils.unmarshal(marshallerRs, message);

                    } catch (Exception e) {

                    //Extract response header
                    MsgHdrRs msgHdrRs = null;
                    try {
                        JAXBContext context = JAXBContext.newInstance(MsgHdrRs.class);
                        Unmarshaller unmarshaller = context.createUnmarshaller();

                        SoapHeader header = ((SoapMessage)message).getSoapHeader();
                        Iterator<SoapHeaderElement> it = header.examineHeaderElements(new QName("http://www.abc.def.com/common/Header", "MsgHdrRs"));
                        while(it.hasNext()) {
                            msgHdrRs = (MsgHdrRs) unmarshaller.unmarshal(it.next().getSource());

                    } catch (Exception e) {

                    return null;

            return null;
        } catch (Exception e) {
            return null;
Related Posts Related QUESTIONS :
Privacy Policy - Terms - Contact Us © scrbit.com