You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Chris Taylor <sa...@yahoo.com> on 2008/10/31 19:18:24 UTC

REST Post issue

A service we are invoking from a bpel implements a REST Post operation.

This is failing for us with a 400 response error.  After some digging into the problem, it seems that our request header is a) not sending the Host header and/or b) not setting the Post URI correctly.

the request/response headers:

POST http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
Request Headers:
Accept: text/xml
Request Entity:
Content-Type:text/xml; charset=ISO-8859-1
Content-Length:459
Content-Charset:ISO-8859-1
Request Entity:
<?xml version="1.0" encoding="UTF-8"?>
<DiagnosisLookup xmlns="http://tempuri.org/">
<MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
<SearchText xmlns="">100.8</SearchText>
<SearchType xmlns="">Full</SearchType>
<CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
</DiagnosisLookup>

POST http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
Status-Line: HTTP/1.1 400 Bad Request
Response Headers: 
Date: Fri, 31 Oct 2008 18:09:50 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Length: 0
 
when i send the same request, via soapui but modify the request header to say:
 
POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
Host: ccswsappsrv-v3-test.uhc.com
 
I get the desired REST http 200 response.  are these request header settings configurable in the Axis2 layer?  What settings would they be?


      

Re: REST Post issue

Posted by Alex Boisvert <bo...@intalio.com>.
Sorry, I didn't read your question properly and didn't understand you were
invoking from Ode to another WS.

Please disregard my mumblings :)

alex

On Fri, Oct 31, 2008 at 12:27 PM, Alex Boisvert <bo...@intalio.com>wrote:

> It might be worth a shot to post on the axis2 mailing list.   I'm also
> suspecting this behavior might be specific to the servlet engine since
> that's where most of the HTTP protocol processing happens.
>
> alex
>
>
>
> On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
>> A service we are invoking from a bpel implements a REST Post operation.
>>
>> This is failing for us with a 400 response error.  After some digging into
>> the problem, it seems that our request header is a) not sending the Host
>> header and/or b) not setting the Post URI correctly.
>>
>> the request/response headers:
>>
>> POST
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Request Headers:
>> Accept: text/xml
>> Request Entity:
>> Content-Type:text/xml; charset=ISO-8859-1
>> Content-Length:459
>> Content-Charset:ISO-8859-1
>> Request Entity:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <DiagnosisLookup xmlns="http://tempuri.org/">
>> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
>> <SearchText xmlns="">100.8</SearchText>
>> <SearchType xmlns="">Full</SearchType>
>> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
>> </DiagnosisLookup>
>>
>> POST
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Status-Line<http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line>:
>> HTTP/1.1 400 Bad Request
>> Response Headers:
>> Date: Fri, 31 Oct 2008 18:09:50 GMT
>> Server: Microsoft-IIS/6.0
>> X-Powered-By: ASP.NET
>> X-AspNet-Version: 2.0.50727
>> Cache-Control: private
>> Content-Length: 0
>>
>> when i send the same request, via soapui but modify the request header to
>> say:
>>
>> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Host: ccswsappsrv-v3-test.uhc.com
>>
>> I get the desired REST http 200 response.  are these request header
>> settings configurable in the Axis2 layer?  What settings would they be?
>>
>>
>>
>
>
>

Re: REST Post issue

Posted by Alex Boisvert <bo...@intalio.com>.
It might be worth a shot to post on the axis2 mailing list.   I'm also
suspecting this behavior might be specific to the servlet engine since
that's where most of the HTTP protocol processing happens.

alex


On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:

> A service we are invoking from a bpel implements a REST Post operation.
>
> This is failing for us with a 400 response error.  After some digging into
> the problem, it seems that our request header is a) not sending the Host
> header and/or b) not setting the Post URI correctly.
>
> the request/response headers:
>
> POST
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Request Headers:
> Accept: text/xml
> Request Entity:
> Content-Type:text/xml; charset=ISO-8859-1
> Content-Length:459
> Content-Charset:ISO-8859-1
> Request Entity:
> <?xml version="1.0" encoding="UTF-8"?>
> <DiagnosisLookup xmlns="http://tempuri.org/">
> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> <SearchText xmlns="">100.8</SearchText>
> <SearchType xmlns="">Full</SearchType>
> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> </DiagnosisLookup>
>
> POST
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Status-Line<http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line>:
> HTTP/1.1 400 Bad Request
> Response Headers:
> Date: Fri, 31 Oct 2008 18:09:50 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> X-AspNet-Version: 2.0.50727
> Cache-Control: private
> Content-Length: 0
>
> when i send the same request, via soapui but modify the request header to
> say:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Host: ccswsappsrv-v3-test.uhc.com
>
> I get the desired REST http 200 response.  are these request header
> settings configurable in the Axis2 layer?  What settings would they be?
>
>
>

Re: REST Post issue

Posted by Assaf Arkin <ar...@intalio.com>.
The sane default on the Web is UTF-8. We should change it so UTF-8 is
used by default.

Assaf

