You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Wermus Fernando <fe...@xlnet.net.ar> on 2003/09/29 16:27:26 UTC

a simple pipeline and a javascript client

                    <map:match pattern="xmlservice2">
                           <map:generate type="stream"/>
                           <map:serialize type="xml"/>
                    </map:match>
 
 
Hi!
            I have this pipeline that it´s like a repeater. I wanna to get
the same message that I send, but It returns me a 404 http error, and I
don´t know why.
 
Ps: The message is a soap message, but It´s only like any message, this
pipeline only returns the message sent.
 
Thanks!
 
I will wait an answer!
            
 
<html>
<head>
<script languaje="javascript">
function enviar(){
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
 
search="Word"
 xmlhttp.open("POST", "http://127.0.0.1:8080/cocoon-soap/test",true);
 xmlhttp.onreadystatechange=function() {
  if (xmlhttp.readyState==4) {
   alert(xmlhttp.responseText)
  }
 }
 xmlhttp.setRequestHeader("Man", "POST
http://127.0.0.1:8080/cocoon-soap/test HTTP/1.1")
 xmlhttp.setRequestHeader("MessageType", "CALL")
 xmlhttp.setRequestHeader("Content-Type", "text/xml")
 
 
var miSoap='<?xml version="1.0" encoding="UTF-8"?> \n' +
                           '<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"> \n'+
                           '<SOAP-ENV:Body> \n' +
                           '<ns1:getQuote
xmlns:ns1="urn:xmethods-delayed-quotes"> \n' +
                           '<symbol xsi:type="xsd:string">IBM</symbol> \n' +
                           '</ns1:getQuote> \n' +
                           '</SOAP-ENV:Body> \n' +
                           '</SOAP-ENV:Envelope>';
alert(miSoap);
xmlhttp.send(miSoap);
}
</script>
</head>
<body>
<input type="button" onclick="enviar()" value="enviar">
</body>
</html>

Re: a simple pipeline and a javascript client

Posted by Upayavira <uv...@upaya.co.uk>.
Wermus,

You're posting to http://127.0.0.1:8080/cocoon-soap/test

But your matcher matched xmlservice2.

You need to have a matcher to match the URL you post to, e.g. 
pattern="cocoon-soap/test" or maybe just pattern="test", depending upon 
your setup.

Regards, Upayavira

Wermus Fernando wrote:

>                     <map:match pattern="xmlservice2">
>
>                            <map:generate type="stream"/>
>
>                            <map:serialize type="xml"/>
>
>                     </map:match>
>
>  
>
>  
>
> Hi!
>
>             I have this pipeline that it´s like a repeater. I wanna to 
> get the same message that I send, but It returns me a 404 http error, 
> and I don´t know why.
>
>  
>
> Ps: The message is a soap message, but It´s only like any message, 
> this pipeline only returns the message sent.
>
>  
>
> Thanks!
>
>  
>
> I will wait an answer!
>
>            
>
>  
>
> <html>
>
> <head>
>
> <script languaje="javascript">
>
> function enviar(){
>
> var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
>
>  
>
> search="Word"
>
>  xmlhttp.open("POST", "http://127.0.0.1:8080/cocoon-soap/test",true);
>
>  xmlhttp.onreadystatechange=function() {
>
>   if (xmlhttp.readyState==4) {
>
>    alert(xmlhttp.responseText)
>
>   }
>
>  }
>
>  xmlhttp.setRequestHeader("Man", "POST 
> http://127.0.0.1:8080/cocoon-soap/test HTTP/1.1")
>
>  xmlhttp.setRequestHeader("MessageType", "CALL")
>
>  xmlhttp.setRequestHeader("Content-Type", "text/xml")
>
>  
>
>  
>
> var miSoap='<?xml version="1.0" encoding="UTF-8"?> \n' +
>
>                            '<SOAP-ENV:Envelope 
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
> xmlns:xsd="http://www.w3.org/1999/XMLSchema"> \n'+
>
>                            '<SOAP-ENV:Body> \n' +
>
>                            '<ns1:getQuote 
> xmlns:ns1="urn:xmethods-delayed-quotes"> \n' +
>
>                            '<symbol xsi:type="xsd:string">IBM</symbol> 
> \n' +
>
>                            '</ns1:getQuote> \n' +
>
>                            '</SOAP-ENV:Body> \n' +
>
>                            '</SOAP-ENV:Envelope>';
>
> alert(miSoap);
>
> xmlhttp.send(miSoap);
>
> }
>
> </script>
>
> </head>
>
> <body>
>
> <input type="button" onclick="enviar()" value="enviar">
>
> </body>
>
> </html>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org