What path should be for a HTTP listner in Mule 4 - mule4

I am new to Mule soft and I want to access below URLs using a path value in Mule 4. Below are the URLs.
http://localhost:8082/customer/status
http://localhost:8082/order/status

Related

Camel to route external REST web service

I'm working on spring MVC and using Apache camel to integrate external services.
I wanted to use Apache Camel route to make a Webservice call.
Like my local REST service (http://localhostsmiliex.xx:8080/users) fetching data from external REST service (http://xxx:000/users) and wanted routing to fetch external data.
Which Apache component would be suitable for a web-service route such as Jetty or producer template?
Have you tried HTTP4 or HTTP ?
http://camel.apache.org/http4.html
Use ProducerTemplate, it works like a charm for calling external endpoints REST, DB, SOAP etc..
You can either autowire it
#Autowired
ProducerTempalete prodcuerTemplate
prodcuerTemplate.sendBody("http://xyz...", "<hello>world!</hello>");
or
ProducerTemplate template = exchange.getContext().createProducerTemplate();
// send to default endpoint
template.sendBody("<hello>world!</hello>");
// send to a specific queue
template.sendBody("http://xyz...", "<hello>world!</hello>");

Spring Boot - Why it does not consider project name as context for the dispatcher servlet mapping

Just like Spring MVC when we used deploy the application in the servlet container it is used to pickup the project name as servlet context and then as per our servlet mapping the container will process the request.
Here my question is i created spring-boot rest application having crud operations and deployed in tomcat server. But when i try to access any url like [http://localhost:8080/findAllRecords] then the server return 404 error request url not found but i add extra / in the url[http://localhost:8080//findAllRecords] it successfully execute the request.

Requirements for the Spring Integration Http Outbound Adapter with ASP.Net

I have a CRM application that is using spring integration framework to send out updates to other systems. Currently the integration is running thru JMS, in which an xml message is sent to a JBossMQ queue. This needs to change so that a .Net application can handle the events.
In looking thru the vendor documentation, I found one option is to use an HTTP Adapter, excerpt here
HTTP Adapter Configuration
Ensure that the spring-integration-http-2.2.0.RELEASE.jar file is located in the folder /webapps/WEB-INF/lib.
Add the namespace and schema for the file adapter in the simple-file.xml with the relevant details:
<xmlns:si-http="http://www.springframework.org/schema/integration/http"
http://www.springframework.org/schema/integration/http
http://www.springframework.org/schema/integration/http/spring-integration-http-2.2.xsd>
Add the http outbound channel adapter configuration as follows:
<si-http:outbound-channel-adapter channel="<application_event>" order="2" url="${ http.url }" http-method="POST">
<si-http:request-handler-advice-chain>
</si-http:request-handler-advice-chain>
</si-http:outbound-channel-adapter>
• Channel: Set this value to the location that messages are published.
• Order: This refers to the priority when multiple adapters are configured.
• URL: The setting http.url (http://bfs-product-30:9090/ecmsi/case-events) Within the integration.properties file refers to the location where messages will be pushed and which http inbound adapter is configured to receive the
messages.
• Http-method: This refers to methods through which data is sent to consumer. E.g. Get/post etc..
• Retry: This is done by using
the defCircuitBreakerAdvice bean.
After googling this morning I am sure what the requirements are for the http adapter, all examples appear to be within a spring web application.
Can I create a asp.net .ashx application that reads the xml from the request object.

Is there a component in camel for a service built on Spring RestTemplate?

I have a REST Service running in Tomcat server. I created this REST Service using Spring RESTTemplate. So is there a component in CAMEL to use this exposed Web service?
i have used http component. i am aware that we cannot use http component to expose a service. So please let me know which component to use.Here is a detailed description of the problem.
Service created in rest Template runs in a server which you can see in from part of camel code
i use camel to expose this service to another http service and the response of this service is the response from the other service.
so my camel code looks like this:
from("http://localhost:8080/rest/emp/dummy").to(http://anotherweservice.com")
I get this error.
Failed to create route route1: Route(route1)[[From[]] -> [process[com.routes..... because of uri must be specified and not empty
Have a look at http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html.
Using the Jetty component, this looks as follows:
from("jetty:http://0.0.0.0:8080/myapp?matchOnUriPrefix=true")
.log("myapp: httpPath = ${header.CamelHttpPath}")
.to("jetty:http://localhost:8082/remoteapp?bridgeEndpoint=true&throwExceptionOnFailure=false")
In this example, the request is forwarded to another Jetty Camel endpoint:
from("jetty:http://0.0.0.0:8082/remoteapp?matchOnUriPrefix=true")
.log("remoteapp: httpPath = ${header.CamelHttpPath}")
.setBody(simple("${header.CamelHttpPath}"));
The HTTP path /hello/world is transfered to the endpoint, as can be seen when the service is invoked with http://localhost:8080/myapp/hello/world. In this case the body /hello/world is returned. And in the log it says:
INFO myapp: httpPath = /hello/world
INFO remoteapp: httpPath = /hello/world

HTTP Error 500.0 - Internal Server Error in Secure WCF Service

Getting following error after hosting WCF Service in IIS.
HTTP Error 500.0 - Internal Server Error. The page cannot be displayed
because an internal server error has occurred.
Module IsapiModule
Notification ExecuteRequestHandler
Handler svc-ISAPI-4.0_32bit
Error Code 0x00000000
It is HTTPS having a secure certificate WCF Service.
Please help me to solve this problem.
It can be caused by many different things. You should try the following solutions:
1 First way
Right click the folder where your site is located: "C:\Users\NAME\SiteName" and select Properties.
Select the Security tab and click on Edit.
Add.. and type in "IIS_IUSRS".
2 Second way
By default, WCF Service OperationContracts can only be invoked using an HTTP POST. When you call open() on the Titanium HTTPClient, are you specifying a GET or POST for HTTP method parameter?
Secondly, since your service binding is using SOAP 1.1, you need to pass a SOAPAction header in your request so that WCF can route the message to the GetData method. If an Action parameter is not specified in the service's OperationContract attribute, the Action should be the method name preceded by the namespace and service contract name (probably http://tempuri.org/IService1/GetData if you're using what the default WCF application created). You'll also need to specify a content-type. So, you'd need to setup your xhr like this prior to calling send:
xhr.setRequestHeader('Content-Type', 'text/xml; charset=utf-16');
xhr.setRequestHeader('SOAPAction',
'"http://tempuri.org/IService1/GetData"'); xhr.send(s); Also, you can
explicitly specify an action for a WCF service operation:
[OperationContract(Action = "MyAction")] string GetData() {
// ...snip... }
xhr.setRequestHeader('SOAPAction', '"MyAction"');
And lastly, you can allow service operations to be invoked via an HTTP GET by decorating the method with the [WebGet] attribute. This allows the operation to be called in REST fashion: http://msdn.microsoft.com/en-us/library/system.servicemodel.web.webgetattribute.aspx

Resources