On Wed, Nov 5, 2008 at 11:53 AM, Alexis Midon <mi...@intalio.com> wrote:
> Hi Chris,
>
> first all let me give you more implementation details: if you're invoking
> Soap-bound services, ODE uses Axis2 but if you're invoking HTTP-bound
> services, ODE uses plain commons-httpclient, bypassing Axis2.
>
> In your case, base on the logs you got, I assume you're using an HTTP-bound
> service. So Axis2 is not involved *at all*.
> So what you could try is to customize your endpoint with the property file
> described in the user-guide [1]
>
> The property to set is:
> http.protocol.content-charset=bla
>
> To make sure, this property is taken into account, you might want to set to
> DEBUG the following log category:
> org.apache.ode.axis2.httpbinding.HttpMethodConverter
>
> You will get a message built on this template:
> log.debug("Content-Type [" + contentType + "] Charset [" + contentCharset +
> "]");
>
> Let me know how it works.
>
> Alexis
>
> [1] http://ode.apache.org/user-guide.html#UserGuide-EndpointConfiguration
>
>
>
> On Thu, Nov 6, 2008 at 10:17 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
>> Good advice.  I ran the new REST request (from ODE) through a TCP/IP
>> monitor and compared it with the identical request through a service client
>> (soapui - though without soap envelope wrapping, just straight http post).
>>
>> The only distinction between the one that works and the one that fails (the
>> ODE invocation) seems to be in the character encoding.  ODE is encoding
>> using ISO character set.  Can this be reconfigured?  It does not seem from
>> the Axis2 guidance that this can be configured for the transportsender in
>> the Axis2 configuration.  Any advice?
>>
>> succesful request header:
>>
>> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
>> Content-Type: text/xml;charset=UTF-8
>> SOAPAction: "
>> http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode
>> "
>> User-Agent: Jakarta Commons-HttpClient/3.0.1
>> Host: ccswsappsrv-v3-test.uhc.com
>> Content-Length: 459
>>
>> failed request header:
>>
>> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
>> Accept: text/xml
>> User-Agent: Jakarta Commons-HttpClient/3.0
>> Host: ccswsappsrv-v3-test.uhc.com
>> Content-Length: 459
>> Content-Type: text/xml; charset=ISO-8859-1
>>
>>
>>
>>
>> ________________________________
>> From: Alexis Midon <mi...@intalio.com>
>> To: user@ode.apache.org
>> Sent: Friday, October 31, 2008 2:35:00 PM
>> Subject: Re: REST Post issue
>>
>> Hi Chris,
>>
>> may I ask you where you got these headers from?
>> I guess you got them from the ODE log, the previous line being: "DEBUG -
>> GeronimoLog.debug(66) | HTTP Request Details: "
>> right?
>>
>> So this information is logged by ODE for debugging purpose. The log message
>> is built from the HttpClient request [1] but is not supposed to be HTTP
>> compliant [2]. That's commons-httpclient's job. So we can't conclude
>> neither
>> a) or b).
>> This applies to the response too.
>>
>> I tried to figure out which log category activate to get the request as
>> sent
>> by HttpClient, but no such category exists :(
>>
>> So you should try to get the request from the targetted server log or use a
>> tcp tunnel-like.
>>
>> Alexis
>>
>>
>> [1] org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<
>> http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup
>> >
>> [2] I agree that this could be misleading. Please create an improvement in
>> Jira <https://issues.apache.org/jira/browse/ODE>.
>>
>>
>>
>>
>> On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:
>>
>> > A service we are invoking from a bpel implements a REST Post operation.
>> >
>> > This is failing for us with a 400 response error.  After some digging
>> into
>> > the problem, it seems that our request header is a) not sending the Host
>> > header and/or b) not setting the Post URI correctly.
>> >
>> > the request/response headers:
>> >
>> > POST
>> >
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> > Request Headers:
>> > Accept: text/xml
>> > Request Entity:
>> > Content-Type:text/xml; charset=ISO-8859-1
>> > Content-Length:459
>> > Content-Charset:ISO-8859-1
>> > Request Entity:
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <DiagnosisLookup xmlns="http://tempuri.org/">
>> > <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
>> > <SearchText xmlns="">100.8</SearchText>
>> > <SearchType xmlns="">Full</SearchType>
>> > <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
>> > </DiagnosisLookup>
>> >
>> > POST
>> >
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> > Status-Line<
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line
>> >:
>> > HTTP/1.1 400 Bad Request
>> > Response Headers:
>> > Date: Fri, 31 Oct 2008 18:09:50 GMT
>> > Server: Microsoft-IIS/6.0
>> > X-Powered-By: ASP.NET
>> > X-AspNet-Version: 2.0.50727
>> > Cache-Control: private
>> > Content-Length: 0
>> >
>> > when i send the same request, via soapui but modify the request header to
>> > say:
>> >
>> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> > Host: ccswsappsrv-v3-test.uhc.com
>> >
>> > I get the desired REST http 200 response.  are these request header
>> > settings configurable in the Axis2 layer?  What settings would they be?
>> >
>> >
>> >
>>
>>
>>
>>
>>
>

Re: REST Post issue

Posted by Alexis Midon <mi...@intalio.com>.
well that's a bug. Sorry about that.
could you please create an issue?
https://issues.apache.org/jira/secure/CreateIssue!default.jspa

I'll fix it asap.


Alexis


On Thu, Nov 6, 2008 at 1:43 PM, Chris Taylor <sa...@yahoo.com> wrote:

> Thanks, Alexis, this seems to make sense.
>
> I have created the necessary *.endpoint configuration file (called it
> configuration.endpoint) and placed it in ode's WEB-INF/conf folder.  I set
> the correct setting (wasn't sure what exactly it was given the property name
> conflict between what you said below and what is in the documentation) as
> follows:
> http.protocol.content-charset=UTF-8
> http.protocol.encoding=UTF-8
> It did not get picked up.  I'm running ODE 1.2.1 (latest trunk build from ~
> 2 weeks ago).  Not sure why it did not get picked up, so I rebooted the App
> server and still nothing.  I then set these configuration settings in an
> endpoint-configuration.properties file in the process' deployment folder
> (the old configuration style) and still did not get picked up.
>
> Am I misinterpreting the user guide on this?
>
>
>
>
>
> ________________________________
> From: Alexis Midon <mi...@intalio.com>
> To: user@ode.apache.org
> Sent: Thursday, November 6, 2008 3:53:40 AM
> Subject: Re: REST Post issue
>
> Hi Chris,
>
> first all let me give you more implementation details: if you're invoking
> Soap-bound services, ODE uses Axis2 but if you're invoking HTTP-bound
> services, ODE uses plain commons-httpclient, bypassing Axis2.
>
> In your case, base on the logs you got, I assume you're using an HTTP-bound
> service. So Axis2 is not involved *at all*.
> So what you could try is to customize your endpoint with the property file
> described in the user-guide [1]
>
> The property to set is:
> http.protocol.content-charset=bla
>
> To make sure, this property is taken into account, you might want to set to
> DEBUG the following log category:
> org.apache.ode.axis2.httpbinding.HttpMethodConverter
>
> You will get a message built on this template:
> log.debug("Content-Type [" + contentType + "] Charset [" + contentCharset +
> "]");
>
> Let me know how it works.
>
> Alexis
>
> [1] http://ode.apache.org/user-guide.html#UserGuide-EndpointConfiguration
>
>
>
> On Thu, Nov 6, 2008 at 10:17 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
> > Good advice.  I ran the new REST request (from ODE) through a TCP/IP
> > monitor and compared it with the identical request through a service
> client
> > (soapui - though without soap envelope wrapping, just straight http
> post).
> >
> > The only distinction between the one that works and the one that fails
> (the
> > ODE invocation) seems to be in the character encoding.  ODE is encoding
> > using ISO character set.  Can this be reconfigured?  It does not seem
> from
> > the Axis2 guidance that this can be configured for the transportsender in
> > the Axis2 configuration.  Any advice?
> >
> > succesful request header:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> > Content-Type: text/xml;charset=UTF-8
> > SOAPAction: "
> >
> http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode
> > "
> > User-Agent: Jakarta Commons-HttpClient/3.0.1
> > Host: ccswsappsrv-v3-test.uhc.com
> > Content-Length: 459
> >
> > failed request header:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> > Accept: text/xml
> > User-Agent: Jakarta Commons-HttpClient/3.0
> > Host: ccswsappsrv-v3-test.uhc.com
> > Content-Length: 459
> > Content-Type: text/xml; charset=ISO-8859-1
> >
> >
> >
> >
> > ________________________________
> > From: Alexis Midon <mi...@intalio.com>
> > To: user@ode.apache.org
> > Sent: Friday, October 31, 2008 2:35:00 PM
> > Subject: Re: REST Post issue
> >
> > Hi Chris,
> >
> > may I ask you where you got these headers from?
> > I guess you got them from the ODE log, the previous line being: "DEBUG -
> > GeronimoLog.debug(66) | HTTP Request Details: "
> > right?
> >
> > So this information is logged by ODE for debugging purpose. The log
> message
> > is built from the HttpClient request [1] but is not supposed to be HTTP
> > compliant [2]. That's commons-httpclient's job. So we can't conclude
> > neither
> > a) or b).
> > This applies to the response too.
> >
> > I tried to figure out which log category activate to get the request as
> > sent
> > by HttpClient, but no such category exists :(
> >
> > So you should try to get the request from the targetted server log or use
> a
> > tcp tunnel-like.
> >
> > Alexis
> >
> >
> > [1] org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<
> >
> http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup
> > >
> > [2] I agree that this could be misleading. Please create an improvement
> in
> > Jira <https://issues.apache.org/jira/browse/ODE>.
> >
> >
> >
> >
> > On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com>
> wrote:
> >
> > > A service we are invoking from a bpel implements a REST Post operation.
> > >
> > > This is failing for us with a 400 response error.  After some digging
> > into
> > > the problem, it seems that our request header is a) not sending the
> Host
> > > header and/or b) not setting the Post URI correctly.
> > >
> > > the request/response headers:
> > >
> > > POST
> > >
> >
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > > Request Headers:
> > > Accept: text/xml
> > > Request Entity:
> > > Content-Type:text/xml; charset=ISO-8859-1
> > > Content-Length:459
> > > Content-Charset:ISO-8859-1
> > > Request Entity:
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <DiagnosisLookup xmlns="http://tempuri.org/">
> > > <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> > > <SearchText xmlns="">100.8</SearchText>
> > > <SearchType xmlns="">Full</SearchType>
> > > <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> > > </DiagnosisLookup>
> > >
> > > POST
> > >
> >
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > > Status-Line<
> >
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line
> > >:
> > > HTTP/1.1 400 Bad Request
> > > Response Headers:
> > > Date: Fri, 31 Oct 2008 18:09:50 GMT
> > > Server: Microsoft-IIS/6.0
> > > X-Powered-By: ASP.NET
> > > X-AspNet-Version: 2.0.50727
> > > Cache-Control: private
> > > Content-Length: 0
> > >
> > > when i send the same request, via soapui but modify the request header
> to
> > > say:
> > >
> > > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > > Host: ccswsappsrv-v3-test.uhc.com
> > >
> > > I get the desired REST http 200 response.  are these request header
> > > settings configurable in the Axis2 layer?  What settings would they be?
> > >
> > >
> > >
> >
> >
> >
> >
> >
>
>
>
>

