5

I ran this Mule 3 file expecting that when I browse to http://localhost:9000, I would be redirected to http://localhost/path (source - behind a login prompt):

<?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:pattern="http://www.mulesoft.org/schema/mule/pattern"
      xsi:schemaLocation="
          http://www.mulesoft.org/schema/mule/pattern http://www.mulesoft.org/schema/mule/pattern/3.1/mule-pattern.xsd
          http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd">

    <pattern:web-service-proxy
        name="WSProxyService"
        inboundAddress="http://localhost:9000"
        outboundAddress="http://localhost/sugarcrm"/>

</mule>

Instead, I get this unfriendly message from the web browser:

‹mO=OÃ0Ýó+ŽL0KÂÈX‚&ˆJ-DÂŒ×øÀ•ì8rÜJý÷8)bb9éî}Ü{â¢y[©Ï®…µÝ@÷ñ´Y¯ ¿F\·ê±QÍ©‹±}Íe&LtV äÓ÷Ѳ¼)+Øú#kè88xˆö$ðf²Øy}šõ•ü‡›®™¥2Ú÷—Î`h·P  üõ›Ç{Dë{²ÆO§Ã7…>8Ì¥áÀIÇùOHƒ´
tshepang
  • 12,111
  • 21
  • 91
  • 136

2 Answers2

6

The web-service-proxy pattern is designed to work with SOAP-style web services. Pointing your browser to it won't do you any good.

For pure HTTP proxying either:

  • use the new pattern:http-proxy coming in Mule 3.2 and already usable in snapshot builds (examples),
  • use a pattern:bridge with HTTP in and out endpoints (examples).

The former is a much better option, if you're not snapshot averse, as it has extended support for HTTP requests semantics and an upcoming caching module.

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • Is it enough that I add `wsdlLocation="http://localhost/path?wsdl"` to enable SOAP-style web service inside the `pattern` element? – tshepang Jul 01 '11 at 19:42
  • 3
    By default the web-service-proxy pattern gets the WSDL from outboundAddress+"?wsdl" so you need to specify wsdlLocation only if the WSDL is not at the default location. – David Dossot Jul 01 '11 at 19:49
1

I've had a similar problem, although I used soapUI to perform the test. The solution after some days getting lost is simple, configure soapUI not to use/don't allow compression. What you see is actually compressed answer that server did not mark as compressed.

Laci Kosco
  • 61
  • 1
  • 7