Re: How to generate Integer instead of int in the generated client code (WSDL2Java)?
Hi all, Thnx for the answer Dies, yes WSDL is the interface, but I write the server, too, so on the server side I can influence the wsdl will be generated. So on the server side I have the following function (java): Collection getGroups(Integer parentId) And when creating wsdl from the service containing this method, the parameters' type xsd:int, but there is no nillable=true And consequently the generated client function is Vector getGroups(int parentId) Vector is not a problem, but there is int instead of Integer. I would like the generated wsdl to contain the nillable at the messages (without editing wsdl everytime). How can I reach that? What should I do on the server side? Thnx for the answers Best regards. George On Fri, 03 Mar 2006 22:50:00 +0900, Dies Koper [EMAIL PROTECTED] wrote: Hello George, I doubt it. Your WSDL file is the interface. If your interface says it will only accept non-null values and Axis would generate classes that would allow you specify null.. asking for trouble. You mentioned you need to create (generate?) the WSDL frequently. Maybe you can find a way to have the generated WSDL already have the nillable attribute set? Regards, Dies Sueveges Gyoergy wrote: Thnx for the answer. I know this nillable possibility, but I should write it into the wsdl manually, shouldn't I? I create the wsdl frequently, and it would be unconfortable for me always to rewrite the generated wsdl. Is there no possibility in the wsdd or somehow to say, that please create Integer instead of int on the client from the Integer parameters being in my webmethods? Thnx George On Fri, 3 Mar 2006 12:37:15 -, James Clinton [EMAIL PROTECTED] wrote: Nillable switches the primitive to an Object. xsd:element name=accountYear type=xsd:int nillable=false / -Original Message- From: Sueveges Gyoergy [mailto:[EMAIL PROTECTED] Sent: 03 March 2006 12:05 To: axis-user@ws.apache.org Subject: How to generate Integer instead of int in the generated client code (WSDL2Java)? Hi all, I'm writing a webservice containg a method: Collection getGroups(Integer parentId) where I also need the null value (It would mean the root). But when generating the client code it will be .. getGroups(int parentId) So I would like Integer here. How can I switch on the wrapped types without editing the wsdl manually (nillable,...) when I generate the client with wsdl2java. (I tried some things in the wsdd, some swithces at wsdl2java, and once there was Integer instead of int, but it was accident, I couldn't reproduce it.) Thnx for your answer in advance George Axis: 1.3 Java: Sun 1.4.2 Jetty: 5.1.10 --Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Re: [Axis2] Migration 0.93-0.94
Thanks a lot! Am Freitag 03 März 2006 14:48 schrieb Deepal Jayasinghe: private MessageContext makeCall(MessageContext requestContext, String action) throws AxisFault { ServiceClient client; MessageContext result = null; try { client = new ServiceClient(); Options option = new Options(); option.setTo(targetEPR); option.setAction(action); option.setTransportInProtocol(Constants.TRANSPORT_HTTP); OperationClient opClient = client.createClient(ServiceClient.ANON_OUT_IN_OP); opClient.addMessageContext(requestContext); opClient.execute(true); return opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); } catch (AxisFault e) { if (debug) e.printStackTrace(); } return result; } /// ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(soap/ axis2/config,null); try { msgContext = new MessageContext(configContext); } catch (AxisFault axisFault) { axisFault.printStackTrace(); } Note : If you want to use your axis2.xml then you have to put that into conf directory inside the repository or you can give absoloute path for axis2.xml as second paramter (null in this case) to createConfigurationContextFromFileSystem Filipp Akinfiev wrote: hi all, please help me to migrate from 0.93 to 0.94 following code: === private MessageContext makeCall(MessageContext requestContext, String action) { Call call; MessageContext result = null; try { call = new Call(); call.setTo(targetEPR); call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false); QName opName = new QName(urn:XMLWSIntf-IXMLWS, action); OperationDescription opdesc = new OperationDescription(opName); //Blocking invocation result = (MessageContext) call.invokeBlocking(opdesc ,requestContext); } catch (AxisFault e) { if(debug)e.printStackTrace(); } return result; } === ConfigurationContextFactory fac = new ConfigurationContextFactory(); ConfigurationContext configContext = fac.buildClientConfigurationContext(soap/axis2/config); try { msgContext = new MessageContext(configContext); } catch (AxisFault axisFault) { axisFault.printStackTrace(); } === thanks in advance!
Re: compressing soap message before sending
Hello, Could Http gzip compression fit your needs ? Using it with Axis is documented on the wiki : http://wiki.apache.org/ws/FrontPage/Axis/GzipCompression Cyrille-- Cyrille Le Clerc[EMAIL PROTECTED][EMAIL PROTECTED] On 3/3/06, Plorks mail [EMAIL PROTECTED] wrote: hi,can anyone giveme or lead me to a good exampleofcompressing a soap message?i'm writing a web service where i'll be sending large amounts of data andwant to compress it before i send it? the data will be a String, not a file is this possible?also is itpossible to compress the String, send it and when a clientreceives it, it's automatically uncompressed?or would it be better to sendthe compressed String and let the client uncompress it many thanks for any help_Are you using the latest version of MSN Messenger? Download MSN Messenger7.5 today! http://messenger.msn.co.uk
Re: [Axis2] Sending mails abt Axis2
Looks like there is some support for this idea. Any chance we can get it done?JimAnne Thomas Manes [EMAIL PROTECTED] wrote: +1 On 2/27/06, Ajith Ranabahu [EMAIL PROTECTED] wrote: Hi all,I also opposed the idea of a seperate mailing list sometime back but Ihave to admit that there's a whole lot of folks interested in Axis2right now which seems to be making the lists crowded (primarily by forgetting the axis2 prefix). If the Apache infra has no problem Iwould say we should go for a seperate list.AjithOn 2/27/06, Sr inath Perera [EMAIL PROTECTED] wrote: +1, when we first started I oppose this becouse we need Axis 1 developer and users to look at Axis2 and to give feedback. But I think now it is good time to move to a seperate list .. taking one more step closer to 1.0 Srinath On 2/26/06, Jim Azeltine [EMAIL PROTECTED] wrote: I would like to propose once again to create a seperate list for Axis 2. I realize that it makes it so developers have two lists to deal with, but I believe it would be better. The focus of the two efforts is really very different, bug resolution and stability for Axis 1, new product development for 2. JimEran Chinthaka [EMAIL PROTECTED] wrote: Hi all,I see increasing traffic on issues regarding Axis2. This mail is just a reminder to pass the mails to the correct people. As you all can see we use the same mailing list to address the issues related to both Axis 1.x and Axis2. So we came up with a small convention to distinguish between those two. Please put the prefix "[Axis2]" in to the subjects of all your mails to Axis2. This way you have a better chance of getting a good and early reply from axis2 team. This is even mentioned in our site as well. Thanks, Chinthaka-- Srinath Perera:http://www.cs.indiana.edu/~hperera/ http://www.bloglines.com/blog/hemapani--Ajith Ranabahu
[Axis2-0.94] Transfer-Encoding: chunked
Hi All, how can i remove Transfer-Encoding: chunked from header ? thanks in advance!
Re: [Axis2-0.94] Transfer-Encoding: chunked
i have it ... client.getOptions().setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED,org.apache.axis2.Constants.VALUE_FALSE); Am Samstag 04 März 2006 19:29 schrieb Filipp Akinfiev: Hi All, how can i remove Transfer-Encoding: chunked from header ? thanks in advance!
SAXException: Amazon.com Web Services using Axis 1.3
I'm trying to invoke Amazon's Web Services using Axis (for Java) 1.3. I've downloaded their WSDL, run WSDL2Java, and created a simple test case. When I run the test case, I keep running into the following exception as Axis parses the response from the server: org.xml.sax.SAXException: Invalid element in ca.intelliware.amazonapi.Items - IsValid I've used a proxy tool to capture the SOAP messages going back and forth, and based on my reading of the WSDL, the format is fine. Also, the error message suggests that the code is working with the wrong object type. Here's the snippet of the SOAP message that's significant: Items Request IsValidTrue/IsValid /Request Item ... /Item /Items I would expect, therefore, that Axis should be working with a Request class, rather than an Items class. I've tried some searches on this mailing list, and while there are some similar problems reported, I haven't been able to see anything that suggests the answer. Here are some sanity checks I've tried: 1. The Request class looks properly created, and contains an isValid (String) member variable and appropriate getter/setter. 2. The Items class looks properly created and does not contain an isValid member variable (correctly, I believe). 3. The WSDL includes the following: xs:element name=Request xs:complexType xs:sequence xs:element name=IsValid type=xs:string minOccurs=0/ xs:element name=HelpRequest type=tns:HelpRequest minOccurs=0/ ... /xs:sequence /xs:complexType /xs:element 4. I tried downloading and using Axis 1.2.1, but WSDL2Java didn't seem to generate versions of the client bindings that'd properly compile. 5. I've tracked the Exception down to these lines in BeanDeserializer.onStartChild(...): if (propDesc == null) { // No such field throw new SAXException( Messages.getMessage(badElem00, javaType.getName(), localName)); } When I set a breakpoint there in my debugger, I find that the javaType of the BeanDeserializer is Items (not Request). Does anyone know what might cause this? BC Here's my SOAP request: ?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; soapenv:Body ItemLookup xmlns=http://webservices.amazon.com/AWSECommerceService/2005-10-13; AWSAccessKeyId$MY_ACCESS_KEY/AWSAccessKeyId Shared ItemId0321278658/ItemId /Shared /ItemLookup /soapenv:Body /soapenv:Envelope Here's the response: ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; SOAP-ENV:Body ItemLookupResponse xmlns=http://webservices.amazon.com/AWSECommerceService/2005-10-13; OperationRequest HTTPHeaders Header Name=UserAgent Value=Axis/1.3/Header /HTTPHeaders RequestId0SSYXJZE5DFVK083SPCW/RequestId Arguments Argument Name=Service Value=AWSECommerceService/Argument /Arguments RequestProcessingTime0.0151088237762451/RequestProcessingTime /OperationRequest Items Request IsValidTrue/IsValid /Request Item ASIN0321278658/ASIN DetailPageURL ... very long url ... /DetailPageURL ItemAttributes AuthorKent Beck/Author AuthorCynthia Andres/Author ProductGroupBook/ProductGroup TitleExtreme Programming Explained : Embrace Change (2nd Edition)/Title /ItemAttributes /Item /Items /ItemLookupResponse /SOAP-ENV:Body/SOAP-ENV:Envelope Here's my stack trace: org.xml.sax.SAXException: Invalid element in ca.intelliware.amazonapi.Items - IsValid at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.client.Call.invoke(Call.java:2467) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at ca.intelliware.amazonapi.AWSECommerceServiceBindingStub.itemLookup(AWSECommerceServiceBindingStub.java:2380) at ca.intelliware.amazonapi.AWSECommerceServiceTest.testAWSECommerceService(AWSECommerceServiceTest.java:21) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at
RE: WSDL - stubs generation
Hi, Try out with xsd:hexBinary instead of xsd:string. Regards, Subir Sasikumar From: Samuel, Johnson [mailto:[EMAIL PROTECTED] Sent: Saturday, March 04, 2006 4:10 AM To: axis-user@ws.apache.org Subject: WSDL - stubs generation Hi, I am trying to create WSDL for a service that accepts request as attachment (XML content). I used wsdl2java to generate the stubs. I have two issues 1). When request/response attachment part is set as string the stubs generated throws error while reading the response back. 2). Apart from using xsd:string is there a means I can pass my xml object mapping in attachment. How to define that in my wsdl:message. Below is the wsdl I created for the service. Any suggestion/help is much appreciated. Thanks in advance rgds, --- WSDL --- wsdl:message name=MyServiceRequest wsdl:part name=reqheader element=eb:MessageHeader/ wsdl:part name=reqheader2 element=wsse:Security/ wsdl:part name=reqbody type=xsd:string/ wsdl:part name=reqpart type=xsd:string/ /wsdl:message wsdl:message name=MyServiceResponse wsdl:part name=resheader element=eb:MessageHeader/ wsdl:part name=resheader2 element=wsse:Security/ wsdl:part name=resbody type=xsd:string/ wsdl:part name=respart type=xsd:string/ /wsdl:message wsdl:portType name=MyServicePortType wsdl:operation name=MyServiceRQ wsdl:input message=tns:MyServiceRequest/ wsdl:output message=tns:MyServiceResponse/ /wsdl:operation /wsdl:portType wsdl:binding name=MyServiceSoapBinding type=tns:MyServicePortType soap:binding style=rpc transport=http://schemas.xmlsoap.org/soap/http/ wsdl:operation name=MyServiceRQ soap:operation soapAction= style=document/ wsdl:input soap:header message=tns:MyServiceRequest part=reqheader use=literal/ soap:header message=tns:MyServiceRequest part=reqheader2 use=literal/ mime:multipartRelated mime:part soap:body part=reqbody use=literal/ /mime:part mime:part mime:content part=reqpart type=text/plain/ /mime:part /mime:multipartRelated /wsdl:input wsdl:output soap:header message=tns:MyServiceResponse part=resheader use=literal/ soap:header message=tns:MyServiceResponse part=resheader2 use=literal/ mime:multipartRelated mime:part soap:body part=resbody use=literal/ /mime:part mime:part mime:content part=respart type=text/plain/ /mime:part /mime:multipartRelated /wsdl:output /wsdl:operation /wsdl:binding wsdl:service name=MyService wsdl:port binding=tns:MyServiceSoapBinding name=MyServiceSOAPPort soap:address location=http://127.0.0.1:8100/webservice/ /wsdl:port /wsdl:service The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com