Re: REST Post issue

Posted by Chris Taylor <sa...@yahoo.com>.
Thanks, Alexis, this seems to make sense.

I have created the necessary *.endpoint configuration file (called it configuration.endpoint) and placed it in ode's WEB-INF/conf folder.  I set the correct setting (wasn't sure what exactly it was given the property name conflict between what you said below and what is in the documentation) as follows:
http.protocol.content-charset=UTF-8
http.protocol.encoding=UTF-8
It did not get picked up.  I'm running ODE 1.2.1 (latest trunk build from ~ 2 weeks ago).  Not sure why it did not get picked up, so I rebooted the App server and still nothing.  I then set these configuration settings in an endpoint-configuration.properties file in the process' deployment folder (the old configuration style) and still did not get picked up.
 
Am I misinterpreting the user guide on this?
 




________________________________
From: Alexis Midon <mi...@intalio.com>
To: user@ode.apache.org
Sent: Thursday, November 6, 2008 3:53:40 AM
Subject: Re: REST Post issue

Hi Chris,

first all let me give you more implementation details: if you're invoking
Soap-bound services, ODE uses Axis2 but if you're invoking HTTP-bound
services, ODE uses plain commons-httpclient, bypassing Axis2.

In your case, base on the logs you got, I assume you're using an HTTP-bound
service. So Axis2 is not involved *at all*.
So what you could try is to customize your endpoint with the property file
described in the user-guide [1]

The property to set is:
http.protocol.content-charset=bla

To make sure, this property is taken into account, you might want to set to
DEBUG the following log category:
org.apache.ode.axis2.httpbinding.HttpMethodConverter

You will get a message built on this template:
log.debug("Content-Type [" + contentType + "] Charset [" + contentCharset +
"]");

Let me know how it works.

Alexis

[1] http://ode.apache.org/user-guide.html#UserGuide-EndpointConfiguration



On Thu, Nov 6, 2008 at 10:17 AM, Chris Taylor <sa...@yahoo.com> wrote:

> Good advice.  I ran the new REST request (from ODE) through a TCP/IP
> monitor and compared it with the identical request through a service client
> (soapui - though without soap envelope wrapping, just straight http post).
>
> The only distinction between the one that works and the one that fails (the
> ODE invocation) seems to be in the character encoding.  ODE is encoding
> using ISO character set.  Can this be reconfigured?  It does not seem from
> the Axis2 guidance that this can be configured for the transportsender in
> the Axis2 configuration.  Any advice?
>
> succesful request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Content-Type: text/xml;charset=UTF-8
> SOAPAction: "
> http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode
> "
> User-Agent: Jakarta Commons-HttpClient/3.0.1
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
>
> failed request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Accept: text/xml
> User-Agent: Jakarta Commons-HttpClient/3.0
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
> Content-Type: text/xml; charset=ISO-8859-1
>
>
>
>
> ________________________________
> From: Alexis Midon <mi...@intalio.com>
> To: user@ode.apache.org
> Sent: Friday, October 31, 2008 2:35:00 PM
> Subject: Re: REST Post issue
>
> Hi Chris,
>
> may I ask you where you got these headers from?
> I guess you got them from the ODE log, the previous line being: "DEBUG -
> GeronimoLog.debug(66) | HTTP Request Details: "
> right?
>
> So this information is logged by ODE for debugging purpose. The log message
> is built from the HttpClient request [1] but is not supposed to be HTTP
> compliant [2]. That's commons-httpclient's job. So we can't conclude
> neither
> a) or b).
> This applies to the response too.
>
> I tried to figure out which log category activate to get the request as
> sent
> by HttpClient, but no such category exists :(
>
> So you should try to get the request from the targetted server log or use a
> tcp tunnel-like.
>
> Alexis
>
>
> [1] org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<
> http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup
> >
> [2] I agree that this could be misleading. Please create an improvement in
> Jira <https://issues.apache.org/jira/browse/ODE>.
>
>
>
>
> On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
> > A service we are invoking from a bpel implements a REST Post operation.
> >
> > This is failing for us with a 400 response error.  After some digging
> into
> > the problem, it seems that our request header is a) not sending the Host
> > header and/or b) not setting the Post URI correctly.
> >
> > the request/response headers:
> >
> > POST
> >
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > Request Headers:
> > Accept: text/xml
> > Request Entity:
> > Content-Type:text/xml; charset=ISO-8859-1
> > Content-Length:459
> > Content-Charset:ISO-8859-1
> > Request Entity:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <DiagnosisLookup xmlns="http://tempuri.org/">
> > <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> > <SearchText xmlns="">100.8</SearchText>
> > <SearchType xmlns="">Full</SearchType>
> > <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> > </DiagnosisLookup>
> >
> > POST
> >
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > Status-Line<
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line
> >:
> > HTTP/1.1 400 Bad Request
> > Response Headers:
> > Date: Fri, 31 Oct 2008 18:09:50 GMT
> > Server: Microsoft-IIS/6.0
> > X-Powered-By: ASP.NET
> > X-AspNet-Version: 2.0.50727
> > Cache-Control: private
> > Content-Length: 0
> >
> > when i send the same request, via soapui but modify the request header to
> > say:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > Host: ccswsappsrv-v3-test.uhc.com
> >
> > I get the desired REST http 200 response.  are these request header
> > settings configurable in the Axis2 layer?  What settings would they be?
> >
> >
> >
>
>
>
>
>


      

