Return-Path: Delivered-To: apmail-ws-axis-c-user-archive@www.apache.org Received: (qmail 61350 invoked from network); 9 Sep 2008 20:13:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 20:13:23 -0000 Received: (qmail 69055 invoked by uid 500); 9 Sep 2008 20:13:20 -0000 Delivered-To: apmail-ws-axis-c-user-archive@ws.apache.org Received: (qmail 69041 invoked by uid 500); 9 Sep 2008 20:13:20 -0000 Mailing-List: contact axis-c-user-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C User List" Reply-To: "Apache AXIS C User List" Delivered-To: mailing list axis-c-user@ws.apache.org Received: (qmail 69030 invoked by uid 99); 9 Sep 2008 20:13:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 13:13:20 -0700 X-ASF-Spam-Status: No, hits=2.7 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_NEUTRAL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [199.105.153.67] (HELO kurzweiltech.com) (199.105.153.67) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 20:12:19 +0000 Received: from knfbchien [192.168.2.104] by kurzweiltech.com with ESMTP (SMTPD32-8.15) id A9146A95013A; Tue, 09 Sep 2008 16:14:12 -0400 From: "Arnie Chien" To: "'Apache AXIS C User List'" Subject: RE: problem with upload to REST-enabled service Date: Tue, 9 Sep 2008 16:12:00 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <20080908172331.SM00317@knfbchien> Thread-Index: AckQ+R5re6+mIqLVQ96nN4XKeTc9TAA+wA0wADBXSaA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Message-Id: <200809091614437.SM00317@knfbchien> X-Virus-Checked: Checked by ClamAV on apache.org I made some progress but still need help. The reason I set the Content-Type in my request header to "text/xml" is from reading this: http://ws.apache.org/axis2/0_94/rest-ws.html according to which "text/xml" is required for a message to be treated as RESTful. The doc is for java, I assumed the same for axis2c. But I find that when Content-Type is changed to "application/x-www-form-urlencoded", the problem of a null top-level axiom_node_t goes away and a test POST message is received and processed successfully by my service. However, "application/x-www-form-urlencoded" is not really what I want. When I try "image/jpeg" or "application/octet-stream", the server reports that those types are not supported. So now my question is, if I want to upload an image by POST how should I set the Content-Type of the http request? Would appreciate advice- -----Original Message----- From: Arnie Chien [mailto:achien@knfbreader.com] Sent: Monday, September 08, 2008 5:21 PM To: 'Apache AXIS C User List' Subject: RE: problem with upload to REST-enabled service I see the following with tcpmon: C:\axis2c\bin\tools>tcpmon Listen port : 9090 Target port : 8080 Target host: localhost SENDING DATA.. /* sending time = 12:59:17*/ /* message uuid = bcfa81c7-213a-4e8e-b60f-5405ba9dd283*/ --------------------- POST /axis2/services/KIPSvc/getVC HTTP/1.1 TE: deflate,gzip;q=0.3 Connection: TE, close Host: 192.168.2.16:9090 User-Agent: libwww-perl/5.806 Content-Length: 43 Content-Type: text/xml upfile=c%3A%2Ftestdb%2F478359.jpg ERROR: error in creating the host socket This is a POST; tcpmon reports the same error when I do a GET. But, for a POST I have the problem I described originally (i.e. the axiom_node_t argument of the getVC operation is null), even when I don't actually try to upload anything. Whereas for a GET I do not have that problem, and everything works fine. I haven't been able to find help in the archives or documentation, would appreciate any suggestions. -----Original Message----- From: Samisa Abeysinghe [mailto:samisa@wso2.com] Sent: Sunday, September 07, 2008 10:48 AM To: Apache AXIS C User List Subject: Re: problem with upload to REST-enabled service Arnie Chien wrote: > Ok thanks. In the meantime, can you tell me whether I'm right that it > should be possible for this to work when the client is not written to the > axis2 api, and just sends standard http requests? > Correct. Samisa... > -----Original Message----- > From: Samisa Abeysinghe [mailto:samisa@wso2.com] > Sent: Friday, September 05, 2008 11:23 AM > To: Apache AXIS C User List > Subject: Re: problem with upload to REST-enabled service > > Arnie Chien wrote: > >> Do you mean verify what the message is as it leaves the client? I don't >> know how to capture it on the server if the service operation is not >> receiving anything. >> > > Try using TCPMon. > > Samisa... > > >> I'm new to axis so would appreciate if you could advise >> me. In case it helps, the log reads: >> >> [Thu Sep 04 18:06:08 2008] [debug] >> ..\..\src\core\transport\http\common\http_worker.c(192) Client HTTP >> > version > >> HTTP/1.1 >> [Thu Sep 04 18:06:08 2008] [debug] >> ..\..\src\core\transport\http\util\http_transport_utils.c(289) HTTP stream >> chunked >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\rest_disp.c(113) >> Checking for service using target endpoint address : >> http://12.11.162.2:9090/axis2/services/KIPSvc/getVC >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\rest_disp.c(134) >> Service found using target endpoint address >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\rest_disp.c(201) >> Checking for operation using REST HTTP Location fragment : /getVC >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\rest_disp.c(209) >> Operation found using target endpoint uri fragment >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler request_uri_based_dispatcher within the phase Transport >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler AddressingInHandler within the phase Transport >> [Thu Sep 04 18:06:09 2008] [info] Starting addressing in handler >> [Thu Sep 04 18:06:09 2008] [info] >> ..\..\src\modules\mod_addr\addr_in_handler.c >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler addressing_based_dispatcher within the phase Transport >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler rest_dispatcher within the phase Dispatch >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler soap_message_body_based_dispatcher within the phase Dispatch >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler soap_action_based_dispatcher within the phase Dispatch >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler dispatch_post_conditions_evaluator within the phase >> > PostDispatch > >> [Thu Sep 04 18:06:09 2008] [debug] ..\..\src\core\engine\phase.c(210) >> > Invoke > >> the handler context_handler within the phase PostDispatch >> [Thu Sep 04 18:06:09 2008] [warning] ..\..\src\core\description\op.c(1149) >> Message id not found for message context while registering operation >> > context > >> for operation getVC >> [Thu Sep 04 18:06:10 2008] [info] Request served successfully >> >> >> -----Original Message----- >> From: Manjula Peiris [mailto:manjula@wso2.com] >> Sent: Thursday, September 04, 2008 11:28 PM >> To: Apache AXIS C User List >> Subject: Re: problem with upload to REST-enabled service >> >> Can you capture the message which is sent to the server ? >> >> On Thu, 2008-09-04 at 17:19 -0400, Arnie Chien wrote: >> >> >>> Hi, >>> I'm trying to upload an image to an axis2c server. The image is handled >>> >>> >> by >> >> >>> a service which is REST-enabled (modeled after the echo sample). The >>> services.xml is >>> >>> >>> KIPSvc >>> >>> >>> POST >>> getVC >>> >>> >>> >>> The client is written in Java, but does not use the axis2 API; it just >>> constructs a POST request using the java HttpConnection class. (My >>> understanding of REST is that this should be okay.) It sets content-type >>> >>> >> to >> >> >>> text/xml, and sends the image data as a sequence of bytes. >>> >>> Processing gets into the service dll, such that the getVC operation >>> >>> axiom_node_t * >>> axis2_KIPSvc_getVC( >>> const axutil_env_t * env, >>> axiom_node_t * node) >>> >>> is called. But the "node" argument is null. Could someone could tell me >>> what the problem might be? Many thanks in advance- >>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >>> For additional commands, e-mail: axis-c-user-help@ws.apache.org >>> >>> >>> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >> For additional commands, e-mail: axis-c-user-help@ws.apache.org >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org >> For additional commands, e-mail: axis-c-user-help@ws.apache.org >> >> ------------------------------------------------------------------------ >> >> >> No virus found in this incoming message. >> Checked by AVG - http://www.avg.com >> Version: 8.0.169 / Virus Database: 270.6.16/1653 - Release Date: 9/5/2008 >> > 6:57 AM > >> >> > > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - http://www.avg.com > Version: 8.0.169 / Virus Database: 270.6.16/1653 - Release Date: 9/5/2008 6:57 AM > > -- Samisa Abeysinghe Director, Engineering; WSO2 Inc. http://www.wso2.com/ - "The Open Source SOA Company" --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-user-help@ws.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-user-help@ws.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-c-user-help@ws.apache.org