Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6953285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:27:32+00:00 2026-05-27T14:27:32+00:00

I need to send some post data to another server in mule 3.1.2. Here

  • 0

I need to send some post data to another server in mule 3.1.2. Here is my mule-config file:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:rmi="http://www.mulesoft.org/schema/mule/rmi" xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xsi:schemaLocation="
      http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
      http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.1/mule-scripting.xsd
      http://www.mulesoft.org/schema/mule/rmi http://www.mulesoft.org/schema/mule/rmi/3.1/mule-rmi.xsd
      http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
      http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/3.1/mule-stdio.xsd
      http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.1/mule-vm.xsd">

    <flow name="cxfFlow">
        <!-- Accept a http request from the specific address -->
        <http:inbound-endpoint address="http://localhost:5678/httpHello">
            <byte-array-to-string-transformer/>
            <http:body-to-parameter-map-transformer/>
        </http:inbound-endpoint>

        <!-- This component is just set to show the message accecpted from the request -->
        <scripting:component>
            <scripting:script engine="groovy">
                def msg = "message: $message;\npayload:$payload;\n result:$result".toString()
                println msg
                println "init param:$payload"
                return payload
            </scripting:script>
        </scripting:component>

        <!-- This component is set to parse the parameter passed by the request -->
        <scripting:component>
            <scripting:script engine="groovy">
                    def paramstr = ""
                    for( param in payload){
                        paramstr = paramstr + "&amp;" + param.key+ "=" + param.value
                    }
                println "querystr:$paramstr"
                return paramstr.substring(1)
            </scripting:script>
        </scripting:component>

        <choice>
            <when expression="payload.size()>0" evaluator="groovy">
                <http:outbound-endpoint address="http://localhost:8080/webproj/index.jsp" method="POST" contentType="text/http">
                </http:outbound-endpoint>
            </when>
            <otherwise>
                <scripting:component>
                    <scripting:script engine="groovy">
                        println payload
                        return "no parameter is given!"
                    </scripting:script>
                </scripting:component>
            </otherwise>
        </choice>
    </flow>
</mule>

I make a post request to http://localhost:5678/httpHello , and send some parameters. In the http://localhost:8080/webproj/index.jsp page, I examine the parameter I received, but the parameter is empty. I want to receive parameters sent in the beginning in the index.jsp page, how to change my mule-config file? Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:27:32+00:00Added an answer on May 27, 2026 at 2:27 pm

    Assuming the inbound and outbound HTTP content-types are application/x-www-form-urlencoded, here is a configuration that does what you want (ie. logging the payload and choosing a different response based on the presence of parameters):

    <flow name="webFormFlow">
        <!-- Accept a http request from the specific address -->
        <http:inbound-endpoint address="http://localhost:5678/httpHello">
            <http:body-to-parameter-map-transformer />
        </http:inbound-endpoint>
    
        <!-- This logger is just set to show the message accepted from the request -->
        <logger level="INFO" message="#[payload]" />
    
        <choice>
            <when expression="payload.size() &gt; 0" evaluator="groovy">
                <http:outbound-endpoint address="http://localhost:8080/webproj/index.jsp"
                    method="POST" contentType="application/x-www-form-urlencoded" />
            </when>
            <otherwise>
                <message-properties-transformer>
                    <add-message-property key="Content-Type" value="text/plain" />
                </message-properties-transformer>
                <expression-transformer>
                    <return-argument expression="no parameter is given!"
                        evaluator="string" />
                </expression-transformer>
            </otherwise>
        </choice>
    </flow>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to send some of my data into another server. Actually to post
I need to POST some XML data to a remote server for processing. The
I have to make a HTTPS Post with some XML data, but I need
Hi i need to post some data to a web server from windows phone
I want to send some data to a server through POST method in android.
i need to send raw multipart data with a php POST but without an
I need to send HTTP POST data to a webpage. My host is missing
From a webpage, I need to send JSON data using POST method to a
I need to send a group of checkboxes (with some other data as well)
I need to send some information on a VxWorks message queue. The information to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.