Re: REST Post issue

Posted by Alexis Midon <mi...@intalio.com>.
Hi Chris,

first all let me give you more implementation details: if you're invoking
Soap-bound services, ODE uses Axis2 but if you're invoking HTTP-bound
services, ODE uses plain commons-httpclient, bypassing Axis2.

In your case, base on the logs you got, I assume you're using an HTTP-bound
service. So Axis2 is not involved *at all*.
So what you could try is to customize your endpoint with the property file
described in the user-guide [1]

The property to set is:
http.protocol.content-charset=bla

To make sure, this property is taken into account, you might want to set to
DEBUG the following log category:
org.apache.ode.axis2.httpbinding.HttpMethodConverter

You will get a message built on this template:
log.debug("Content-Type [" + contentType + "] Charset [" + contentCharset +
"]");

Let me know how it works.

Alexis

[1] http://ode.apache.org/user-guide.html#UserGuide-EndpointConfiguration



On Thu, Nov 6, 2008 at 10:17 AM, Chris Taylor <sa...@yahoo.com> wrote:

> Good advice.  I ran the new REST request (from ODE) through a TCP/IP
> monitor and compared it with the identical request through a service client
> (soapui - though without soap envelope wrapping, just straight http post).
>
> The only distinction between the one that works and the one that fails (the
> ODE invocation) seems to be in the character encoding.  ODE is encoding
> using ISO character set.  Can this be reconfigured?  It does not seem from
> the Axis2 guidance that this can be configured for the transportsender in
> the Axis2 configuration.  Any advice?
>
> succesful request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Content-Type: text/xml;charset=UTF-8
> SOAPAction: "
> http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode
> "
> User-Agent: Jakarta Commons-HttpClient/3.0.1
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
>
> failed request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Accept: text/xml
> User-Agent: Jakarta Commons-HttpClient/3.0
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
> Content-Type: text/xml; charset=ISO-8859-1
>
>
>
>
> ________________________________
> From: Alexis Midon <mi...@intalio.com>
> To: user@ode.apache.org
> Sent: Friday, October 31, 2008 2:35:00 PM
> Subject: Re: REST Post issue
>
> Hi Chris,
>
> may I ask you where you got these headers from?
> I guess you got them from the ODE log, the previous line being: "DEBUG -
> GeronimoLog.debug(66) | HTTP Request Details: "
> right?
>
> So this information is logged by ODE for debugging purpose. The log message
> is built from the HttpClient request [1] but is not supposed to be HTTP
> compliant [2]. That's commons-httpclient's job. So we can't conclude
> neither
> a) or b).
> This applies to the response too.
>
> I tried to figure out which log category activate to get the request as
> sent
> by HttpClient, but no such category exists :(
>
> So you should try to get the request from the targetted server log or use a
> tcp tunnel-like.
>
> Alexis
>
>
> [1] org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<
> http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup
> >
> [2] I agree that this could be misleading. Please create an improvement in
> Jira <https://issues.apache.org/jira/browse/ODE>.
>
>
>
>
> On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
> > A service we are invoking from a bpel implements a REST Post operation.
> >
> > This is failing for us with a 400 response error.  After some digging
> into
> > the problem, it seems that our request header is a) not sending the Host
> > header and/or b) not setting the Post URI correctly.
> >
> > the request/response headers:
> >
> > POST
> >
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > Request Headers:
> > Accept: text/xml
> > Request Entity:
> > Content-Type:text/xml; charset=ISO-8859-1
> > Content-Length:459
> > Content-Charset:ISO-8859-1
> > Request Entity:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <DiagnosisLookup xmlns="http://tempuri.org/">
> > <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> > <SearchText xmlns="">100.8</SearchText>
> > <SearchType xmlns="">Full</SearchType>
> > <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> > </DiagnosisLookup>
> >
> > POST
> >
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > Status-Line<
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line
> >:
> > HTTP/1.1 400 Bad Request
> > Response Headers:
> > Date: Fri, 31 Oct 2008 18:09:50 GMT
> > Server: Microsoft-IIS/6.0
> > X-Powered-By: ASP.NET
> > X-AspNet-Version: 2.0.50727
> > Cache-Control: private
> > Content-Length: 0
> >
> > when i send the same request, via soapui but modify the request header to
> > say:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> > Host: ccswsappsrv-v3-test.uhc.com
> >
> > I get the desired REST http 200 response.  are these request header
> > settings configurable in the Axis2 layer?  What settings would they be?
> >
> >
> >
>
>
>
>
>

Re: REST Post issue

Posted by Alexis Midon <mi...@intalio.com>.
https://issues.apache.org/jira/browse/ODE-409 is fixed. You can wait for the
next release or build yourself.

Alexis


On Thu, Nov 6, 2008 at 12:46 PM, Andres P. Ferrando <an...@pruna.com.ar>wrote:

> Matthieu,
>
> You're right. I was comparing headers, I didn't pay attention to that.
>
> Regards,
>
> Matthieu Riou wrote:
> > On Thu, Nov 6, 2008 at 4:01 AM, Andrés P. Ferrando <andres@pruna.com.ar
> >wrote:
> >
> >> Hi all,
> >>
> >> I think that change the default to UTF8 will be great, and it's good to
> >> find this bug about ODE not using defined properties.
> >> But the error here I think is the missing SOAPAction in the second POST,
> >> and not a character set issue. Try fix this, and let us know.
> >>
> >
> > Why would you put a SOAPAction when you're not doing SOAP?
> >
> > Matthieu
>
> --
>    Andrés P. Ferrando
> http://www.pruna.com.ar/
>

Re: REST Post issue

Posted by "Andres P. Ferrando" <an...@pruna.com.ar>.
Matthieu,

You're right. I was comparing headers, I didn't pay attention to that.

Regards,

Matthieu Riou wrote:
> On Thu, Nov 6, 2008 at 4:01 AM, Andrés P. Ferrando <an...@pruna.com.ar>wrote:
> 
>> Hi all,
>>
>> I think that change the default to UTF8 will be great, and it's good to
>> find this bug about ODE not using defined properties.
>> But the error here I think is the missing SOAPAction in the second POST,
>> and not a character set issue. Try fix this, and let us know.
>>
> 
> Why would you put a SOAPAction when you're not doing SOAP?
> 
> Matthieu

-- 
   Andrés P. Ferrando
http://www.pruna.com.ar/

Re: REST Post issue

Posted by Matthieu Riou <ma...@offthelip.org>.
On Thu, Nov 6, 2008 at 4:01 AM, Andrés P. Ferrando <an...@pruna.com.ar>wrote:

> Hi all,
>
> I think that change the default to UTF8 will be great, and it's good to
> find this bug about ODE not using defined properties.
> But the error here I think is the missing SOAPAction in the second POST,
> and not a character set issue. Try fix this, and let us know.
>

