You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Be...@entega-service.de on 2008/07/10 15:39:41 UTC

webservice proxy uses fully qualified url for forwarding?

Good afternoon *,

I'm trying to get a web service proxy up and running, and I ran into some 
problems with this. This is my configuration:

<definitions xmlns="http://ws.apache.org/ns/synapse">
    <proxy name="WS_Customer_Control">
        <target>
            <inSequence>
                <log level="trace"/>
                <send>
                    <endpoint>
                        <address 
uri="http://ws001/soap/v1/WS_Customer_Control"/>
                    </endpoint>
                </send>
            </inSequence>
            <outSequence>
                <send/>
            </outSequence>
        </target>
        <publishWSDL uri="http://ws001/soap/v1/WS_Customer_Control?wsdl"/>
    </proxy>
</definitions>

When I invoke a request on that service, it forwards that request 
(unmodified), but the receiving server runs into an error. Wireshark gave 
me a hint on this:

POST http://ws001/soap/v1/WS_Customer_Control HTTP/1.1
Host: localhost:8280
SOAPAction: ""
Accept: application/soap+xml, application/dime, multipart/related, text/*
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: Keep-Alive
User-Agent: Synapse-HttpComponents-NIO

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">..[original 
content]..]</soapenv:Envelope>

The target host (ws001) is running an apache server, which forwards the 
request to a Tomcat (4.1.36) instance, and this server seems to have this 
problem:

No Context configured to process this request</u></p><p><b>description</b> 
<u>The server encountered an internal error (No Context configured to 
process this request) that prevented it from fulfilling this request.

It seems to have problems with the fully qualified url in the POST request 
(overriding the dubious host header, via <property scope="transport" 
name="Host" value="ws001"> changes nothing). After patching 
Axis2HttpRequestHeader class in a way that a "POST 
/soap/v1/WS_Customer_Control HTTP/1.1" is sent, everything works just 
fine.

Is there any hidden setting which I overlooked that forces synapse to use 
the absolute path instead of the fully qualified url in this post 
requests?

kind regards,
Bertram Fey

-- 

Bertram Fey

Portale und Web-Technologie

ENTEGA Service GmbH
Landwehrstraße 55
64293 Darmstadt

Telefon: +49 (0)6151 970-2045
Telefax: +49 (0)6151 970-2289
E-Mail: bertram.fey@entega-service.de
Internet: http://www.entega-service.de



ENTEGA Service - ein Unternehmen der HEAG Südhessischen Energie AG (HSE) 
und der Stadtwerke Mainz AG
..........................................................................................
ENTEGA Service GmbH
Geschäftsführung:            
Dipl.-Ing. Johannes Brüssermann (Sprecher)
Dipl.-Kfm. Volker Abert

Sitz der Gesellschaft: Mainz
Registergericht: Amtsgericht Mainz HRB 3950

   

Re: webservice proxy uses fully qualified url for forwarding?

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Bertram
> POST http://ws001/soap/v1/WS_Customer_Control HTTP/1.1
> Host: localhost:8280
> ....
> Is there any hidden setting which I overlooked that forces synapse to use 
> the absolute path instead of the fully qualified url in this post 
> requests?
>   
I have fixed the above issue on the trunk, 
https://issues.apache.org/jira/browse/SYNAPSE-397

Now you can tell Synapse if it should use the PATH or the full URL

asankha

-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com


Re: webservice proxy uses fully qualified url for forwarding?

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Bertram
>>> When I invoke a request on that service, it forwards that request
>>> (unmodified), but the receiving server runs into an error
>>>       
>> What exactly is the error? and whats the receiving system - is it .Net ?
>> Can it understand HTTP 1.1 (chunked encoding) or is it HTTP 1.0 only ?
>>     
>
> On the receiving system, the request hits an Apache (don't know which 
> version of it), which forwards it to a tomcat 4 installation using the ajp 
> connector. So it supports http 1.1/chunked encoding. Maybe it's 
> interesting to know that the service consumer application only speaks http 
> 1.0.
>   
Hmm.. but I guess that a problem between Apache -> Tomcat, and not 
related to the Synapse -> Apache interaction, but yes.. it is interesting..
>>> Wireshark gave me a hint on this:
>>>
>>> POST http://ws001/soap/v1/WS_Customer_Control HTTP/1.1
>>> Host: localhost:8280
>> I spot an error here.. the "Host: localhost:8280" is wrong.. is the host
>> "ws001" the same machine?.. anyway the port 8280 is wrong, ..
>>     
> No, it's not. The service consumer and the synapse installation are both 
> running on my local workspace machine. The service provider runs on ws001. 
> So the host header seems to be exactly what synapse receives from the 
> service consumer.
>   
No, unfortunately this is an error.. and we should not be propagating 
the "Host" header.. but according to the HTTP spec, if a full URL is 
given in the POST request, the receiving party should use that, and 
ignore the "Host" header - so the severity is less
> The error message seems to originate from the tomcat 4, on which the
> service is installed. It seems to have troubles figuring out the webapp 
> that should handle the request
The solution is to run tcpdump (or wireshark) or tcpmon or whatever tool 
between Apache -> Tomcat, and see whats different for a request through 
Synapse and something else..

asankha

Re: webservice proxy uses fully qualified url for forwarding?

Posted by Be...@entega-service.de.
Hi asankha,

> First of all, you need to subscribe to this mailing list (see
> http://synapse.apache.org/mail-lists.html) to receive our replies to
> your queries.. for now, I have explicitly copied this response to you..

Until know I've been using the RSS feed to read the list. Nonetheless, 
answering is much simpler with a subscrition. :)

>
>> When I invoke a request on that service, it forwards that request
>> (unmodified), but the receiving server runs into an error
> What exactly is the error? and whats the receiving system - is it .Net ?
> Can it understand HTTP 1.1 (chunked encoding) or is it HTTP 1.0 only ?

On the receiving system, the request hits an Apache (don't know which 
version of it), which forwards it to a tomcat 4 installation using the ajp 
connector. So it supports http 1.1/chunked encoding. Maybe it's 
interesting to know that the service consumer application only speaks http 
1.0.

>> Wireshark gave me a hint on this:
>>
>> POST http://ws001/soap/v1/WS_Customer_Control HTTP/1.1
>> Host: localhost:8280
>> SOAPAction: ""
>> Accept: application/soap+xml, application/dime, multipart/related, 
>> text/*
>> Pragma: no-cache
>> Cache-Control: no-cache
>> Content-Type: text/xml; charset=utf-8
>> Transfer-Encoding: chunked
>> Connection: Keep-Alive
>> User-Agent: Synapse-HttpComponents-NIO
>>
>> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">..[original
>> content]..]</soapenv:Envelope>
>>
> I spot an error here.. the "Host: localhost:8280" is wrong.. is the host
> "ws001" the same machine?.. anyway the port 8280 is wrong, ..

No, it's not. The service consumer and the synapse installation are both 
running on my local workspace machine. The service provider runs on ws001. 
So the host header seems to be exactly what synapse receives from the 
service consumer.

> [...]
> The "POST http://xxx HTTP/1.1" format is used when messages are sent
> through proxies, and this should not have any adverse effects on your
> Apache.. or is it the real backend service which complains? anyway let
> me know the environment that does not understand this form, and I will
> fix this issue ASAP

The error message seems to originate from the tomcat 4, on which the 
service is installed. It seems to have troubles figuring out the webapp 
that should handle the request. Unfortunately the target system runs an 
third party application, so we can't just switch over to a new tomcat 
version.

Bertram

-- 

Bertram Fey

Portale und Web-Technologie

ENTEGA Service GmbH
Landwehrstraße 55
64293 Darmstadt

Telefon: +49 (0)6151 970-2045
Telefax: +49 (0)6151 970-2289
E-Mail: bertram.fey@entega-service.de
Internet: http://www.entega-service.de



ENTEGA Service - ein Unternehmen der HEAG Südhessischen Energie AG (HSE) 
und der Stadtwerke Mainz AG
..........................................................................................
ENTEGA Service GmbH
Geschäftsführung:            
Dipl.-Ing. Johannes Brüssermann (Sprecher)
Dipl.-Kfm. Volker Abert

Sitz der Gesellschaft: Mainz
Registergericht: Amtsgericht Mainz HRB 3950

   

Re: webservice proxy uses fully qualified url for forwarding?

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Bertram

First of all, you need to subscribe to this mailing list (see 
http://synapse.apache.org/mail-lists.html) to receive our replies to 
your queries.. for now, I have explicitly copied this response to you..

> When I invoke a request on that service, it forwards that request 
> (unmodified), but the receiving server runs into an error
What exactly is the error? and whats the receiving system - is it .Net ? 
Can it understand HTTP 1.1 (chunked encoding) or is it HTTP 1.0 only ?
> Wireshark gave me a hint on this:
>
> POST http://ws001/soap/v1/WS_Customer_Control HTTP/1.1
> Host: localhost:8280
> SOAPAction: ""
> Accept: application/soap+xml, application/dime, multipart/related, text/*
> Pragma: no-cache
> Cache-Control: no-cache
> Content-Type: text/xml; charset=utf-8
> Transfer-Encoding: chunked
> Connection: Keep-Alive
> User-Agent: Synapse-HttpComponents-NIO
>
> <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">..[original 
> content]..]</soapenv:Envelope>
>   
I spot an error here.. the "Host: localhost:8280" is wrong.. is the host 
"ws001" the same machine?.. anyway the port 8280 is wrong, .. I will 
check if something went wrong in the code for the 1.2 release..
> The target host (ws001) is running an apache server, which forwards the 
> request to a Tomcat (4.1.36) instance, and this server seems to have this 
> problem:
>
> No Context configured to process this request</u></p><p><b>description</b> 
> <u>The server encountered an internal error (No Context configured to 
> process this request) that prevented it from fulfilling this request.
>
> It seems to have problems with the fully qualified url in the POST request 
> (overriding the dubious host header, via <property scope="transport" 
> name="Host" value="ws001"> changes nothing). After patching 
> Axis2HttpRequestHeader class in a way that a "POST 
> /soap/v1/WS_Customer_Control HTTP/1.1" is sent, everything works just 
> fine.
>
> Is there any hidden setting which I overlooked that forces synapse to use 
> the absolute path instead of the fully qualified url in this post 
> requests?
>   
No.. there is no hidden setting, but we can make one available for you.. 
if you can request for this enhancement in our JIRA here -> 
http://issues.apache.org/jira/browse/SYNAPSE

The "POST http://xxx HTTP/1.1" format is used when messages are sent 
through proxies, and this should not have any adverse effects on your 
Apache.. or is it the real backend service which complains? anyway let 
me know the environment that does not understand this form, and I will 
fix this issue ASAP

asankha
-- 
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com