Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 27A98D64A for ; Sat, 8 Dec 2012 01:37:23 +0000 (UTC) Received: (qmail 85460 invoked by uid 500); 8 Dec 2012 01:37:22 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 85412 invoked by uid 500); 8 Dec 2012 01:37:22 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 85403 invoked by uid 99); 8 Dec 2012 01:37:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Dec 2012 01:37:22 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 209.85.220.45 as permitted sender) Received: from [209.85.220.45] (HELO mail-pa0-f45.google.com) (209.85.220.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Dec 2012 01:37:17 +0000 Received: by mail-pa0-f45.google.com with SMTP id bg2so849029pad.32 for ; Fri, 07 Dec 2012 17:36:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:content-transfer-encoding :content-disposition; bh=lenGsIqr4R1Mw38vrZGaRJ0hVi4FhY7e/hc3eJLF0Fs=; b=htllwuW6OVSfpquODnDSGXi9xScXUN4svjd+l+Iyl4MEYXi0FUEKr4Fx/tBPCn7lmI +qNyPC2xzHTty5pQFNPocNN1VF7ijQS6y5FOr89uIwNxiyTZO7MRjuhRQGn/UbKaevNt 0K+MWxP9HFw6H/yaPmF9YaQORf/e28/b5I3/Fd8tau0heW7KwIRkWTHACbyLqe3JjBzx 9oUs6L/Re3tj9HGXOsI+uaUm6ecX5CB9xek2csFuqXyO4CpweMpeyvTTy8WWTvTOPZu3 Liq4WGKLWn4rLbKMcwsaHY7vWBTbGLRvBKDcm2IjAksTm4Vij1YnYN/RGdYyPQ1gz+W2 zIGw== Received: by 10.68.237.6 with SMTP id uy6mr20097562pbc.147.1354930617554; Fri, 07 Dec 2012 17:36:57 -0800 (PST) Received: from [192.168.1.135] ([125.33.122.55]) by mx.google.com with ESMTPS id v10sm179160pax.28.2012.12.07.17.36.54 (version=SSLv3 cipher=OTHER); Fri, 07 Dec 2012 17:36:56 -0800 (PST) Date: Sat, 8 Dec 2012 09:36:50 +0800 From: Willem jiang To: users@camel.apache.org Message-ID: <78585C2CE15E4B929DFE2E4436994C52@gmail.com> In-Reply-To: <1354868028425-5723753.post@n5.nabble.com> References: <1354868028425-5723753.post@n5.nabble.com> Subject: Re: apache Camel cxf proxy doesnt work with http endpoint X-Mailer: sparrow 1.6.4 (build 1176) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org You need to use the Stream cache =5B1=5D when you route the input stream = across the route before you route the message to log endpoint. =5B1=5Dhttp://camel.apache.org/stream-caching.html -- =20 Willem Jiang Red Hat, Inc. =46useSource is now part of Red Hat Web: http://www.fusesource.com =7C http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) = (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang =20 Weibo: =E5=A7=9C=E5=AE=81willem On =46riday, December 7, 2012 at 4:13 PM, santhosh wrote: > =20 > My requirement is to have a proxy web service which will receive the re= quest > from clients and then route through camel,enrich it and forward it to r= eal > webservice at other clients place ,get response and send it back to the= > original requestor. > =20 > i basically looked at camel-cxf-proxy example > (http://camel.apache.org/cxf-proxy-example.html) and camel-cxf-example = in > camel distribution.Its exactly similar to camel-cxf-proxyand came up wi= th > this route > =20 > > > > =20 > where endpoints are > =20 > > =20 > address=3D=22http://localhost:8181/ProviderInformationDirectoryService=22= =20 > wsdlURL=3D=22wsdl/HPD=5FProviderInformationDirectory.wsdl=22 > endpointName=3D=22s:ProviderInformationDirectory=5FPort=5FSoap=22 > serviceName=3D=22s:ProviderInformationDirectory=5FService=22 > xmlns:s=3D=22urn:ihe:iti:hpd:2010=22/> > =20 > As you can see the second service is http endpoint.And first is the > camel-cxf proxy.I just have the wsdl and at this point there is no need= for > impl.the dataformat is MESSAGE as i need the entire soap envelope to be= sent > to second web service and there are some useful headers in request from= > client.But when i run this route with a sample soap envelope it always = comes > up with 500 response.I am thinking that message sent to real webservice= is > not what it expects.I even tried the bridgeOption in httpendpoint. > =20 > I tried trace on camel route but it didnt show much.I was hoping it wil= l > show real request to http endpoint.i tried to configure interceptor but= that > didnt work either.Trace only shows following > =20 > =46ailed delivery for (MessageId: ID-ALHCAN0437-63941-1354828653539-45-= 2 on > ExchangeId: ID-ALHCAN0437-63941-1354828653539-45-1). Exhausted after > delivery attempt: 1 caught: > org.apache.camel.component.http.HttpOperation=46ailedException: HTTP op= eration > failed invoking http://X:8080/X=5FService with statusCode: 500 > =20 > i even tried > =20 > > > > > =20 > I got a soap envelope and couldnt find anything wrong. > =20 > should i use wireshark and sniff the message that is actually sent=3F=3F= > =20 > I also tried the following which seems to be working. > =20 > > > > =20 > callRemoteWS (callRemoteMethod) gets the soapenvelope as string and mak= es a > HTTPPost request to above endpoint , returns back the response. > =20 > public String callRemoteMethod(String request) throws Exception=7B > =20 > =20 > =20 > HttpClient client =3D new HttpClient(); > =20 > BufferedReader br =3D null; > =20 > PostMethod method =3D new > PostMethod(=22http://x.x.x.x:8080/X=5FService=22); > =20 > RequestEntity entity =3Dnew StringRequestEntity(request); =20 > =20 > method.setRequestEntity(entity); > =20 > try=7B > int returnCode =3D client.executeMethod(method); > =20 > if (returnCode =21=3D HttpStatus.SC=5FOK) =7B > System.err.println(=22Method failed: =22 + > method.getStatusLine()); > return =22Error=22; > =7D > =20 > // Read the response body. > byte=5B=5D responseBody =3D method.getResponseBody(); > =20 > System.out.println(new String(responseBody)); > =20 > // Deal with the response. > // Use caution: ensure correct character encoding and is not > binary data > return new String(responseBody); > =7D finally =7B > method.releaseConnection(); > if(br =21=3D null) try =7B br.close(); =7D catch (Exception fe) =7B=7D > =7D > =20 > =7D > =20 > I am confused why the simple camel-cxf proxy with http webservice didnt= work > and the second one works (it should and it does :P).Is the code i have = ok.It > doesnt seem right to me.I am pretty sure some exchange property is set = wrong > or content sent to real webservice is wrong.The content got from the pr= oxy > is used to make the Httppost call in second route.so the content from p= roxy > cannot be wrong.when it is got from exchange and send to real webservic= e > something goes wrong. Can anybody throw some light on it. > =20 > =20 > =20 > =20 > -- > View this message in context: http://camel.465427.n5.nabble.com/apache-= Camel-cxf-proxy-doesnt-work-with-http-endpoint-tp5723753.html > Sent from the Camel - Users mailing list archive at Nabble.com (http://= Nabble.com).