Why would you put a SOAPAction when you're not doing SOAP?

Matthieu


>
> Regards,
>
> > Good advice.  I ran the new REST request (from ODE) through a TCP/IP
> > monitor and compared it with the identical request through a service
> > client (soapui - though without soap envelope wrapping, just straight
> http
> > post).
> >
> > The only distinction between the one that works and the one that fails
> > (the ODE invocation) seems to be in the character encoding.  ODE is
> > encoding using ISO character set.  Can this be reconfigured?  It does not
> > seem from the Axis2 guidance that this can be configured for the
> > transportsender in the Axis2 configuration.  Any advice?
> >
> > succesful request header:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> > Content-Type: text/xml;charset=UTF-8
> > SOAPAction:
> > "
> http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode
> "
> > User-Agent: Jakarta Commons-HttpClient/3.0.1
> > Host: ccswsappsrv-v3-test.uhc.com
> > Content-Length: 459
> >
> > failed request header:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> > Accept: text/xml
> > User-Agent: Jakarta Commons-HttpClient/3.0
> > Host: ccswsappsrv-v3-test.uhc.com
> > Content-Length: 459
> > Content-Type: text/xml; charset=ISO-8859-1
> >
> >
> >
> >
> > ________________________________
> > From: Alexis Midon <mi...@intalio.com>
> > To: user@ode.apache.org
> > Sent: Friday, October 31, 2008 2:35:00 PM
> > Subject: Re: REST Post issue
> >
> > Hi Chris,
> >
> > may I ask you where you got these headers from?
> > I guess you got them from the ODE log, the previous line being: "DEBUG -
> > GeronimoLog.debug(66) | HTTP Request Details: "
> > right?
> >
> > So this information is logged by ODE for debugging purpose. The log
> > message
> > is built from the HttpClient request [1] but is not supposed to be HTTP
> > compliant [2]. That's commons-httpclient's job. So we can't conclude
> > neither
> > a) or b).
> > This applies to the response too.
> >
> > I tried to figure out which log category activate to get the request as
> > sent
> > by HttpClient, but no such category exists :(
> >
> > So you should try to get the request from the targetted server log or use
> > a
> > tcp tunnel-like.
> >
> > Alexis
> >
> >
> > [1]
> > org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<
> http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup
> >
> > [2] I agree that this could be misleading. Please create an improvement
> in
> > Jira <https://issues.apache.org/jira/browse/ODE>.
> >
> >
> >
> >
> > On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com>
> wrote:
> >
> >> A service we are invoking from a bpel implements a REST Post operation.
> >>
> >> This is failing for us with a 400 response error.  After some digging
> >> into
> >> the problem, it seems that our request header is a) not sending the Host
> >> header and/or b) not setting the Post URI correctly.
> >>
> >> the request/response headers:
> >>
> >> POST
> >>
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> >> Request Headers:
> >> Accept: text/xml
> >> Request Entity:
> >> Content-Type:text/xml; charset=ISO-8859-1
> >> Content-Length:459
> >> Content-Charset:ISO-8859-1
> >> Request Entity:
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <DiagnosisLookup xmlns="http://tempuri.org/">
> >> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> >> <SearchText xmlns="">100.8</SearchText>
> >> <SearchType xmlns="">Full</SearchType>
> >> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> >> </DiagnosisLookup>
> >>
> >> POST
> >>
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> >> Status-Line<
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line
> >:
> >> HTTP/1.1 400 Bad Request
> >> Response Headers:
> >> Date: Fri, 31 Oct 2008 18:09:50 GMT
> >> Server: Microsoft-IIS/6.0
> >> X-Powered-By: ASP.NET
> >> X-AspNet-Version: 2.0.50727
> >> Cache-Control: private
> >> Content-Length: 0
> >>
> >> when i send the same request, via soapui but modify the request header
> >> to
> >> say:
> >>
> >> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> >> Host: ccswsappsrv-v3-test.uhc.com
> >>
> >> I get the desired REST http 200 response.  are these request header
> >> settings configurable in the Axis2 layer?  What settings would they be?
> >>
> >>
> >>
> >
> >
> >
> >
>
>
> --
>   Andrés P. Ferrando
> http://www.pruna.com.ar/
>
>

Re: REST Post issue

Posted by Alexis Midon <mi...@intalio.com>.
I updated the jira issue with more insights.
https://issues.apache.org/jira/browse/ODE-409

Alexis


On Fri, Nov 7, 2008 at 9:16 AM, Alexis Midon <mi...@intalio.com> wrote:

> thank you for the feedback Chris.
>
> Alexis
>
>
>
> On Fri, Nov 7, 2008 at 8:43 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
>> The second, failed request, works fine when I change the character set in
>> the content type header.
>>
>>
>>
>>
>> ________________________________
>> From: Andrés P. Ferrando <an...@pruna.com.ar>
>> To: user@ode.apache.org
>> Sent: Thursday, November 6, 2008 6:01:44 AM
>> Subject: Re: REST Post issue
>>
>> Hi all,
>>
>> I think that change the default to UTF8 will be great, and it's good to
>> find this bug about ODE not using defined properties.
>> But the error here I think is the missing SOAPAction in the second POST,
>> and not a character set issue. Try fix this, and let us know.
>>
>> Regards,
>>
>> > Good advice.  I ran the new REST request (from ODE) through a TCP/IP
>> > monitor and compared it with the identical request through a service
>> > client (soapui - though without soap envelope wrapping, just straight
>> http
>> > post).
>> >
>> > The only distinction between the one that works and the one that fails
>> > (the ODE invocation) seems to be in the character encoding.  ODE is
>> > encoding using ISO character set.  Can this be reconfigured?  It does
>> not
>> > seem from the Axis2 guidance that this can be configured for the
>> > transportsender in the Axis2 configuration.  Any advice?
>> >
>> > succesful request header:
>> >
>> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
>> > Content-Type: text/xml;charset=UTF-8
>> > SOAPAction:
>> > "
>> http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode
>> "
>> > User-Agent: Jakarta Commons-HttpClient/3.0.1
>> > Host: ccswsappsrv-v3-test.uhc.com
>> > Content-Length: 459
>> >
>> > failed request header:
>> >
>> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
>> > Accept: text/xml
>> > User-Agent: Jakarta Commons-HttpClient/3.0
>> > Host: ccswsappsrv-v3-test.uhc.com
>> > Content-Length: 459
>> > Content-Type: text/xml; charset=ISO-8859-1
>> >
>> >
>> >
>> >
>> > ________________________________
>> > From: Alexis Midon <mi...@intalio.com>
>> > To: user@ode.apache.org
>> > Sent: Friday, October 31, 2008 2:35:00 PM
>> > Subject: Re: REST Post issue
>> >
>> > Hi Chris,
>> >
>> > may I ask you where you got these headers from?
>> > I guess you got them from the ODE log, the previous line being: "DEBUG -
>> > GeronimoLog.debug(66) | HTTP Request Details: "
>> > right?
>> >
>> > So this information is logged by ODE for debugging purpose. The log
>> > message
>> > is built from the HttpClient request [1] but is not supposed to be HTTP
>> > compliant [2]. That's commons-httpclient's job. So we can't conclude
>> > neither
>> > a) or b).
>> > This applies to the response too.
>> >
>> > I tried to figure out which log category activate to get the request as
>> > sent
>> > by HttpClient, but no such category exists :(
>> >
>> > So you should try to get the request from the targetted server log or
>> use
>> > a
>> > tcp tunnel-like.
>> >
>> > Alexis
>> >
>> >
>> > [1]
>> > org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<
>> http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup
>> >
>> > [2] I agree that this could be misleading. Please create an improvement
>> in
>> > Jira <https://issues.apache.org/jira/browse/ODE>.
>> >
>> >
>> >
>> >
>> > On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com>
>> wrote:
>> >
>> >> A service we are invoking from a bpel implements a REST Post operation.
>> >>
>> >> This is failing for us with a 400 response error.  After some digging
>> >> into
>> >> the problem, it seems that our request header is a) not sending the
>> Host
>> >> header and/or b) not setting the Post URI correctly.
>> >>
>> >> the request/response headers:
>> >>
>> >> POST
>> >>
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> >> Request Headers:
>> >> Accept: text/xml
>> >> Request Entity:
>> >> Content-Type:text/xml; charset=ISO-8859-1
>> >> Content-Length:459
>> >> Content-Charset:ISO-8859-1
>> >> Request Entity:
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >> <DiagnosisLookup xmlns="http://tempuri.org/">
>> >> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
>> >> <SearchText xmlns="">100.8</SearchText>
>> >> <SearchType xmlns="">Full</SearchType>
>> >> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
>> >> </DiagnosisLookup>
>> >>
>> >> POST
>> >>
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> >> Status-Line<
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line
>> >:
>> >> HTTP/1.1 400 Bad Request
>> >> Response Headers:
>> >> Date: Fri, 31 Oct 2008 18:09:50 GMT
>> >> Server: Microsoft-IIS/6.0
>> >> X-Powered-By: ASP.NET
>> >> X-AspNet-Version: 2.0.50727
>> >> Cache-Control: private
>> >> Content-Length: 0
>> >>
>> >> when i send the same request, via soapui but modify the request header
>> >> to
>> >> say:
>> >>
>> >> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> >> Host: ccswsappsrv-v3-test.uhc.com
>> >>
>> >> I get the desired REST http 200 response.  are these request header
>> >> settings configurable in the Axis2 layer?  What settings would they be?
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> >
>>
>>
>> --
>>   Andrés P. Ferrando
>> http://www.pruna.com.ar/
>>
>>
>>
>>
>
>

