Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 47893 invoked from network); 29 Apr 2008 11:54:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Apr 2008 11:54:06 -0000 Received: (qmail 56965 invoked by uid 500); 29 Apr 2008 11:53:59 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 56948 invoked by uid 500); 29 Apr 2008 11:53:59 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 56937 invoked by uid 99); 29 Apr 2008 11:53:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2008 04:53:59 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Apr 2008 11:53:03 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JqoOh-0003wr-Nl for axis-user@ws.apache.org; Tue, 29 Apr 2008 04:53:23 -0700 Message-ID: <16958782.post@talk.nabble.com> Date: Tue, 29 Apr 2008 04:53:23 -0700 (PDT) From: svaens To: axis-user@ws.apache.org Subject: Re: Axis2 and wsdl- Exception thrown when client attempting connection to SimpleHTTPServer In-Reply-To: <51e581cd0804290354u7bb207a3s9e374c2f9edf08a5@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sean@astraia.com References: <16934147.post@talk.nabble.com> <51e581cd0804280305w5dbe39c5o6633d8f4fb44713e@mail.gmail.com> <16955740.post@talk.nabble.com> <51e581cd0804290354u7bb207a3s9e374c2f9edf08a5@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, thanks again for your replies! I actually have it working now. HOWEVER!!! (isn't there always a catch!). I still don't know what was the cause of the problem. I will explain how I got the client / server process to work. But first, let me start from the start: once upon a time.... I received a wsdl file from someone, and my task is to test it by creating a server, and a client which can communicate. This is what I've been trying to do. Call a wsdl function on the server, returning an serialized object to the client as the response. So I took the wsdl file, and generated files for the server using wsdl2java.sh , which came with the axis2.1_3 distribution. I also generated the Stub java file for the client using this tool and the source wsdl file. This is where I had my problem. The client could not successfully communicate to the server. To get around this problem, I tried retrieving a NEWLY GENERATED WSDL file from using the browser to contact the server and retrieve a wsdl file generated from the generated Java files, which were in turn originally generated from my source wsdl file. ALARM!!! The original wsdl file, and the newly generated wsdl files are NOT the same!!! they differ in several ways. 1. the targetNamespace attribute listed in the wsdl:definitions tag shows the namespace backwards!! 2. The new generated wsdl file has two extra element types, GetPersonInfo, and GetPersonInfoResponse, + GetPersonInfoIn , GetPersonInfoOut while the original only game me GetPersonInfoOut & GetPersonInfoIn. Never mind for now, I thought, I'll continue with this test, and see if it works anyway. So I did, and so, with the introduction of these two extra types I had to slightly modify my code, but, it worked!!! What is going on here!! Here is the new code, and how I had to adapt it to the different Stub file generated from the changed wsdl: try { ConfigurationContext context = ConfigurationContextFactory. createDefaultConfigurationContext(); PersonInfoStub stub = new PersonInfoStub(context); GetPersonInfo reqs = new GetPersonInfo(); //GetPersonInfoIn req = reqs.getGetPersonInfoIn(); GetPersonInfoIn req = new GetPersonInfoIn(); reqs.setGetPersonInfoIn(req); req.setCivilRegistrationIdentifier("CIV123"); req.setHospitalCode("HOS123"); req.setRequestId("123"); req.setUserName("sean"); GetPersonInfoResponse res = stub.getPersonInfo(reqs); GetPersonInfoOut resultObj = res.get_return(); OMFactory fac = OMAbstractFactory.getOMFactory(); OMElement xml = resultObj.getOMElement(GetPersonInfoResponse.MY_QNAME, fac); //XMLOutputFactory xof = XMLOutputFactory.newInstance(); XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out); writeOMElement(xml, writer); // System.out.println(res.getSuccessfulAdd()); // System.out.println(res.getItemId()); } catch(Exception e){ e.printStackTrace(); System.out.println("\n\n\n"); } Upul Godage wrote: > > Actually when you write and pass nulls, > ConfigurationContext context = > ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, > null); > I think it uses a default bundled axi2.xml. So anyway an axis2.xml is > used. > > When context path is not the one given in axis2.xml, axis2server redirects > it to the context path. So the client may not be handling the redirect > responses and returning error for code 301. But the browser is anyway > supporting that. > > Upul > > -- View this message in context: http://www.nabble.com/Axis2-and-wsdl--Exception-thrown-when-client-attempting-connection-to-SimpleHTTPServer-tp16934147p16958782.html Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org