Re: REST Post issue

Posted by Alexis Midon <mi...@intalio.com>.
thank you for the feedback Chris.

Alexis


On Fri, Nov 7, 2008 at 8:43 AM, Chris Taylor <sa...@yahoo.com> wrote:

> The second, failed request, works fine when I change the character set in
> the content type header.
>
>
>
>
> ________________________________
> From: Andrés P. Ferrando <an...@pruna.com.ar>
> To: user@ode.apache.org
> Sent: Thursday, November 6, 2008 6:01:44 AM
> Subject: Re: REST Post issue
>
> Hi all,
>
> I think that change the default to UTF8 will be great, and it's good to
> find this bug about ODE not using defined properties.
> But the error here I think is the missing SOAPAction in the second POST,
> and not a character set issue. Try fix this, and let us know.
>
> Regards,
>
> > Good advice.  I ran the new REST request (from ODE) through a TCP/IP
> > monitor and compared it with the identical request through a service
> > client (soapui - though without soap envelope wrapping, just straight
> http
> > post).
> >
> > The only distinction between the one that works and the one that fails
> > (the ODE invocation) seems to be in the character encoding.  ODE is
> > encoding using ISO character set.  Can this be reconfigured?  It does not
> > seem from the Axis2 guidance that this can be configured for the
> > transportsender in the Axis2 configuration.  Any advice?
> >
> > succesful request header:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> > Content-Type: text/xml;charset=UTF-8
> > SOAPAction:
> > "
> http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode
> "
> > User-Agent: Jakarta Commons-HttpClient/3.0.1
> > Host: ccswsappsrv-v3-test.uhc.com
> > Content-Length: 459
> >
> > failed request header:
> >
> > POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> > Accept: text/xml
> > User-Agent: Jakarta Commons-HttpClient/3.0
> > Host: ccswsappsrv-v3-test.uhc.com
> > Content-Length: 459
> > Content-Type: text/xml; charset=ISO-8859-1
> >
> >
> >
> >
> > ________________________________
> > From: Alexis Midon <mi...@intalio.com>
> > To: user@ode.apache.org
> > Sent: Friday, October 31, 2008 2:35:00 PM
> > Subject: Re: REST Post issue
> >
> > Hi Chris,
> >
> > may I ask you where you got these headers from?
> > I guess you got them from the ODE log, the previous line being: "DEBUG -
> > GeronimoLog.debug(66) | HTTP Request Details: "
> > right?
> >
> > So this information is logged by ODE for debugging purpose. The log
> > message
> > is built from the HttpClient request [1] but is not supposed to be HTTP
> > compliant [2]. That's commons-httpclient's job. So we can't conclude
> > neither
> > a) or b).
> > This applies to the response too.
> >
> > I tried to figure out which log category activate to get the request as
> > sent
> > by HttpClient, but no such category exists :(
> >
> > So you should try to get the request from the targetted server log or use
> > a
> > tcp tunnel-like.
> >
> > Alexis
> >
> >
> > [1]
> > org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<
> http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup
> >
> > [2] I agree that this could be misleading. Please create an improvement
> in
> > Jira <https://issues.apache.org/jira/browse/ODE>.
> >
> >
> >
> >
> > On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com>
> wrote:
> >
> >> A service we are invoking from a bpel implements a REST Post operation.
> >>
> >> This is failing for us with a 400 response error.  After some digging
> >> into
> >> the problem, it seems that our request header is a) not sending the Host
> >> header and/or b) not setting the Post URI correctly.
> >>
> >> the request/response headers:
> >>
> >> POST
> >>
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> >> Request Headers:
> >> Accept: text/xml
> >> Request Entity:
> >> Content-Type:text/xml; charset=ISO-8859-1
> >> Content-Length:459
> >> Content-Charset:ISO-8859-1
> >> Request Entity:
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <DiagnosisLookup xmlns="http://tempuri.org/">
> >> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> >> <SearchText xmlns="">100.8</SearchText>
> >> <SearchType xmlns="">Full</SearchType>
> >> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> >> </DiagnosisLookup>
> >>
> >> POST
> >>
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> >> Status-Line<
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line
> >:
> >> HTTP/1.1 400 Bad Request
> >> Response Headers:
> >> Date: Fri, 31 Oct 2008 18:09:50 GMT
> >> Server: Microsoft-IIS/6.0
> >> X-Powered-By: ASP.NET
> >> X-AspNet-Version: 2.0.50727
> >> Cache-Control: private
> >> Content-Length: 0
> >>
> >> when i send the same request, via soapui but modify the request header
> >> to
> >> say:
> >>
> >> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> >> Host: ccswsappsrv-v3-test.uhc.com
> >>
> >> I get the desired REST http 200 response.  are these request header
> >> settings configurable in the Axis2 layer?  What settings would they be?
> >>
> >>
> >>
> >
> >
> >
> >
>
>
> --
>   Andrés P. Ferrando
> http://www.pruna.com.ar/
>
>
>
>

Re: REST Post issue

Posted by Chris Taylor <sa...@yahoo.com>.
The second, failed request, works fine when I change the character set in the content type header.




________________________________
From: Andrés P. Ferrando <an...@pruna.com.ar>
To: user@ode.apache.org
Sent: Thursday, November 6, 2008 6:01:44 AM
Subject: Re: REST Post issue

Hi all,

I think that change the default to UTF8 will be great, and it's good to
find this bug about ODE not using defined properties.
But the error here I think is the missing SOAPAction in the second POST,
and not a character set issue. Try fix this, and let us know.

Regards,

> Good advice.  I ran the new REST request (from ODE) through a TCP/IP
> monitor and compared it with the identical request through a service
> client (soapui - though without soap envelope wrapping, just straight http
> post).
>
> The only distinction between the one that works and the one that fails
> (the ODE invocation) seems to be in the character encoding.  ODE is
> encoding using ISO character set.  Can this be reconfigured?  It does not
> seem from the Axis2 guidance that this can be configured for the
> transportsender in the Axis2 configuration.  Any advice?
>
> succesful request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Content-Type: text/xml;charset=UTF-8
> SOAPAction:
> "http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode"
> User-Agent: Jakarta Commons-HttpClient/3.0.1
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
>
> failed request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Accept: text/xml
> User-Agent: Jakarta Commons-HttpClient/3.0
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
> Content-Type: text/xml; charset=ISO-8859-1
>
>
>
>
> ________________________________
> From: Alexis Midon <mi...@intalio.com>
> To: user@ode.apache.org
> Sent: Friday, October 31, 2008 2:35:00 PM
> Subject: Re: REST Post issue
>
> Hi Chris,
>
> may I ask you where you got these headers from?
> I guess you got them from the ODE log, the previous line being: "DEBUG -
> GeronimoLog.debug(66) | HTTP Request Details: "
> right?
>
> So this information is logged by ODE for debugging purpose. The log
> message
> is built from the HttpClient request [1] but is not supposed to be HTTP
> compliant [2]. That's commons-httpclient's job. So we can't conclude
> neither
> a) or b).
> This applies to the response too.
>
> I tried to figure out which log category activate to get the request as
> sent
> by HttpClient, but no such category exists :(
>
> So you should try to get the request from the targetted server log or use
> a
> tcp tunnel-like.
>
> Alexis
>
>
> [1]
> org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup>
> [2] I agree that this could be misleading. Please create an improvement in
> Jira <https://issues.apache.org/jira/browse/ODE>.
>
>
>
>
> On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
>> A service we are invoking from a bpel implements a REST Post operation.
>>
>> This is failing for us with a 400 response error.  After some digging
>> into
>> the problem, it seems that our request header is a) not sending the Host
>> header and/or b) not setting the Post URI correctly.
>>
>> the request/response headers:
>>
>> POST
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Request Headers:
>> Accept: text/xml
>> Request Entity:
>> Content-Type:text/xml; charset=ISO-8859-1
>> Content-Length:459
>> Content-Charset:ISO-8859-1
>> Request Entity:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <DiagnosisLookup xmlns="http://tempuri.org/">
>> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
>> <SearchText xmlns="">100.8</SearchText>
>> <SearchType xmlns="">Full</SearchType>
>> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
>> </DiagnosisLookup>
>>
>> POST
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Status-Line<http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line>:
>> HTTP/1.1 400 Bad Request
>> Response Headers:
>> Date: Fri, 31 Oct 2008 18:09:50 GMT
>> Server: Microsoft-IIS/6.0
>> X-Powered-By: ASP.NET
>> X-AspNet-Version: 2.0.50727
>> Cache-Control: private
>> Content-Length: 0
>>
>> when i send the same request, via soapui but modify the request header
>> to
>> say:
>>
>> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Host: ccswsappsrv-v3-test.uhc.com
>>
>> I get the desired REST http 200 response.  are these request header
>> settings configurable in the Axis2 layer?  What settings would they be?
>>
>>
>>
>
>
>
>


-- 
  Andrés P. Ferrando
http://www.pruna.com.ar/


      

Re: REST Post issue

Posted by "Andrés P. Ferrando" <an...@pruna.com.ar>.
Hi all,

I think that change the default to UTF8 will be great, and it's good to
find this bug about ODE not using defined properties.
But the error here I think is the missing SOAPAction in the second POST,
and not a character set issue. Try fix this, and let us know.

Regards,

> Good advice.  I ran the new REST request (from ODE) through a TCP/IP
> monitor and compared it with the identical request through a service
> client (soapui - though without soap envelope wrapping, just straight http
> post).
>
> The only distinction between the one that works and the one that fails
> (the ODE invocation) seems to be in the character encoding.  ODE is
> encoding using ISO character set.  Can this be reconfigured?  It does not
> seem from the Axis2 guidance that this can be configured for the
> transportsender in the Axis2 configuration.  Any advice?
>
> succesful request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Content-Type: text/xml;charset=UTF-8
> SOAPAction:
> "http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode"
> User-Agent: Jakarta Commons-HttpClient/3.0.1
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
>
> failed request header:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
> Accept: text/xml
> User-Agent: Jakarta Commons-HttpClient/3.0
> Host: ccswsappsrv-v3-test.uhc.com
> Content-Length: 459
> Content-Type: text/xml; charset=ISO-8859-1
>
>
>
>
> ________________________________
> From: Alexis Midon <mi...@intalio.com>
> To: user@ode.apache.org
> Sent: Friday, October 31, 2008 2:35:00 PM
> Subject: Re: REST Post issue
>
> Hi Chris,
>
> may I ask you where you got these headers from?
> I guess you got them from the ODE log, the previous line being: "DEBUG -
> GeronimoLog.debug(66) | HTTP Request Details: "
> right?
>
> So this information is logged by ODE for debugging purpose. The log
> message
> is built from the HttpClient request [1] but is not supposed to be HTTP
> compliant [2]. That's commons-httpclient's job. So we can't conclude
> neither
> a) or b).
> This applies to the response too.
>
> I tried to figure out which log category activate to get the request as
> sent
> by HttpClient, but no such category exists :(
>
> So you should try to get the request from the targetted server log or use
> a
> tcp tunnel-like.
>
> Alexis
>
>
> [1]
> org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup>
> [2] I agree that this could be misleading. Please create an improvement in
> Jira <https://issues.apache.org/jira/browse/ODE>.
>
>
>
>
> On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:
>
>> A service we are invoking from a bpel implements a REST Post operation.
>>
>> This is failing for us with a 400 response error.  After some digging
>> into
>> the problem, it seems that our request header is a) not sending the Host
>> header and/or b) not setting the Post URI correctly.
>>
>> the request/response headers:
>>
>> POST
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Request Headers:
>> Accept: text/xml
>> Request Entity:
>> Content-Type:text/xml; charset=ISO-8859-1
>> Content-Length:459
>> Content-Charset:ISO-8859-1
>> Request Entity:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <DiagnosisLookup xmlns="http://tempuri.org/">
>> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
>> <SearchText xmlns="">100.8</SearchText>
>> <SearchType xmlns="">Full</SearchType>
>> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
>> </DiagnosisLookup>
>>
>> POST
>> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Status-Line<http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line>:
>> HTTP/1.1 400 Bad Request
>> Response Headers:
>> Date: Fri, 31 Oct 2008 18:09:50 GMT
>> Server: Microsoft-IIS/6.0
>> X-Powered-By: ASP.NET
>> X-AspNet-Version: 2.0.50727
>> Cache-Control: private
>> Content-Length: 0
>>
>> when i send the same request, via soapui but modify the request header
>> to
>> say:
>>
>> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
>> Host: ccswsappsrv-v3-test.uhc.com
>>
>> I get the desired REST http 200 response.  are these request header
>> settings configurable in the Axis2 layer?  What settings would they be?
>>
>>
>>
>
>
>
>


-- 
   Andrés P. Ferrando
http://www.pruna.com.ar/


Re: REST Post issue

Posted by Chris Taylor <sa...@yahoo.com>.
Good advice.  I ran the new REST request (from ODE) through a TCP/IP monitor and compared it with the identical request through a service client (soapui - though without soap envelope wrapping, just straight http post).

The only distinction between the one that works and the one that fails (the ODE invocation) seems to be in the character encoding.  ODE is encoding using ISO character set.  Can this be reconfigured?  It does not seem from the Axis2 guidance that this can be configured for the transportsender in the Axis2 configuration.  Any advice?

succesful request header:

POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://clinical.uhg.com/cis/service/ReferenceDataService/v0.1/GetDiagnosisCode"
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: ccswsappsrv-v3-test.uhc.com
Content-Length: 459

failed request header:

POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/ HTTP/1.1
Accept: text/xml
User-Agent: Jakarta Commons-HttpClient/3.0
Host: ccswsappsrv-v3-test.uhc.com
Content-Length: 459
Content-Type: text/xml; charset=ISO-8859-1




________________________________
From: Alexis Midon <mi...@intalio.com>
To: user@ode.apache.org
Sent: Friday, October 31, 2008 2:35:00 PM
Subject: Re: REST Post issue

Hi Chris,

may I ask you where you got these headers from?
I guess you got them from the ODE log, the previous line being: "DEBUG -
GeronimoLog.debug(66) | HTTP Request Details: "
right?

So this information is logged by ODE for debugging purpose. The log message
is built from the HttpClient request [1] but is not supposed to be HTTP
compliant [2]. That's commons-httpclient's job. So we can't conclude neither
a) or b).
This applies to the response too.

I tried to figure out which log category activate to get the request as sent
by HttpClient, but no such category exists :(

So you should try to get the request from the targetted server log or use a
tcp tunnel-like.

Alexis


[1] org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup>
[2] I agree that this could be misleading. Please create an improvement in
Jira <https://issues.apache.org/jira/browse/ODE>.




On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:

> A service we are invoking from a bpel implements a REST Post operation.
>
> This is failing for us with a 400 response error.  After some digging into
> the problem, it seems that our request header is a) not sending the Host
> header and/or b) not setting the Post URI correctly.
>
> the request/response headers:
>
> POST
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Request Headers:
> Accept: text/xml
> Request Entity:
> Content-Type:text/xml; charset=ISO-8859-1
> Content-Length:459
> Content-Charset:ISO-8859-1
> Request Entity:
> <?xml version="1.0" encoding="UTF-8"?>
> <DiagnosisLookup xmlns="http://tempuri.org/">
> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> <SearchText xmlns="">100.8</SearchText>
> <SearchType xmlns="">Full</SearchType>
> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> </DiagnosisLookup>
>
> POST
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Status-Line<http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line>:
> HTTP/1.1 400 Bad Request
> Response Headers:
> Date: Fri, 31 Oct 2008 18:09:50 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> X-AspNet-Version: 2.0.50727
> Cache-Control: private
> Content-Length: 0
>
> when i send the same request, via soapui but modify the request header to
> say:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Host: ccswsappsrv-v3-test.uhc.com
>
> I get the desired REST http 200 response.  are these request header
> settings configurable in the Axis2 layer?  What settings would they be?
>
>
>



      

Re: REST Post issue

Posted by Alexis Midon <mi...@intalio.com>.
Hi Chris,

may I ask you where you got these headers from?
I guess you got them from the ODE log, the previous line being: "DEBUG -
GeronimoLog.debug(66) | HTTP Request Details: "
right?

So this information is logged by ODE for debugging purpose. The log message
is built from the HttpClient request [1] but is not supposed to be HTTP
compliant [2]. That's commons-httpclient's job. So we can't conclude neither
a) or b).
This applies to the response too.

I tried to figure out which log category activate to get the request as sent
by HttpClient, but no such category exists :(

So you should try to get the request from the targetted server log or use a
tcp tunnel-like.

Alexis


[1] org.apache.ode.axis2.httpbinding.HttpHelper#requestToString<http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/httpbinding/HttpHelper.java?view=markup>
[2] I agree that this could be misleading. Please create an improvement in
Jira <https://issues.apache.org/jira/browse/ODE>.




On Fri, Oct 31, 2008 at 11:18 AM, Chris Taylor <sa...@yahoo.com> wrote:

> A service we are invoking from a bpel implements a REST Post operation.
>
> This is failing for us with a 400 response error.  After some digging into
> the problem, it seems that our request header is a) not sending the Host
> header and/or b) not setting the Post URI correctly.
>
> the request/response headers:
>
> POST
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Request Headers:
> Accept: text/xml
> Request Entity:
> Content-Type:text/xml; charset=ISO-8859-1
> Content-Length:459
> Content-Charset:ISO-8859-1
> Request Entity:
> <?xml version="1.0" encoding="UTF-8"?>
> <DiagnosisLookup xmlns="http://tempuri.org/">
> <MaxNumberOfCodes xmlns="">5</MaxNumberOfCodes>
> <SearchText xmlns="">100.8</SearchText>
> <SearchType xmlns="">Full</SearchType>
> <CoderType xmlns="">Codes/ICD9 Diagnosis</CoderType>
> </DiagnosisLookup>
>
> POST
> http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Status-Line<http://ccswsappsrv-v3-test.uhc.com/CCReview/CoderLookupService.svc/GetCodesAndDesc/Status-Line>:
> HTTP/1.1 400 Bad Request
> Response Headers:
> Date: Fri, 31 Oct 2008 18:09:50 GMT
> Server: Microsoft-IIS/6.0
> X-Powered-By: ASP.NET
> X-AspNet-Version: 2.0.50727
> Cache-Control: private
> Content-Length: 0
>
> when i send the same request, via soapui but modify the request header to
> say:
>
> POST /CCReview/CoderLookupService.svc/GetCodesAndDesc/
> Host: ccswsappsrv-v3-test.uhc.com
>
> I get the desired REST http 200 response.  are these request header
> settings configurable in the Axis2 layer?  What settings would they be?
>
>
>