RE: Axis fails to generate wrrapped style messages from this WSDL
What do you get, and what do you expect to get? -Original Message- From: I.Venuti [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 3:15 AM To: axis-user@ws.apache.org Subject: Axis fails to generate wrrapped style messages from this WSDL Hi, I've this WSDL that works well. But if I remove the comments for operation confermationOrder axis fails to generate wrapped style server-side classe. Is there something wrong with my WSDL? Thanks ?xml version=1.0 encoding=UTF-8? wsdl:definitions name=ProductsExampleWS targetNamespace=http://ivenuti.altervista.org/ProductsExampleWS.wsdl; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:tns=http://ivenuti.altervista.org/ProductsExampleWS.wsdl; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsd1=http://ivenuti.altervista.org/ProductsExampleWS.xsd1; wsdl:types xsd:schema targetNamespace=http://ivenuti.altervista.org/ProductsExampleWS .xsd1 xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsd1=http://ivenuti.altervista.org/ProductsExampleWS.xsd1 xsd:complexType name=Product xsd:annotation xsd:documentationRappresents each product available for each order/xsd:documentation /xsd:annotation xsd:sequence xsd:element maxOccurs=1 minOccurs=1 name=id type=xsd:string/ xsd:element maxOccurs=1 minOccurs=1 name=description type=xsd:string/ xsd:element maxOccurs=1 minOccurs=1 name=price type=xsd:double/ xsd:element maxOccurs=1 minOccurs=1 name=currency type=xsd:string/ xsd:element maxOccurs=1 minOccurs=1 name=available type=xsd:boolean/ /xsd:sequence /xsd:complexType xsd:complexType name=ArrayOfProduct xsd:sequence xsd:element maxOccurs=unbounded minOccurs=1 name=item type=xsd1:Product/ /xsd:sequence /xsd:complexType xsd:complexType name=ArrayOfProductInOrder xsd:sequence xsd:element maxOccurs=unbounded minOccurs=1 name=item type=xsd1:ProductInOrder/ /xsd:sequence /xsd:complexType xsd:element name=productsListResponse type=xsd1:ArrayOfProduct /xsd:element xsd:element name=productsList type=xsd:date /xsd:element xsd:element name=confirmationOrder type=xsd:string /xsd:element xsd:element name=ElementArrayOfProductInOrder type=xsd1:ArrayOfProductInOrder /xsd:element xsd:element name=productsOrder type=xsd1:ArrayOfProductInOrder /xsd:element xsd:complexType name=OrderWithConfirmation xsd:sequence xsd:element maxOccurs=1 minOccurs=1 name=order type=xsd1:ArrayOfProductInOrder/ xsd:element maxOccurs=1 minOccurs=1 name=magic type=xsd:string/ /xsd:sequence /xsd:complexType xsd:element name=productsOrderResponse type=xsd1:OrderWithConfirmation /xsd:element xsd:element name=ElementMagic type=xsd:string /xsd:element xsd:element name=confirmationOrderResponse type=xsd:boolean /xsd:element xsd:complexType name=ProductInOrder xsd:sequence xsd:element maxOccurs=1 minOccurs=1 name=id type=xsd:string/ xsd:element maxOccurs=1 minOccurs=1 name=quantity type=xsd:nonNegativeInteger/ /xsd:sequence /xsd:complexType /xsd:schema /wsdl:types wsdl:message name=productsOrder wsdl:part element=xsd1:productsOrder name=productsOrder/ /wsdl:message wsdl:message name=productsOrderResponse wsdl:part element=xsd1:productsOrderResponse name=productsOrderResponse/ /wsdl:message wsdl:message name=productsList wsdl:part element=xsd1:productsList name=productsList/ /wsdl:message wsdl:message name=productsListResponse wsdl:part element=xsd1:productsListResponse name=productsListResponse/ /wsdl:message wsdl:message name=confirmationOrder wsdl:part element=xsd1:confirmationOrder name=confirmationOrder/ /wsdl:message wsdl:message
RE: BeanMapping and Subclasses
I don't get it You have B extending A. If you had public B getB() ; Then I would expect you to get B and A in the WSDL. But if you have public A getA() ; There is no reference of B, and no need for B in the public interface. It is B that extends A. Not A extends B. A does not depend on B. If the public interface references only A, nobody needs to care about B. And if you have public A[] getA2() ; Then again, you do not require any definition of B in the WSDL. Or have I read it wrong? -Dino -Original Message- From: Nigel Jewell [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 8:42 AM To: axis-user@ws.apache.org Subject: BeanMapping and Subclasses Hi all, I have a question regarding beanmapping, subclasses and arrays. If I have: class A class B extends A beanmapping for A and B The method: public A getA(); creates definitions for A and B in the WSDL - as required. If I have a method: public A[] getA(); only definitions for A are created in the WSDL. Am I missing something? -- Nige. URL: http://www.matrix-data.co.uk
RE: BeanMapping and Subclasses
Of course there is a need of B ... if I do: A getA() { return new B(); } I may want to cast the A into a B in the client and see the methods for B. Ahh, ok. You are supposing webservices is a way to do distributed objects. It is not true. If you want distributed Java objects, do RMI, and you'll get what you want. In webservices, the model is message exchange, not distributed objects. When you send an A, you are not sending an instance of an object, you are sending a message, formatted in XML and derived from the state of your instance of A. A message, not an object. Various webservices platforms and toolkits (like AXIS) provide a way to map between object instances and messages. In some uses people call this Java to XML binding. And some toolkits do this implicitly, more or less transparently, which makes it easy to imagine that there is no message and that you are in fact exchanging instances of objects. This is an incorrect model. On the client side, you will not see methods, or you should not see methods. The WSDL and XSD defines the data contract, or, in other words, the schema of the messages you are exchanging. The WSDL specifies no methods that are somehow attached to those messages. On the client side, you can generate a proxy from the WSDL, and doing that you should see an object (more or less implicitly mapped from the XML message), which is primarily used for data. In other contexts we called these objects DTO's (Fowler PEAA 401). --- Secondly, and totally independently If you do public A getA() ; I don't care what is inside the method, you are not exposing a B, therefore B is not part of the interface. This is true whether you do web services, or RMI. You might like callers to be able to cast the return value to B, but nothing in the interface says there is a B involved here or, this method will give you a B.Callers cannot know what you would like unless you write it in the interface.B is a special case of A, not a general case. Callers cannot assume they can cast any A to an instance of B. I don't know how RMI handles this situation; it may be possible to expose subclasses in the interface. But in webservices, generally not. Again, if I do: A[] getA2() { return new A[]{new A(), new B()}; } I still need to know the accessor and mutators for B. No. You might *like* to have all that stuff, but you don't need it. Or at least, you haven't specified that you need it, in the interface. You have specified in the interface, A. Which tells clients you can assume ONLY that this is an instance of A. It does not say anything about B, or any other class derived from A. It does not tell clients you can cast this to a specific subclass of A. If you want B, put it in the interface explicitly. Okay, to clarify ... ... Is that clearer? Ahh, your A is abstract as well. This doesn't change any of what I wrote above. -- Nige. URL: http://www.matrix-data.co.uk
RE: Invoking axis 1.2rc3 webservice returning an array from .NET framework 1.1
Have you done the WSDL First (tm) approach? Which is described here: http://wiki.apache.org/ws/FrontPage/Axis/DotNetInterop And here: http://wiki.apache.org/ws/DotNetInteropArrays -Original Message- From: harsha senanayake [mailto:[EMAIL PROTECTED] Sent: Thursday, April 07, 2005 1:14 PM To: axis-user@ws.apache.org Subject: Invoking axis 1.2rc3 webservice returning an array from .NET framework 1.1 Hi, I have been struggling to invoke a webservice method which returns any type of array from .Net. Whenever I call a method for eg. string[] list() found in http://127.0.0.1:8080/axis/EchoHeaders.jws i get an error saying Unhandled Exception: System.InvalidOperationException: There is an error in XML document (1, 308). --- System.InvalidOperationException: The specified type was not recognized: name='string', namespace='http://schemas.xmlsoap.org/soap/encoding/', at whoamiReturn xmlns=''. What am I doing wrong here? is there a work around for this problem? really appreciate if someone could help me out. thanks. Harsha
RE: updating http.proxyHost property in client
I saw this answer to this question last month on this list I think. -Dino You can provide your own implementation of TransportClientProperties. Here are some snippets of what I use for per-request proxy info for ColdFusion MX: /* * Axis is directed to use this class instead of * org.apache.axis.components.net.TransportClientProperties by * setting the System property * -Dorg.apache.axis.components.net.TransportClientProperties=coldfusion.xm l.rpc.AxisTran \ sportClientProperties * or by finding the following file * /META-INF/services/org.apache.axis.components.net.TransportClientPropert ies * with the full name of the replacement class (i.e. this one) in it. * P * This reads proxy settings from the MessageContext to give per-request proxy \ support */ public class AxisTransportClientProperties extends DefaultHTTPTransportClientProperties { public String getProxyHost() { // Retrieve proxy info from Message context every time String ret = null; MessageContext context = MessageContext.getCurrentContext(); if (context != null) { ret = (String) context.getProperty(coldfusion.proxyHost); } if (ret == null) { // use System property if set ret = super.getProxyHost(); } return ret; } } -Original Message- From: George Armhold [mailto:[EMAIL PROTECTED] Sent: Thursday, April 14, 2005 12:12 PM To: axis-user@ws.apache.org Subject: updating http.proxyHost property in client Is there a way to get Axis clients to recognize that http.proxyHost (and related properties) have changed? They seem to be read once, and thereafter the values are cached (see src/org/apache/axis/components/net/DefaultHTTPTransportClientProperties. java.) I have a preferences tab in my client that allows the user to change the proxy host, port, etc. Axis will not recognize the new values until the app has been restarted. Thanks.
RE: R: Ok with VB.NET, Axis Office VBA clients, error in SOAP:Perl...WSDL problem?
Worst case -- use the low-level API and generate the messages manually. In my experience with perl soap stacks, that has been the best case. -D -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: Friday, April 15, 2005 8:29 AM To: axis-user@ws.apache.org Subject: Re: R: Ok with VB.NET, Axis Office VBA clients, error in SOAP:Perl...WSDL problem? SOAP::Lite is generating a message that does not conform to the WSDL. I'm not familiar with SOAP::Lite, but I've seen other questions from users regarding these dynamically generated element names (c-gensym3), which are totally inappropriate. I'm sure there must be a way to get Perl to generate SOAP messages that conform to the WSDL. Worst case -- use the low-level API and generate the messages manually. Anne
RE: General Question about having custom Serializer/Deserializer
is it that the response soap message structure/format should be in accordance with the wsdl most of the times or it can be different provided we have custom (de)serializer on the client side ? No, The request and response messages have to conform to the WSDL. Always. A custom serializer is not intended to morph the XML on the wire so that it does not comply with the WSDL. A Custom serializer is intended to bridge between your chosen in-memory representation (a graph of objects) and the contracted wire format, described in the WSDL. What Anne has said previously is, Given a valid WSDL, any client should be able to interact with it. True. Now, if what you want is, on the client side, to instantiate a particular set of object types, That may require a custom serializer or de-serializer on the client side. In the same way, if on the server side you have an existing set of objects, you may want to map between a relatively flat and simple XML wire structure (for example), and a relatively hierarchical object graph. Hence, a custom serializer. You can also do this bridging, in application code, manually. -Original Message- From: Dark Devil [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 10:13 AM To: Anne Thomas Manes Cc: axis-user@ws.apache.org Subject: Re: General Question about having custom Serializer/Deserializer Anne, Thank you for the response. So is it that the response soap message structure/format should be in accordance with the wsdl most of the times or it can be different provided we have custom (de)serializer on the client side ? Thanks, Kumar.
RE: wrapped doc/literal and Object vs. primitive types
Is it OK to use the wrapper objects and arrays of wrapper objects, e.g. Long and Long[] vs. long and long[] for wrapped doc/literal? Will this work with .NET? Yes. Will wrapped doc/literal make this possible and allow sending null values which is not possible with the primitive types? No. Or is the recommendation to always use primitive types and forget about the wrapper objects? Either works, but what is it that you want to accomplish? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tim K. (Gmane) Sent: Tuesday, April 05, 2005 10:31 PM To: axis-user@ws.apache.org Subject: wrapped doc/literal and Object vs. primitive types Hello, Is it OK to use the wrapper objects and arrays of wrapper objects, e.g. Long and Long[] vs. long and long[] for wrapped doc/literal? Will this work with .NET? I know that it doesn't work for rpc/encoded with .NET as .NET will send xsd:long rather than soapenc:long so if a method takes a Long argument Axis will expect soapenc:long and instead it gets xsd:long. Will wrapped doc/literal make this possible and allow sending null values which is not possible with the primitive types? Or is the recommendation to always use primitive types and forget about the wrapper objects? Thank you for your answers. -- Tim
RE: How to make .NET/AXIS Client add namespace to soap message elements
Yes! Example wsdl:types schema elementFormDefault=qualified targetNamespace=http://ws.as.com/schemas/ds; xmlns=http://www.w3.org/2001/XMLSchema; complexType name=ORDER sequence element name=ORDERNUMBER type=xsd:int/ /sequence /complexType /schema schema elementFormDefault=qualified targetNamespace=http://ws.as.com/wsdl/ds; xmlns=http://www.w3.org/2001/XMLSchema; !-- request/response elements -- element name=getOrderDetails complexType sequence element name=order type=myns:ORDER/ /sequence /complexType /element element name=getOrderDetailsResponse complexType sequence element name=getOrderDetailsReturn type=myns:Whatever/ /sequence /complexType /element /schema ... -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: Friday, April 01, 2005 10:09 AM To: axis-user@ws.apache.org; babloosony Subject: Re: How to make .NET/AXIS Client add namespace to soap message elements If you write the WSDL, then you control the message structure. Define the ORDER element in a separate schema with the targetNamespace that you desire. Anne On Apr 1, 2005 8:51 AM, babloosony [EMAIL PROTECTED] wrote: Hi All, Say how can I below soap message from the client (can be .NET or AXIS) : 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 getOrderDetails xmlns=http://ws.as.com/wsdl/ds; ORDER ORDERNUMBER9/ORDERNUMBER /ORDER /getOrderDetails /soapenv:Body /soapenv:Envelope Now, in the above soap message I want to have this namespace declaration xmlns=http://ws.as.com/schemas/ds; like for ORDER element ORDER xmlns=http://ws.as.com/schemas/ds; Is there any configuration that I can in any of the below to achieve this : 1. .NET Framework 1.1 2. AXIS 1.2 RC2 3. in WSDL Is there anything that I can configure in my WSDL before giving to client's so that they can always send namespace for the soap message elements. Please suggest. Regards, Kumar.
RE: Newbie Question / .NET SOAP Service / Dataset / any / WSDL2Ja va
There are ways around it. Just of the top of my head I can think of 2. 1. reverse-engineer the dataset schema, build a WSDL that specifies the stuff you want, then build your java client from that. 2. build a .NET bridge app - that consumes the webservice, and exposes a different interface. The .NET app should get the DataSet, then transform that into an array of typed objects. Your Java client should then call the bridge app. -Original Message- From: Ralf Bust [mailto:[EMAIL PROTECTED] Sent: Friday, April 01, 2005 5:14 AM To: axis-user@ws.apache.org Subject: Re: Newbie Question / .NET SOAP Service / Dataset / any / WSDL2Ja va Yes, you are right. I totally agree. But usually for me as a client developer it is impossible to change anything on the server side :( I totally agree that programming first and generate the WSDL is totaly wrong. But is the only answer to my problem that AXIS is unusable for a service that uses MS Datasets? I am not going to imagine the amount of time implementing this client by hand :( rb Ruiz González, Jose de Jesus schrieb: Sorry, I posted my answer to another thread. As a Java Client, you never mind wich Database access technology a Web Service uses. That is the functionality of a Web Service, it´s an interface between your java Client And some (unknown) database. José de Jesús Ruiz Gonzalez Departamento de Sistemas México Asistencia S.A. de C.V. Sistema Internacional de Asistencia Mapfre * mailto:[EMAIL PROTECTED] *(52) 55 + 54801298 *Fax(52) 55 + 56112011 http://www.mexicoasistencia.com/ -Mensaje original- De: Dino Chiesa [mailto:[EMAIL PROTECTED] Enviado el: Miércoles, 30 de Marzo de 2005 03:36 a.m. Para: axis-user@ws.apache.org Asunto: RE: Newbie Question / .NET SOAP Service / Dataset / any / WSDL2Java Is Axis capable of using Datasets? No. You could do it, but it would be painful and expensive. Your service ought not to use Datasets, if it is intended to be interoperable with Java/AXIS, or any other non-.NET webservices stack. This is a classic case of implementation first design on the .NET service side, which breaks interoperability. If the service implementor (whoever) had followed the recommended practice and used the WSDL First (tm) approach, then you'd be sipping tea right now, smiling at how easy it all was to get things connected. Instead you're spelunking mailing lists looking for answers. -Dino Microsoft/ -Original Message- From: Ralf Bust [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 4:27 AM To: axis-user@ws.apache.org Subject: Newbie Question / .NET SOAP Service / Dataset / any / WSDL2Java Hi, i am currently developing a Client for an Airline Webservice. So i have to connect to a .NET Webservice witch is using Microsoft datasets. The WSDL2Java is generating me wrong Code.(My Opinion) It seems that the generation of source code failes on: s:any namespace=http://tempuri.org/RAAvailabilityRequestDS.xsd/ The Problem seems to be the type any witch referes to another xsd. I do not get errors, but the code generated does not look usable for me. A short test with a .Net Framework brings up complete different funktionality. Question: Is Axis capable of using Datasets? The WSDL can be found: http://services.radixx.com/RadixxFlights.asmx?WSDL Thx for help
RE: How to make .NET/AXIS Client add namespace to soap message elements
Can you show us the WSDL? -Original Message- From: Dino Chiesa [mailto:[EMAIL PROTECTED] Sent: Friday, April 01, 2005 10:40 AM To: axis-user@ws.apache.org Subject: FW: How to make .NET/AXIS Client add namespace to soap message elements Fwding to axis-user list. -Original Message- From: babloosony [mailto:[EMAIL PROTECTED] Sent: Friday, April 01, 2005 10:39 AM To: Dino Chiesa Subject: Re: How to make .NET/AXIS Client add namespace to soap message elements Hi Dino, I already have a seperate schema definition with its own namespace but still why the .NET does not include namespace for the ORDER element in its request soap message ? Please suggest ? - Kumar.
RE: Upgradings from Axis 1.1 to Axis 1.2 RC 3
I just re-generated, didn't have problems. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, March 31, 2005 4:16 AM To: axis-user@ws.apache.org Subject: Upgradings from Axis 1.1 to Axis 1.2 RC 3 Hi I'm just doing an upgrade to Axis 1.2 in the hope that I'll get some bug fixes in the new build. However, the code I've written just doesn't seem to work, which worked ok with Axis 1.1. I'm using code generated by WSDL2Java - will that need to be regenerated? Or are there other issues when upgrading to the newer versions of Axis? Thanks for your help James This email is intended solely for the use of the named addressee(s). Any unauthorised disclosure, copying or distribution of the confidential information contained therein, or the taking of any action based on it, is prohibited. The sender disclaims any liability for the integrity of this email. Legally binding declarations must be in written form.
RE: Newbie: installing a WAR in Tomcat
Oh ! Well, then ... For jboss/jetty I just drop a war into the jboss deploy dir and it auto-deploys. I think the same thing is possible with Tomcat. . . But I don't know (maybe there is a better mailing list - seems to be a tomcat question) -Original Message- From: Adilson Vahldick [mailto:[EMAIL PROTECTED] Sent: Friday, April 01, 2005 2:34 PM To: axis-user@ws.apache.org Subject: RES: Newbie: installing a WAR in Tomcat Dino For Tomcat is similar. But I wont copy de classes in this folder (chuif chuif) I want use my .WAR. I want put my .WAR somewhere that run it. I want do something that my .WAR run it. Thanks for the help Adilson -Mensagem original- De: Dino Chiesa [mailto:[EMAIL PROTECTED] Enviada em: sexta-feira, 1 de abril de 2005 15:39 Para: axis-user@ws.apache.org Assunto: RE: Newbie: installing a WAR in Tomcat For Jetty, just copy the axis webapp to the jetty webapps directory, then drop in your jws or compile your classes to {jettyroot}\webapps\{YourAxisWebapp}\WEB-INF\classes and off you go. I would guess tomcat is similar? -Original Message- From: Adilson Vahldick [mailto:[EMAIL PROTECTED] Sent: Friday, April 01, 2005 8:59 AM To: axis-user@ws.apache.org Subject: Newbie: installing a WAR in Tomcat Hello, I did the J2SE tutorial 1.4, the WEB-SERVICE chapter. The WAR produced run in Sun App Server and JBoss, just copying it. How can I do some simple in Tomcat? Thanks Adilson
RE: Axis 1.1 to 1.2rc3 with WebSphere 5.1.0
what problem are you having? From: Khaled Hamada [mailto:[EMAIL PROTECTED] Sent: Friday, April 01, 2005 3:38 PMTo: axis-user@ws.apache.orgSubject: Axis 1.1 to 1.2rc3 with WebSphere 5.1.0 Hi, I'm using WebSphere 5.1.0 and I'm having problem when I upgraded from Axis 1.1 to Axis 1.2RC3. Is WebSphere 5.1.0 not compatible with axis 1.2RC3?? Thanks, Khaled
RE: Java Client, .NET server... and the Oreilly book...
So, has anyone actually written a web service client that can communicate with a .NET server? Yes. Here's an example of a .NET (ASMX) webservice with an AXIS client. http://cheeso.members.winisp.net/zips/ There is a working AXIS/JSP web client (AXIS v1.1) of the service. Also the sourcecode of that client is available, as is the sourcecode for a AXIS/SWT fat client, and other clients. The service accepts strings as input and returns arrays of strings or a complex type as output. The AXIS clients use doc/lit. There is also an RPC/Enc interface to the same service implementation, but you should ignore that! Sorry, no authentication ! And it's not sharepoint! -D -Original Message- From: John Windberg [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 1:34 AM To: axis-user@ws.apache.org Subject: Java Client, .NET server... and the Oreilly book... So, has anyone actually written a web service client that can communicate with a .NET server? I'd love proof that it can be done. So far I've seen references to things the other way around, and pointers to classes that don't actually exist in the 1.1 axis jar. I suppose most people using axis are written services, and I look forward to doing that myself, but right now, it's clients, and what I need to talk to is a Microsoft SharePoint server... My only working code so far is based on the classes generated from WSDL2Java for a public exchange rate service. No security involved. Create a service, get an endpoint, get a call, add some parameters, invoke the call. What am I suppose to do with a with a Sender? On that note, anyone know what's up with the programming axis book from Oreilly? I pre-ordered it from amazon, but its not been listed as available yet, and I could not find it on oreilly's site.
RE: Newbie Question / .NET SOAP Service / Dataset / any / WSDL2Java
Is Axis capable of using Datasets? No. You could do it, but it would be painful and expensive. Your service ought not to use Datasets, if it is intended to be interoperable with Java/AXIS, or any other non-.NET webservices stack. This is a classic case of implementation first design on the .NET service side, which breaks interoperability. If the service implementor (whoever) had followed the recommended practice and used the WSDL First (tm) approach, then you'd be sipping tea right now, smiling at how easy it all was to get things connected. Instead you're spelunking mailing lists looking for answers. -Dino Microsoft/ -Original Message- From: Ralf Bust [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 4:27 AM To: axis-user@ws.apache.org Subject: Newbie Question / .NET SOAP Service / Dataset / any / WSDL2Java Hi, i am currently developing a Client for an Airline Webservice. So i have to connect to a .NET Webservice witch is using Microsoft datasets. The WSDL2Java is generating me wrong Code.(My Opinion) It seems that the generation of source code failes on: s:any namespace=http://tempuri.org/RAAvailabilityRequestDS.xsd/ The Problem seems to be the type any witch referes to another xsd. I do not get errors, but the code generated does not look usable for me. A short test with a .Net Framework brings up complete different funktionality. Question: Is Axis capable of using Datasets? The WSDL can be found: http://services.radixx.com/RadixxFlights.asmx?WSDL Thx for help -- Ralf Bust
RE: Getting StackOverflow error while trying to invoke the service
Title: Getting StackOverflow error while trying to invoke the service You can prevent loops by normalizing your data schema. for example, look at the cyclic loop in the storage namespace. you have devices that contain volumes, and volumes that contain devices.this schema design in itself is not an error, but it strikes me as a bit loose. And the pitfall is: inserting a cycle into your Java-side data structures will cause a loop at runtime. If DeviceA includes VolumeA, and VolumeA contains DeviceA, sayonara. I suspect this is what is happening. if you normalize your data model, you may easily avoid this. Specify a VolumeId and a DeviceId, for example. The Device itself can include a VolumeId, which refers to an externally definedVolume. Maybe the Id is a UUID. Maybe an int.whatever. This way you have references to Volumes, not actual volumes. I would use the reference when the relationship is "isContainedBy or belongsTo. I would use the actual containment when the relationship between respective types is "contains". If you get my meaning. If a device contains volumes, then the Volume type should refer to a DeviceId, rather than containing an actual device. The other spots you identified, where a type contains an array of itself, or where typeA contains typeB which contains an array of typeA.. . (your contentContainer types and related). This is also a potential source of loops, but again is not an error in schema design. If you introduce a loop in your object graph at runtime, then AXIS will loop endlessly trying to serialize it. If you don't build cycles into the object graph, then you won't experience the problem. This area didn't bother me as much as the device/volume situation, because it seems there are more obvious scenarios where this sort of type nesting makes sense. But if looping is likely, you could apply the same reference approach here. From: Soti, Dheeraj [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 8:46 PMTo: 'axis-user@ws.apache.org'Subject: Getting StackOverflow error while trying to invoke the service I do have cyclic loops at some places. Any idea how to prevent this? See the WSDL below. I have highlighted the suspected places in red. Thanks Dheeraj ?xml version="1.0" encoding="UTF-8"? wsdl:definitions targetNamespace="http://services.hrs.harris.com/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://services.hrs.harris.com/" xmlns:intf="http://services.hrs.harris.com/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://services.hrs.harris.com/" xmlns:content="http://content.services.hrs.harris.com/" xmlns:media="http://media.services.hrs.harris.com/" xmlns:device="http://device.services.hrs.harris.com/" xmlns:storage="http://storage.services.hrs.harris.com/" xmlns:timecode="http://timecode.services.hrs.harris.com/" xmlns:config="http://config.services.hrs.harris.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" !--WSDL created by Apache Axis version: 1.2RC2 Built on Nov 16, 2004 (12:19:44 EST)-- wsdl:types schema targetNamespace="http://timecode.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema" complexType name="ImmutableFrameTime" sequence element name="frameCount" type="xsd:long"/ element name="frameRate" type="xsd:double" / /sequence /complexType complexType name="TimeCodeImpl" sequence element name="frameTime" nillable="true" type="timecode:ImmutableFrameTime"/ /sequence /complexType /schema schema targetNamespace="http://media.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema" complexType name="Media" sequence element name="id" type="xsd:long"/ element name="storageFile" type="storage:StorageFile"/ element name="som" type="timecode:ImmutableFrameTime"/ element name="resolution" type="xsd:int"/ /sequence /complexType /schema schema elementFormDefault="qualified" targetNamespace="http://content.services.hrs.harris.com/" xmlns="http://www.w3.org/2001/XMLSchema" complexType name="MultiSegment" sequence element name="id" type="xsd:long"/ element name="name" type="xsd:string"/ element name="description" nillable="true" type="xsd:string"/ element name="som" nillable="true" type="timecode:ImmutableFrameTime"/ element name="duration" nillable="true" type="timecode:ImmutableFrameTime"/ element name="parentContainer" type="content:ContentContainer"/ element name="segmentIndex" nillable="true" type="xsd:int"/ element name="contentMetadata" type="content:ProgramContent"/ /sequence /complexType complexType name="ContentContainer" sequence element name="contentMetadata" type="content:ProgramContent"/ element name="id" type="xsd:long"/ element name="name" type="xsd:string"/ element name="description" nillable="true" type="xsd:string"/
RE: errors with WSDL2Java command
SOAP is just a formatting and data envelope standard. It can serialize anything including exceptions. But to receive serialized exceptions on the client side, the webservice runtime must play a role - and serialize any exceptions uncaught by the application, into SOAP exceptions to be sent across the wire. And likewise, the client-side runtime must grab those exceptions, in order that the client-side app can catch and handle them. The AXIS runtime does this, on both sides, so I do not think you need to grab exceptions at the application layer, format them to strings, and return them. But the formatting-exceptions-as-strings thing is beside the original point, which was... What? You've clipped the thread history and I don't remember it now. -Original Message- From: Hamza Hydri [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 30, 2005 7:04 AM To: axis-user@ws.apache.org Subject: Re: errors with WSDL2Java command when I run this command at cmd prompt i get the sam error. let me explain the scenario further ... the ExampleService class is having two methods ... the methods are having a return type as ExecResult bcoz I want to run these methods on remote locations ... and if these methods cause any exceptions I want to catch them on my host location ..I am doing this as I guess SOAP cannot transfer exceptions on wire .. so I am converting the exceptions generated into strings and returning them to the host machine. I guess there is some error in my definition tag of the wsdl file do I have to define the ExecResult as any return type ? .. seriously confused with this thing ... anybody out there with suggestions or hints ?
RE: .NET cred
Username/pw are basic auth But there is nothing that should prevent you from using this with .NET. Here's a quick refresher for how to enable this in .Net http://samples.gotdotnet.com/quickstart/aspplus/doc/secureservices.aspx The C# example you cited uses whatever the default creds are, which could be kerberos or NTLM, but is probably not applicable to a Java/AXIS client. -Dino -Original Message- From: John Windberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 12:16 PM To: axis-user@ws.apache.org Subject: .NET cred I'm trying to write a client to talk to the web services that are part of Microsoft SharePoint services. I've been scouring through the lists to find out how to authenticate the client, setup the credentials, whatever it is that I'm suppose to do. setUserName and setPassword are apparently basic auth and don't work with .NET The C# example in the Sharepoint SDK merely does this: myservice.Credentials = System.Net.CredentialCache.DefaultCredentials; Can anyone point me to a how/to, readme, or example? Thanks -J
RE: getting rid of ArrayOf in WSDL
Title: getting rid of ArrayOf in WSDL http://wiki.apache.org/ws/DotNetInteropArrays From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 23, 2005 4:13 AMTo: axis-user@ws.apache.orgSubject: getting rid of ArrayOf in WSDL Sorry if this has been asked before... Is there anyway of using the Java2WSDL command to produce wrapped/literal WSDL that does NOT create separate complex types for Arrays. In other words, I would like to see complexType name="FullSearchCriteria" complexContent extension base="tns5:SearchCriteria" sequence element name="sortField" nillable="true" type="tns10:Property"/ element name="queries" nillable="true" maxOccurs="unbounded" type="tns10:Query"/ /sequence /extension /complexContent /complexType (as I cannot get ArrayOf version to work with .NET client) instead of complexType name="ArrayOf_tns10_Query" sequence element maxOccurs="unbounded" minOccurs="0" name="item" type="tns10:Query"/ /sequence /complexType . complexType name="FullSearchCriteria" complexContent extension base="tns5:SearchCriteria" sequence element name="sortField" nillable="true" type="tns10:Property"/ element name="queries" nillable="true" type="impl:ArrayOf_tns10_Query"/ /sequence /extension /complexContent /complexType This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately. Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.
RE: .NET cred
I don't know anything about the Lavadora plugin -Original Message- From: John Windberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 29, 2005 1:15 PM To: axis-user@ws.apache.org Subject: Re: .NET cred Oh, I suppose I ought add that the existing java classes I'm using were created with the Lavadora Plugin for Eclipse. I just pointed it at http://servername/_vti_bin/lists.asmx?WSDL and there they were. That's the same as WSDL2Java isn't it? -J
RE: Re: can I use Axis for this?
AXIS does this too, there was a post a couple of days (a week? 10 days?) ago on this. Also XMLBeans And Castor And one other I forget -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Tim K. (Gmane) Sent: Tuesday, March 29, 2005 6:42 PM To: axis-user@ws.apache.org Subject: Re: can I use Axis for this? Have you looked at this: http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLDecoder.html http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLEncoder.html Or JAXB http://java.sun.com/xml/jaxb/ Tim [EMAIL PROTECTED] wrote: Greetings list, I need to deserialize xml file to java objects, could anyone give me some suggestions? Can I use axis for this purpose? Once a xml file is parsed to a DOM tree, is there a nice tool to use to get the object(s) if the Class is given? I'm thinking that a tool should be able to figure it out how to populate the java object using reflection when having the DOM tree. Your suggestions will be appreciated! Thanks Richard
RE: .NET and Axis
Title: .NET and Axis terrific, I'm glad it worked for you. Your approachsounds like a good one. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 18, 2005 8:12 AMTo: axis-user@ws.apache.orgSubject: RE: .NET and Axis Hi Dino, thanks for your suggestion but I have found that I can generate helper classes using --helperGen on the WSDL2Java command. These helper classes contain the typeDesc code that Axis uses for it serialization. BeanSer/Deser actually tries to load these _Helper classes if the getTypeDesc static method is not found is the X.class in order to get the TypeDesc. I have found that I need to use a variation of the WSDL first approach as the axis generated WSDL contains ArrayOf elements which I cannot get to work with my .NET client. ButI can usemy existing classes and a wrapped/literal service if I include the generated Helper classes and edit the WSDLas below. The steps I follow are therefore: 1. Java2WSDL 2. Edit the ArrayOf XML 3. WSDL2Java using --helperGen and it works. Thanks for all your help. complexType name="ArrayOf_tns2_X" sequence element maxOccurs="unbounded" minOccurs="0" name="item" type="tns2:X"/ /sequence complexType name="Y" complexContent sequence element name="queries" nillable="true" type="impl:ArrayOf_X"/ /sequence /complexContent /complexType gets changes to element name="Y" complexType sequence element maxOccurs="unbounded" name="X1" type="tns2:X"/ /sequence /complexType /element -Original Message-From: Dino Chiesa [mailto:[EMAIL PROTECTED]Sent: 15 March 2005 2:19 To: Dino Chiesa; axis-user@ws.apache.orgCc: Cooke, AedemarSubject: RE: .NET and Axis Aedmar, One last thing. . . If I take your inquiry.wsdl, and modify it, I cangenerate a .NET client that accepts the response.xml that you included previously. The modifications are: - collapse all schema into a single schema, targetNamespace="http://inquiry.webservice.gpb.rbc.com" - re-definetns3 and tns4 to be "inquiry.webservice.gpb.rbc.com" rather than util... and customer In other words, effectively I redefine all types used in the wsdl to reside in a single namespace. ("inquiry.blah.blah"). Then, the .NET client generated from such a WSDL can consume the response document you sent out. I don't feel quite right in doing this. Effectively I have turned the contract on its head - I am writing the WSDL to conform to the actual XML on the wire, rather than the other way 'round ("WSDL First", which as you know is the One True Way to Interop Enlightenment). But,on the other hand, WSDL is just a tool, no? Modifying the WSDL in this way may be completely acceptable. Of course, a better approach is to convince AXIS to generate a WSDL like that, automatically. How? Just modify the WSDDso that all your custom types (Code, BankIdentifier, GPBException, etc) all reside in the same XMLNS, "http://inquiry.webservice.gpb.rbc.com" Then, the auto-gen'd WSDL should reflect the XML on the wire. -Dino From: Dino Chiesa Sent: Tuesday, March 15, 2005 7:59 AMTo: 'axis-user@ws.apache.org'Subject: RE: .NET and Axis ahh, sorry, I don't know much about custom serializers for AXIS, someone else maybe on the list can help you with that. maybe you need to restate the question (it has been a long-ish thread, and probably lots of people tuned out). From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 6:30 AMTo: axis-user@ws.apache.orgSubject: RE: .NET and Axis Hi Dino, you can get it working because you are using the Axis generated Java beans which contains class specific Serializer and Deserializer code. If I cut and paste the Axis generated Serializer and Deserializer code into my existing classes it works aswell. Thanks to you I have recognised the problem, i.e., that using the de/serializers specified in the server-config.wsdd file creates name space issues. typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" qname="ns5:BankIdentifier" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" type="java:com.rbc.gpb.util.BankIdentifier" xmlns:ns5="http://util.gpb.rbc.com"/ typeMapping deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" qname="ns6:Code" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" type="java:com.rbc.gpb.util.Code" xmlns:ns6="http://util.gpb.rbc.com"/ Any idea how
RE: Axis, .Net and return types
If you have the WSDL then you can run WSDL2Java , and generate - a client-side AXIS proxy class that enables an RPC-like programming model - Java classes that correspond to the WSDL/XSD types (DTO's?) In your java app, you will then do: ReturnType ret= proxy.Method1(param1, param2); The param1 and param2, whatever types they are, get automagically serialized into XML and sent over the wire. Upon return, the returned XML automagically gets de-serialized into an instance of ReturnType (whatever it is). You can then party on the JavaBean: ret.getProperty1(); //etc If you want to use the messaging metaphor, and really just get a DOM, then morph the WSDL to return an xsd:any , and I believe the AXIS WSDL2Java will generate for you a method that returns a DOM (or Element or Node or something similar). None of this is particular to .NET. This is just how AXIS exploits WSDL. -D -Original Message- From: Paul Hunnisett [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 7:24 AM To: axis-user@ws.apache.org Subject: Axis, .Net and return types I'm trying to write a client to a .Net service using axis libs. The service itself returns XML but, despite that, is an RPC service as opposed to a messaging service. The problem I'm encountering is deserializing the return type. I know it's XML ( I think a DOM, although it may jsut be a string) but the wsdl says that it's something like: GetModuleMarksResponseGetModuleMarksResult How can I retrieve this as something useful? Ideally an org.w3c.dom.Document... Paul Hunnisett
RE: Array of objects
http://dinoch.dyndns.org:7070/axis1.2/AboutArrays2.jsp -Original Message- From: bohldan bohldan [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 5:37 AM To: axis-user@ws.apache.org Subject: Array of objects Hi I think ive tried everything and i searched for a while now on how i send an array of object. If someone has something that works can that someone be nice to give me an example of the client, wsdd file. This is how my code look like.. client --- String endpointURL = http://localhost:8080/axis/services/GlazeService;; Service service = new Service(); Call call = (Call) service.createCall(); QName qn = new QName( urn:GlazeService, User ); call.setOperationName(ldap_GetAllUsernames); call.setTargetEndpointAddress( new java.net.URL(endpointURL) ); call.registerTypeMapping( User.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(User.class, qn), new org.apache.axis.encoding.ser.BeanDeserializerFactory(User.class,qn)); User[] tomte = (User[])call.invoke(new Object [] {}); System.out.println(Size: + tomte.length); for(int i = 0; i tomte.length; i++){ System.out.println(tomte[i].getGecos()); } wsdd file --- deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; xmlns:glaze=urn:GlazeService.Service service name=GlazeService provider=java:RPC parameter name=className value=GlazeService.Service/ parameter name=allowedMethods value=*/ beanMapping languageSpecificType=java:GlazeService.Service qname=ns1:User xmlns:ns1=urn:GlazeService/ typeMapping qname=glaze:ArrayOfUser type=java:GlazeService.User[] serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:glaze=urn:GlazeService/ /service /deployment _ Hitta rätt på nätet med MSN Sök http://search.msn.se/
RE: WSDL generation
WS-I BP1.1 advises against the guidance of WSDL 1.1 spec, on the point of arrays. Go to http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html And search for soapenc:Array (section 4.3.3) : *** Begin Excerpt *** The recommendations in WSDL 1.1 Section 2.2 for declaration of array types have been interpreted in various ways, leading to interoperability problems. Further, there are other clearer ways to declare arrays. R2110 In a DESCRIPTION, declarations MUST NOT extend or restrict the soapenc:Array type. R2111 In a DESCRIPTION, declarations MUST NOT use wsdl:arrayType attribute in the type declaration. R2112 In a DESCRIPTION, elements SHOULD NOT be named using the convention ArrayOfXXX. R2113 An ENVELOPE MUST NOT include the soapenc:arrayType attribute. *** End Excerpt *** AXIS seems to comply with the WS-I BP1.1 recommendation. -Dino -Original Message- From: jayachandra [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 3:28 AM To: axis-user@ws.apache.org; axis-dev@ws.apache.org Subject: WSDL generation Trying to analyse some problem, I had to refer to wsdl 1.1 spec. There under the 'Types' section [http://www.w3.org/TR/wsdl#_types , 3rd bullet point], there is this mention. ** Begin of Excerpt ** Array types should extend the Array type defined in the SOAP v1.1 encoding schema (http://schemas.xmlsoap.org/soap/encoding/) (regardless of whether the resulting form actually uses the encoding specified in Section 5 of the SOAP v1.1 document). Use the name ArrayOfXXX for array types (where XXX is the type of the items in the array). The type of the items in the array and the array dimensions are specified by using a default value for the soapenc:arrayType attribute. At the time of this writing, the XSD specification does not have a mechanism for specifying the default value of an attribute which contains a QName value. To overcome this limitation, WSDL introduces the arrayType attribute (from namespace http://schemas.xmlsoap.org/wsdl/) which has the semantic of providing the default value. If XSD is revised to support this functionality, the revised mechanism SHOULD be used in favor of the arrayType attribute defined by WSDL. ** End of Excerpt ** So does this mean even in DOCUMENT/LITERAL and WRAPPED/LITERAL kind of wsdl we should have for an array type (e.g: public Point[] myPoints;) a wsdl that reads as complexType name=ArrayOfPoint complexContent restriction base=soapenc:Array attribute ref=soapenc:arrayType wsdl:arrayType=impl:Point[]/ /restriction /complexContent /complexType Currently in axis we get a wsdl fragment that looks like complexType name=ArrayOfPoint sequence element maxOccurs=unbounded minOccurs=0 name=item type=impl:Point/ /sequence /complexType Which one is correct? Any insight into this issue will be very much appreciated. Thanks in advance Jaya
RE: Array of objects
I can't figure out why you'd be having troubles with the link. It works for me and it is working for other people, too. I can see in the logs that it is succeeding. . . . Sorry, -D -Original Message- From: Elaine Nance [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 11:15 AM To: axis-user@ws.apache.org Subject: Re: Array of objects Link reports Document has no data Dino Chiesa wrote: http://dinoch.dyndns.org:7070/axis1.2/AboutArrays2.jsp -Original Message- From: bohldan bohldan [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 5:37 AM To: axis-user@ws.apache.org Subject: Array of objects Hi I think ive tried everything and i searched for a while now on how i send an array of object. If someone has something that works can that someone be nice to give me an example of the client, wsdd file. This is how my code look like.. client --- String endpointURL = http://localhost:8080/axis/services/GlazeService;; Service service = new Service(); Call call = (Call) service.createCall(); QName qn = new QName( urn:GlazeService, User ); call.setOperationName(ldap_GetAllUsernames); call.setTargetEndpointAddress( new java.net.URL(endpointURL) ); call.registerTypeMapping( User.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(User.class, qn), new org.apache.axis.encoding.ser.BeanDeserializerFactory(User.class,qn)); User[] tomte = (User[])call.invoke(new Object [] {}); System.out.println(Size: + tomte.length); for(int i = 0; i tomte.length; i++){ System.out.println(tomte[i].getGecos()); } wsdd file --- deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; xmlns:glaze=urn:GlazeService.Service service name=GlazeService provider=java:RPC parameter name=className value=GlazeService.Service/ parameter name=allowedMethods value=*/ beanMapping languageSpecificType=java:GlazeService.Service qname=ns1:User xmlns:ns1=urn:GlazeService/ typeMapping qname=glaze:ArrayOfUser type=java:GlazeService.User[] serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:glaze=urn:GlazeService/ /service /deployment _ Hitta rätt på nätet med MSN Sök http://search.msn.se/ -- ~~ | Computers are useless. They can only give you answers. | -- Pablo Picasso -- ~~
.NET Interop
FYI I updated the AXIS wiki page on .NET Interop http://wiki.apache.org/ws/FrontPage/Axis/DotNetInterop And added a new page http://wiki.apache.org/ws/DotNetInteropArrays
RE: Help about Array and WSDL
Sorry, I don't speak rpc/enc (on moral principles), so I cannot help you to build such a service. But it works in doc/lit, so... ? Maybe you should use *that* ? -Original Message- From: James Black [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 5:00 PM To: axis-user@ws.apache.org Subject: Re: Help about Array and WSDL -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [EMAIL PROTECTED] wrote: | Hi James, | yes, java2wsdl and wsdl2java work fine, however a wrapper type | (ArrayOfXxx) for the array is created. | My method is: | Note[] findNotesByCooperationId(int cooperationId) and my wsdl | generated by Java2WSDL is: | ... | schema targetNamespace=http://business.annotation.infravida.cenas; | xmlns=http://www.w3.org/2001/XMLSchema; | import | namespace=http://ws.communication.annotation.infravida.cenas/ | import namespace=http://schemas.xmlsoap.org/soap/encoding// | complexType name=Note | sequence | element name=author nillable=true type=xsd:string/ | element name=cooperationId type=xsd:int/ | element name=date nillable=true type=xsd:dateTime/ | element name=note nillable=true type=xsd:string/ | element name=id type=xsd:int/ | /sequence | /complexType | /schema | schema | targetNamespace=http://ws.communication.annotation.infravida.cenas; | xmlns=http://www.w3.org/2001/XMLSchema; | import namespace=http://business.annotation.infravida.cenas/ | import namespace=http://schemas.xmlsoap.org/soap/encoding// | complexType name=ArrayOf_tns2_Note complexContent | restriction base=soapenc:Array |attribute ref=soapenc:arrayType wsdl:arrayType=tns2:Note[]/ | /restriction | /complexContent | /complexType | /schema | /wsdl:types | wsdl:message name=findNotesByCooperationRequest | wsdl:part name=in0 type=xsd:int/ /wsdl:message wsdl:message | name=findNotesByCooperationResponse |wsdl:part name=findNotesByCooperationReturn | type=impl:ArrayOf_tns2_Note/ | /wsdl:message | ... | Is it Correct? Is my wsdl WS-I compliant? ~ It isn't WS-I compliant if you use rpc/enc, but, at the moment my priority is on having the webservice working, and aim for compliance when axis will work with me on this. :) - -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCN1rOikQgpVn8xrARAm/8AKCRRkkiqtmFjsk3dTTC1gXVrIuUAQCbBtQg V9gl96OVlxQy//RLVeEoDOE= =gDo4 -END PGP SIGNATURE-
RE: org.xml.sax.SAXException: SimpleDeserializer encountered a child element...
The reason I say the WSDL isn't valid is, for example, the wsdl: prefix is not defined: wsdl:definitions targetNamespace=http://localhost:8080/poc-axis-server/services/MessageS ervice What is the meaning of the wsdl: prefix in the above ? There are a bunch of other missing prefixes: xsd, impl, etc. -Original Message- From: BALDWIN, ALAN J [AG-Contractor/1000] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 5:40 PM To: 'axis-user@ws.apache.org' Subject: RE: org.xml.sax.SAXException: SimpleDeserializer encountered a child element... Actually, that WSDL validated in the eclipse plugin... I was including an external wsdl into the wsdd file so that axis would not generate one for me. I have determined that is not the problem. Here is what is happening now (I've been dealing with this issue for a while): I have a PurchaseOrder java bean with a description field on it. Again, I'm using document/literal. If the soap message looks like this, it works: SOAP-ENV:Body echoMessage descriptiontest.../description /echoMessage SOAP-ENV:Body This does NOT work: SOAP-ENV:Body echoMessage PurchaseOrder descriptiontest.../description PurchaseOrder /echoMessage SOAP-ENV:Body When I put the PurchaseOrder node in, it breaks. This is just a proof of concept service, but when we implement, I will need the root node in there to validate against an industry standard schema. In this case, I'm just using PurchaseOrder. Any ideas? Thanks for the reply. Here is the WSDL: (copied from the running service, auto-generated from axis) wsdl:definitions targetNamespace=http://localhost:8080/poc-axis-server/services/MessageS ervice !-- WSDL created by Apache Axis version: 1.2RC2 Built on Nov 16, 2004 (12:19:44 EST) -- wsdl:types schema elementFormDefault=qualified targetNamespace=http://localhost:8080/poc-axis-server/services/MessageS ervice complexType name=purchaseOrder sequence element name=description nillable=true type=xsd:string/ /sequence /complexType element name=echoMessageReturn type=xsd:string/ /schema schema elementFormDefault=qualified targetNamespace=http://server.web.services.farmsource.com; import namespace=http://localhost:8080/poc-axis-server/services/MessageService / element name=po type=impl:purchaseOrder/ /schema /wsdl:types wsdl:message name=echoMessageResponse wsdl:part element=impl:echoMessageReturn name=echoMessageReturn/ /wsdl:message wsdl:message name=echoMessageRequest wsdl:part element=tns1:po name=po/ /wsdl:message wsdl:portType name=JaxRpcMessageService wsdl:operation name=echoMessage parameterOrder=po wsdl:input message=impl:echoMessageRequest name=echoMessageRequest/ wsdl:output message=impl:echoMessageResponse name=echoMessageResponse/ /wsdl:operation /wsdl:portType wsdl:binding name=MessageServiceSoapBinding type=impl:JaxRpcMessageService wsdlsoap:binding style=document transport=http://schemas.xmlsoap.org/soap/http/ wsdl:operation name=echoMessage wsdlsoap:operation soapAction=/ wsdl:input name=echoMessageRequest wsdlsoap:body use=literal/ /wsdl:input wsdl:output name=echoMessageResponse wsdlsoap:body use=literal/ /wsdl:output /wsdl:operation /wsdl:binding wsdl:service name=JaxRpcMessageServiceService wsdl:port binding=impl:MessageServiceSoapBinding name=MessageService wsdlsoap:address location=http://localhost:8080/poc-axis-server/services/MessageService; / /wsdl:port /wsdl:service /wsdl:definitions -Original Message- From: Dino Chiesa [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 4:24 PM To: axis-user@ws.apache.org Subject: RE: org.xml.sax.SAXException: SimpleDeserializer encountered a child element... It looks like a disagreement in XML namespace. The echoMessage in the wsdl appears to be in a particular namespace, whereas the VB6 client is sending a message in no namespace at all. echoMessage PurchaseOrder descriptionstring/description /PurchaseOrder /echoMessage The WSDL you sent isn't a real wsdl. It is missing a bunch of stuff? So it is hard to say whether what I wrote above is right. -Original Message- From: BALDWIN, ALAN J [AG-Contractor/1000] [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 5:03 PM To: 'axis-user@ws.apache.org' Subject: RE: org.xml.sax.SAXException: SimpleDeserializer encountered a child element... Here is the response I'm getting, if this helps. I've seen several people having this problem on the web, but nobody seems to have posted any fixes
RE: .NET and Axis
~ I am working on a testcase for the beehive project that I will later do under axis also, to show the problems that axis has with .net clients. Interesting way to look at it. Rather than showing the problems, my approach has been to document how to get them to talk nicely with each other. ~ I am sticking with rpc/encoded for anything that is involving arrays of beans. James, any reason why? It's your prerogative, but it is against WS-I and isn't necessary, according to the examples I have developed. -D
RE: .NET and Axis
Title: .NET and Axis If you look in the deploy.wsdd that Iattached with the last mailyou should see a typeMapping for getCustomerResonse (X = Customer). Are you saying you don't get these typeMappings when you run WSDL2Java on my inquiry.wsdl? Any idea why that is? Ah, I'm sorry. When I use AXIS v1.1, I don't get a typeMapping for getCustomerResponse. when I use AXIS v1.2RC3 , I do get a typeMapping for getCustomer and getCustomerResponse. But I don't think this is the central mystery here. Looking at your deploy.wsdd, and the Reference.cs, and the sample XML response, I believe it is a namespace issue. In the response XML, the CustomerDTO is serialized into an element named "getCustomerReturn". This elt has no namespace defined for it, and so uses the namespace of its parent, the getCustomerResponse element, which is explicitly specified here: getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com" But, based on the WSDL,.NET is expecting the CustomerDTO to be serialized into this namespace: "http://customer.util.gpb.rbc.com" . Hence, the namespace cross-up, as we suspected. Your actual response is like this: soapenv:Body getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com" getCustomerReturn isBooksKeptfalse/isBooksKept officerCode xsi:nil="true" / hasWarningsfalse/hasWarnings type xsi:nil="true" / isRestrainedfalse/isRestrained state xsi:nil="true" / currency xsi:nil="true" / shortName xsi:nil="true" / postalCode xsi:nil="true" / legalName xsi:nil="true" / id bank1/bank transit1880/transit key xsi:nil="true" / number117/number /id status xsi:nil="true" / address4 xsi:nil="true" / dateOpened xsi:nil="true" / address3 xsi:nil="true" / dateOfBirth xsi:nil="true" / address2 xsi:nil="true" / address1 xsi:nil="true" / messages xsi:nil="true" / nameTest Name/name /getCustomerReturn /getCustomerResponse /soapenv:Body/soapenv:Envelope But what .NET is expecting is like this: soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:Body getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com" getCustomerReturn shortName xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / currency xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / isRestrained xmlns="http://customer.util.gpb.rbc.com"false/isRestrained status xmlns="http://customer.util.gpb.rbc.com"Loss/status hasWarnings xmlns="http://customer.util.gpb.rbc.com"false/hasWarnings id xmlns="http://customer.util.gpb.rbc.com" bank xmlns="http://util.gpb.rbc.com"17/bank transit xmlns="http://util.gpb.rbc.com"102/transit key xmlns="http://util.gpb.rbc.com"love/key number xmlns="http://util.gpb.rbc.com"0/number /id isBooksKept xmlns="http://customer.util.gpb.rbc.com"false/isBooksKept officerCode xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / type xmlns="http://customer.util.gpb.rbc.com" description xmlns="http://util.gpb.rbc.com"I don't know/description value xmlns="http://util.gpb.rbc.com"hmph/value /type state xmlns="http://customer.util.gpb.rbc.com"Active/state postalCode xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / legalName xmlns="http://customer.util.gpb.rbc.com"Ozzy Osborne/legalName address4 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / dateOpened xmlns="http://customer.util.gpb.rbc.com"2005-03-14T15:17:45.2805722-05:00/dateOpened address3 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / dateOfBirth xmlns="http://customer.util.gpb.rbc.com"0001-01-01T00:00:00.000-05:00/dateOfBirth address2 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / address1 xsi:nil="true" xmlns="http://customer.util.gpb.rbc.com" / name xmlns="http://customer.util.gpb.rbc.com"Albert Einstein/name /getCustomerReturn /getCustomerResponse /soap:Body/soap:Envelope Notice that the getCustomerReturn is in the http://inquiry.webservice.gpb.rbc.com namespace, as the WSDL specifies, and the child elements of that element are all in the http://customer.util.gpb.rbc.com namespace, again, as the WSDL specifies. It seems the response is not agreeing with the WSDL. -D From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, March 14, 2005 10:41 AMTo: axis-user@ws.apache.orgSubject: R
RE: .NET and Axis
Title: .NET and Axis Mmkay, I just tried building this, with a dummy implementation for getCustomer() , and it works for me? In other words, I do not get the response you showed, but I get the response .NETis expecting. This is the actual response (cut-n-paste): 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 getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com" getCustomerReturn ns1:shortName xsi:nil="true" xmlns:ns1="http://customer.util.gpb.rbc.com" / ns2:currency xsi:nil="true" xmlns:ns2="http://customer.util.gpb.rbc.com" / ns3:isRestrained xmlns:ns3="http://customer.util.gpb.rbc.com"false/ns3:isRestrained ns4:status xmlns:ns4="http://customer.util.gpb.rbc.com"Watchlist/ns4:status ns5:hasWarnings xmlns:ns5="http://customer.util.gpb.rbc.com"false/ns5:hasWarnings ns6:id xmlns:ns6="http://customer.util.gpb.rbc.com" ns7:bank xmlns:ns7="http://util.gpb.rbc.com"17/ns7:bank ns8:transit xmlns:ns8="http://util.gpb.rbc.com"102/ns8:transit ns9:key xmlns:ns9="http://util.gpb.rbc.com"love/ns9:key ns10:number xmlns:ns10="http://util.gpb.rbc.com"0/ns10:number /ns6:id ns11:isBooksKept xmlns:ns11="http://customer.util.gpb.rbc.com"false/ns11:isBooksKept ns12:officerCode xsi:nil="true" xmlns:ns12="http://customer.util.gpb.rbc.com" / ns13:type xmlns:ns13="http://customer.util.gpb.rbc.com" ns14:description xmlns:ns14="http://util.gpb.rbc.com"I don't know/ns14:description ns15:value xmlns:ns15="http://util.gpb.rbc.com"hmph/ns15:value /ns13:type ns16:state xmlns:ns16="http://customer.util.gpb.rbc.com"Active/ns16:state ns17:postalCode xsi:nil="true" xmlns:ns17="http://customer.util.gpb.rbc.com" / ns18:legalName xmlns:ns18="http://customer.util.gpb.rbc.com"Ozzy Osborne/ns18:legalName ns19:address4 xsi:nil="true" xmlns:ns19="http://customer.util.gpb.rbc.com" / ns20:dateOpened xmlns:ns20="http://customer.util.gpb.rbc.com"2005-03-14T21:11:22.226Z/ns20:dateOpened ns21:address3 xsi:nil="true" xmlns:ns21="http://customer.util.gpb.rbc.com" / ns22:dateOfBirth xmlns:ns22="http://customer.util.gpb.rbc.com"1976-04-13T05:45:58.000Z/ns22:dateOfBirth ns23:address2 xsi:nil="true" xmlns:ns23="http://customer.util.gpb.rbc.com" / ns24:address1 xsi:nil="true" xmlns:ns24="http://customer.util.gpb.rbc.com" / ns25:name xmlns:ns25="http://customer.util.gpb.rbc.com"Albert Einstein/ns25:name /getCustomerReturn /getCustomerResponse /soapenv:Body/soapenv:Envelope And interop just works. -Dino From: Dino Chiesa [mailto:[EMAIL PROTECTED] Sent: Monday, March 14, 2005 3:42 PMTo: axis-user@ws.apache.orgSubject: RE: .NET and Axis If you look in the deploy.wsdd that Iattached with the last mailyou should see a typeMapping for getCustomerResonse (X = Customer). Are you saying you don't get these typeMappings when you run WSDL2Java on my inquiry.wsdl? Any idea why that is? Ah, I'm sorry. When I use AXIS v1.1, I don't get a typeMapping for getCustomerResponse. when I use AXIS v1.2RC3 , I do get a typeMapping for getCustomer and getCustomerResponse. But I don't think this is the central mystery here. Looking at your deploy.wsdd, and the Reference.cs, and the sample XML response, I believe it is a namespace issue. In the response XML, the CustomerDTO is serialized into an element named "getCustomerReturn". This elt has no namespace defined for it, and so uses the namespace of its parent, the getCustomerResponse element, which is explicitly specified here: getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com" But, based on the WSDL,.NET is expecting the CustomerDTO to be serialized into this namespace: "http://customer.util.gpb.rbc.com" . Hence, the namespace cross-up, as we suspected. Your actual response is like this: soapenv:Body getCustomerResponse xmlns="http://inquiry.webservice.gpb.rbc.com" getCustomerReturn isBooksKeptfalse/isBooksKept officerCode xsi:nil="true" / hasWarningsfalse/hasWarnings type xsi:nil="true" / isRestrainedfalse/isRestrained state xsi:nil="true" / currency xsi:nil="true" / shortName xsi:nil="true" / postalCode xsi:nil="true" / legalName xsi:nil="true" / id bank1/bank transit1880/transit key xsi:nil="true" / number117/number /id status xsi:nil="true" / address4 xsi:nil="true" / dateOpened xsi:nil="true" / address3 xsi:nil="
RE: Empty namespace - again
an empty namespace thus: soapenv:Body return xmlns=Hello World/return /soapenv:Body Following many threads on this list it is clear that this is a problem. If you are trying to consume an axis service in .net it appears to be a 'show stopper'. No. xmlns= is not a problem for .NET. With .NET, just as with AXIS, you can specify to the XML serialization engine the XML namespace to use for requests, responses, and embedded complextypes. You can specify other things, too, like the xml element name, or attribute name, or other stuff. In general, this is all done for you (by both AXIS and .NET), if you follow rule #1 and Start With WSDL First (tm). If you like to live dangerously, and not Start With WSDL First (tm) , then you need to modify the generated .NET client-side stubs to introduce or modify attributes on your methods and types, that agree with the XML put on the wire by AXIS. Here's some code that was generated by the .NET Wsdl.exe tool: [SoapDocumentMethodAttribute (, RequestNamespace=urn:ionic.webservices.2005.03.Types, ResponseNamespace=urn:ionic.webservices.2005.03.Types, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped) ] [return: XmlElementAttribute(getComplexTypeReturn)] public MyComplexType getComplexType(string caller) { object[] results = this.Invoke(getComplexType, new object[] { caller}); return ((MyComplexType)(results[0])); } This says, -Use for the SoapAction. -Use the specified strings for the request and response namespaces, Respectively. They need not be the same. -literal encoding -wrap the response in an element -the return element will be getComplexTypeReturn The generated type on the .NET side looks like [XmlType(Namespace=urn:ionic.webservices.2005.03.Types)] public class MyComplexType { ... } Which says, when serializing or de-serializing this type, the xml element should be in xmlns=urn:ionic.webservices.2005.03.Types. If you want xmlns=, then use [XmlType()]. This says to .NET, when serializing or de-serializing, the XML element should have xmlns=. and the show goes on... By the way, the same sort of attribute-based tweaking of the behavior of the XML serializer is possible on the server side, for .NET services. So if you have a Java/AXIS webservice client that needs to consume an ASMX .NET webservice, you can use these same sorts of attributes to get the two sides to agree. -- Generally though, if you follow the first law of web services interop, you don't have to trouble yourself with *any of* these issues. The tools do it for you, which leaves more time for you to enjoy your life. [Come to think of it, I should probably start advising people to Start With WSDL First(tm). Hmm, good idea, Maybe I will do that] -Dino -Original Message- From: Richard Wallis [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 12:02 PM To: axis-user@ws.apache.org; Anne Thomas Manes Subject: RE: Empty namespace - again Hi Anne, Thanks for this, but two problems: 1. My copy of XMLSpy complains Message part 'parameters' (in Message echoStringRequest) - parameter intf:echoString: NS prefix does not refer to this schema! But more importantly, 2. The problem still persists but nested 1 level down, 'return' still has xmlns=: 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 echoStringResponse xmlns=urn:LookupBorrower return xmlns=Hello mum/return /echoStringResponse /soapenv:Body /soapenv:Envelope Richard. -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 11 March 2005 15:56 To: axis-user@ws.apache.org Subject: Re: Empty namespace - again Richard, This is not a valid doc/literal WSDL document. You need to define the WSDL differently depending on whether you want rpc/encoded, rpc/literal, of doc/literal. Here's how you should define your WSDL if you'd like to create a doc/literal service conforming to the wrapped programming convention (which offers the best interoperability with .NET). wsdl:definitions xmlns:impl=urn:LookupBorrower xmlns:intf=urn:LookupBorrower xmlns:apachesoap=http://xml.apache.org/xml-soap; xmlns:wsdlsoap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; targetNamespace=urn:LookupBorrower wsdl:types xsd:schema targetNamepsace=urn:LookupBorrower xsd:element name=echoString xsd:complexType xsd:sequence xsd:element name=inputString type=xsd:string/ /xsd:sequence /xsd:complexType
RE: wsdl/soap question
2) There are a lot of namespace declarations in the document which have no additional referents further down. Is this a good thing, immaterial, or bad practice? Code Clutter. Bad practice. -Original Message- From: Elaine Nance [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 11:53 AM To: axis-user@ws.apache.org Subject: Re: wsdl/soap question Thank you very much, Anne. Two more questions: 1) !--http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/-- is the XML schema document to read? 2) There are a lot of namespace declarations in the document which have no additional referents further down. Is this a good thing, immaterial, or bad practice? Thanks again, Elaine PS I'm not stupid, just having to translate a huge amount of data into knowledge in a (relatively) short period of time. The people managing the web service project are not programmers. No one in my group has *any* of this expertise, so . . . I'm learning *all* of this stuff at the same time. Thanks for clarifying the import tag for me. I think I knew that, but everything I've been studying is kind of blurring together. I am not as backward about XML as it must seem, either, but haven't the applied knowledge to keep everything straight automatically. Anne Thomas Manes wrote: See responses inline ... On Wed, 09 Mar 2005 08:43:45 -0900, Elaine Nance [EMAIL PROTECTED] wrote: TIA for considering these questions. I am working through the note at !--http://www.w3.org/TR/2001/NOTE-wsdl-20010315--, but mapping it to my understanding of what I'm seeing gives rise to questions (and frustrations). 1) How does a wsdl indicate that headers are required? Required headers can be specified in the binding element, although most people don't specify headers in WSDL. In the long run, I expect people to specify header requirements using WS-Policy (or some other as yet undefined policy language). 2) Fragment of existing wsdl which appears to be incorrect: s:element name=AdminAuthHeader type=s0:AdminAuthHeader/ s:complexType name=AdminAuthHeader s:sequence s:element maxOccurs=1 minOccurs=0 name=sAdminLogin type=s:string/ s:element maxOccurs=1 minOccurs=0 name=sPassword type=s:string/ s:element maxOccurs=1 minOccurs=1 name=nExSysID type=s:int/ s:element maxOccurs=1 minOccurs=1 name=nMajorVersion type=s:int/ s:element maxOccurs=1 minOccurs=1 name=nMinorVersion type=s:int/ /s:sequence /s:complexType a) Shouldn't this have an end /s:element tag and not have the / in the leading element tag before the s:complexType tag? No. b) Shouldn't minOccurs=1 indicate a required parameter? Yes. 3) Fragment of existing wsdl: definitions targetNamespace=http://yyy.ourname.xxx/webservices/; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:http=http://schemas.xmlsoap.org/wsdl/http/; xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/; xmlns:s=http://www.w3.org/2001/XMLSchema; xmlns:s0=http://yyy.ourname.xxx/webservices/; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:tm=http://microsoft.com/wsdl/mime/textMatching/; a) Wouldn't it be better to import the additional namespaces using the import tag? No. These are namespace declarations, not imports. In order to reference an element in one of these namespaces, you must declare the namespace. You only use the wsdl:import element to import other WSDL documents. Even if you do import another WSDL document, you still need to declare the namespace using a namespace declaration. b) Shouldn't the s namespace designated above be xsd No. The string used for the prefix (s versus xsd) isn't significant. All that matters is that it's used consistently within the document. and point to http://www.w3.org/2001/10/XMLSchema;? No. Per the XML Schema specification, the XML Schema namespace is http://www.w3.org/2001/XMLSchema; c) Shouldn't the soapenc namespace be SOAP-ENC? No. As I said before, the prefix string is insignificant. I've been told that wsdl is generated automatically, but if it is the tool seems inadequte. (NOT Axis!) Final question for this: 4) Am I on the right track with the wsdl? It seems to me that you first need to learn a little more about XML Schema and XML namespaces. Once you've done that, I recommend that you study the WS-I Basic Profile. (see http://www.ws-i.org). REALLY APPRECIATE the input, Elaine Any time. - Anne ~~ | Computers are useless. They can only give you answers. | -- Pablo Picasso -- ~~
RE: .NET and Axis
Title: .NET and Axis It seems likely that the name or namespace of the response element does not agree between AXIS and .NET. What you have sent shows the xml "on the wire", but does not show the namespace or element name you have told AXIS to use (listed in deploy.wsdd) and does not show the namespace or element name you have told .NET to use (via an inline code attribute on the method in the client-side proxy). To figure out where the mismatch is, You would have to show me - the entire WSDL (not just the complex type defn) - the client-side proxy code - the deploy.wsdd When I start with WSDL , generate the Java types with WSDL2Java, and then deploy the service using the generated deploy.wsdd, and then generate a client from the WSDL. these namespaces and element names agree. See my post replying to "Empty namespace - again", from just a moment ago, for more on this. If you skip any of these steps, it won't work. If you change the WSDL, recompile everything, and don't "redeploy" to AXIS, it won't work. if you change the generated deploy.wsdd, and don't make corresponding changes to the client-side proxy, it won't work. etc etc. Maybe somehow there is a step missing, a forgotten remnant in the deploy.wsdd, something like that? also - please confirm - what version of AXIS and .NET are you using ? -Dino From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 12:59 PMTo: axis-user@ws.apache.orgSubject: RE: .NET and Axis Hi Dino, thanks for taking the time to reply in such detail.. I am not sure whetherwe completely understand each other, so just to make sure I will explain what approaches I have tried. Ihave startedwith a Java class (field names in camelCase), generated the WSDL (element names incamelCase) and generated the c# code from that (field name in camelCase). I have also tried the WSDL first approachusingelement names in camelCase. Both cases I get the same problem, i.e., when I query the c# object for the stringValue there it is an empty string although I can see that Axis has sent the correct XML ?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:BodygetComplexTypeResponse xmlns="http://rbc.com"getComplexTypeReturnstringValueAedemar/stringValue/getComplexTypeReturn/getComplexTypeResponse/soapenv:Body/soapenv:Envelope /results Java code public class MyComplexType implements java.io.Serializable { private java.lang.String stringValue;/** * Gets the stringValue value for this MyComplexType. * * @return stringValue */ public java.lang.String getStringValue() { return stringValue; } /** * Sets the stringValue value for this MyComplexType. * * @param stringValue */ public void setStringValue(java.lang.String stringValue) { this.stringValue = stringValue; } } generated WSDL complexType name="MyComplexType" sequence element name="stringValue" nillable="true" type="xsd:string"/ /sequence /complexType generated c# [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://rbc.com")] public class MyComplexType { /// remarks/ [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] public stringstringValue; } -Original Message-From: Dino Chiesa [mailto:[EMAIL PROTECTED]Sent: 11 March 2005 5:26 To: axis-user@ws.apache.orgSubject: RE: .NET and Axis Your understanding is not quite right, but first let's deal with the issue you are having. you wrote: I don't want to use the Axis generated classes for the reasons specified above, but do I have any choice if I want to go to wrapped/literal? Yes, you have a choice. You can specify in-line code attributes on your .NET types to map element names to fields or properties. So you can tell .NET that a stringValue element should get mapped to a field named StringValue. Like this: [XmlType(Namespace="urn:ionic.webservices.2005.03.Types")] public class MyComplexType { [XmlElement("stringValue", IsNullable=true)] public string StringValue; ... } By default .NET assumes the element name in the XMLis exactly the same as the field (or property name) in the .NET class. But you can specify any mapping you like. Ok, now, getting back to your issue. you wrote: in order to use a wrapped/literal service to send data between .NET and Axis, the Java Bean property names need to start with an UPPER case character in the XML. Considering what I wrote above, this is obviously not true.A better statement is, "the mapping on the server side between JavaBean property name and XML element name, must agree with the
RE: Receiving multiple parameters using Java
Any suggestions as to how I can do this? If you start with WSDL, it should do what you want. Does the Python webservices stack do WSDL ? -Original Message- From: C.C. Ang [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 09, 2005 6:17 PM To: axis-user@ws.apache.org Subject: Receiving multiple parameters using Java Hi there all, I am a SOAP and AXIS newbie (3 days old) and had a question re returning multiple parameters using java. I have looked in the archives and cannot find anything that resolves my question. So my conclusion is that I must be missing something simple. 8-) I have written a SOAP server written in python which takes in 3 parameters (Code, Timestamp and Misc) and returns these 3 parameters as well as an additional parameter Status. The SOAP XML sent back looks like the following. ''' ?xml version=1.0 encoding=UTF-8? SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsi=http://www.w3.org/1999/XMLSchema-instance; xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/1999/XMLSchema; SOAP-ENV:Body MyRequestResponse SOAP-ENC:root=1 Result Code xsi:type=xsd:stringHello/LocalOPCode Status xsi:type=xsd:stringsuccess/Status Misc xsi:type=xsd:stringone/LocalTAX Timestmap xsi:type=xsd:stringtwo/BridgeTNXNo /Result /MyRequestResponse /SOAP-ENV:Body /SOAP-ENV:Envelope ''' My java client written using axis1.2RC3, snippet follows All it does is calls invoke and prints out the returned result, which seems to be an array. ''' call.addParameter(Code, org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN); /* ... more of the same ... */ call.setReturnType(org.apache.axis.encoding.XMLType.SOAP_ARRAY ); Object[] ret = (Object[])call.invoke( new Object[]{Hello, one, two ); for ( int i = 0; i ret.length; i++ ) { System.out.println( Sent 'Hello!', got ' + ret[i] + ' ); } ''' From the client, it seems like call.invoke() returns an array. My results are Sent 'Hello!', got 'Hello' Sent 'Hello!', got 'success' Sent 'Hello!', got 'one' Sent 'Hello!', got 'two' I need to be able to distinguish which parameter is the Status parameter. This information is lost cos the client gets back the results in an array. I need it to be in a Map (HashMap) or something like that or a class? Something which will allow to find out the value of Status. Any suggestions as to how I can do this? I could use something like jdom to unmarshall the XML but thought AXIS might have something that would be similar. Many thanks in advance, Chai -- | O! it is excellent! To have a giant's strength, but it is tyrannous! | To use it like a giant. - William Shakespeare - Utiba Pty Ltd This message has been scanned for viruses and dangerous content by Utiba mail server and is believed to be clean.
RE: Empty namespace - again
Yes ! Ack! I have seen this before. When the schema does not declare an elementFormDefault , .NET assumes it is one way, And AXIS assumes it is the other. This is a bug in one or the other.(I don't know what a schema parser is expected to do with EFD is missing). The workaround is to specify elementFormDefault, one way or the other, in the schema. Good catch, Anne! -Original Message- From: Richard Wallis [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 1:29 PM To: Anne Thomas Manes Cc: Dino Chiesa Subject: RE: Empty namespace - again Anne, Please award yourself a gold star! The elementFormDefault=qualified solved it, and 18:24 on a Friday night in an empty office after a [very] long week. ;-} I've copied this to Dino for his interest. Many thanks again, Richard. -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 11 March 2005 18:10 To: Richard Wallis Subject: Re: Empty namespace - again I'm surprised that .NET got confused by this, because normally it handles valid schema definitions. Perhaps Dino can shead some light on it. But here's a work around. Add the elementFormDefault=qualified attribute to the scehma definition, which will make the return element namespace qualified. wsdl:definitions xmlns:impl=urn:LookupBorrower xmlns:intf=urn:LookupBorrower xmlns:apachesoap=http://xml.apache.org/xml-soap; xmlns:wsdlsoap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; targetNamespace=urn:LookupBorrower wsdl:types xsd:schema targetNamepsace=urn:LookupBorrower elementFormDefault=qualified xsd:element name=echoString xsd:complexType xsd:sequence xsd:element name=inputString type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:element xsd:element name=echoResponse xsd:complexType xsd:sequence xsd:element name=return type=xsd:string/ /xsd:sequence /xsd:complexType /xsd:element /xsd:schema /wsdl:types wsdl:message name=echoStringRequest wsdl:part name=parameters element=intf:echoString/ /wsdl:message wsdl:message name=echoStringResponse wsdl:part name=parameters element=intf:echoResponse/ /wsdl:message wsdl:portType name=LookupBorrower wsdl:operation name=echoString wsdl:input message=impl:echoStringRequest/ wsdl:output message=impl:echoStringResponse/ /wsdl:operation /wsdl:portType wsdl:binding name=LookupBorrowerSoapBinding type=impl:LookupBorrower wsdlsoap:binding style=document transport=http://schemas.xmlsoap.org/soap/http/ wsdl:operation name=echoString wsdl:input wsdlsoap:body use=literal/ /wsdl:input wsdl:output wsdlsoap:body use=literal/ /wsdl:output /wsdl:operation /wsdl:binding wsdl:service name=LookupBorrowerService wsdl:port name=LookupBorrower binding=impl:LookupBorrowerSoapBinding wsdlsoap:address location=http://localhost:8080/axis/services/LookupBorrower/ /wsdl:port /wsdl:service /wsdl:definitions On Fri, 11 Mar 2005 17:56:50 -, Richard Wallis [EMAIL PROTECTED] wrote: Anne, I did, but it didn't! Here is my bit of C# built in Visual C#.net pulling in the Web reference of my wsdl as supplied by my Axis server: static void Main(string[] args) { ConsoleApplication1.rjwpc.LookupBorrowerService srv = new ConsoleApplication1.rjwpc.LookupBorrowerService(); String ret = srv.echoString(Hi there); Console.WriteLine(Response: +ret); } It ret is set to null after the echoString() call. Digging in to the auto created C# code I get the following: /// remarks/ [System.Web.Services.Protocols.SoapDocumentMethodAttribute(, RequestNamespace=urn:LookupBorrower, ResponseNamespace=urn:LookupBorrower, Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrappe d) ] [return: System.Xml.Serialization.XmlElementAttribute(return)] public string echoString(string inputString) { object[] results = this.Invoke(echoString, new object[] {inputString}); return ((string)(results[0])); } The ResponseNamespace=urn:LookupBorrower makes me wonder what NS it is looking for 'return' to be in. Debug shows 'results' is a one element array with that element being null. I'm getting more confused by the hour. Richard. P.S. I'm not too concerned about XMLSpy either! -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: 11 March 2005 17:36 To: Richard Wallis Subject: Re: Empty namespace - again I don't understand what XMLSpy is complaining about
FW: replacing default namespace prefixes
Moving this back to axis-user. . . -Original Message- From: Andy Dolbey [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 09, 2005 10:26 AM To: [EMAIL PROTECTED] Cc: Dino Chiesa Subject: Re: replacing default namespace prefixes Sure, I've attached it here. It was a wsdl automatically generated by the Allegro Common Lisp SOAP engine/server. It led to a couple problems that needed to be resolved first, like setting the client engine's do_multirefs property to Boolean.false. But the complex element with string arrays hasn't been a problem. I agree with your point totally, Dino, that the prefix used is arbitrary and semantically unimportant. But the Lisp server appears to be complaining about it. The odd thing is that I made a pseudo version of the Lisp service, again in Lisp and with the exact same SOAP message structures, and everything worked fine. This time I had control over the server so I could turn on the XML traces. I could see the `ns1:' prefix showing up in the message, but the transactions went through fine. The wsdl I used was automatically generated the same way by Allegro Common Lisp, and I used the same Axis wsdl2java libraries. I truly don't understand why one works but the other doesn't. It seems to me that these are the key places where differences can arise: 1) Lisp SOAP element defs 2) Lisp SOAP server def 3) Lisp name-space specs 4) Lisp generation of a wsdl 5) Axis generation of client classes from a wsdl 6) Java client driver class that uses the pieces in the previous step My pseudo version of the service is close to identical to the real one, and yet it works with no problems even though real one does not. Very frustrating. I'm attaching the wsdl for my pseudo version as well. If you see a likely place where this difference could be coming from, please let me know! I'm leaning towards #3, the name-space specs, being the problem, but I haven't discovered how yet. Thanks for any thoughts or ideas. The two files I'm attaching are the following. wsdl for service with problem: DtronRPC20050307-compbio.wsdl wsdl for pseudo version that works: DtronAxisRPC.wsdl Andy On Wed, 9 Mar 2005 08:32:06 -0500 (EST), [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Just curious is there a way we can see the wsdl. --- On Tue 03/08, Andy Dolbey [EMAIL PROTECTED] wrote: From: Andy Dolbey [mailto: [EMAIL PROTECTED] To: axis-user@ws.apache.org Date: Tue, 8 Mar 2005 17:53:01 -0700 Subject: replacing default namespace prefixes Hello axis-users,brbrI have a question that I've seen come up in this group several times,brbut so far I haven't seen an answer. So I'll try throwing out thebrquestion again.brbrI have a wsdl for a service that I have used Axis-1.2 to generatebrclient classes for. This went fine. But now when I make requests,brAxis is using the namespace prefix ns1 as a default. But the SOAPbrserver (which is a Common Lisp server) really wants the prefix to bebrtns. And in fairness to the server, this is the prefix specified inbrthe wsdl. With a ns1 prefix, I now get error messages for allbrrequests.brbrIs there a way to set the default prefix Axis uses? I tried grep'ingbrall of the source for ns1, but didn't find anything.brbrThis problem is draining a lot my time. If anyone has any ideas orbrsuggestions, please let me know!brbrThanks.brbrAndybr ___ DtronRPC20050307-compbio.wsdl Description: DtronRPC20050307-compbio.wsdl DtronAxisRPC.wsdl Description: DtronAxisRPC.wsdl
RE: Stupid question: how to deserialize/serialize axis data objects
I know that other special purpose Java-to-XML binding frameworks do this (like JAXB, and XMLBeans, and I suppose JiBX too), but I don't believe there is an interface exposed within AXIS to do explicit XML serialization. It is all done implicitly as far as I know, when you make a webservices call. -Original Message- From: Michael Thome [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 4:33 PM To: axis-user@ws.apache.org Subject: Stupid question: how to deserialize/serialize axis data objects Here's a stupid question - gotta be a faq, but darned if I can find the right keywords... I'd like to be able to deserialize/serialize data in the form of wsdl2java-generated structures from/to arbitrary streams. For instance, if I serialize such an object to a file, I would like to end up with an xml representation of the object in the file that conforms to the schema I used to generate the data structures. I currently have a glacially-slow hack for deserialization involving setting up a dummy DeserializationContext and calling parse... but it is *horrendously* slow, seeming to spend all its time creating and releasing thousands of temporary Documents... I'm clearly missing something here. Thanks for any help, -Michael
RE: Problems sending String parameters with Axis 1.2 RC 3 client to .Net 1.1 service
The programming model in that client code is ... Really obtuse. Can you not do a Wsdl2Java and create a client-side stub, and get something more like: Stub mystub= new Stub(); mystub.Method1(param1, param2...) ; -D -Original Message- From: Walter Parton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 3:46 PM To: axis-user@ws.apache.org Subject: Problems sending String parameters with Axis 1.2 RC 3 client to .Net 1.1 service Hello, We have an Axis java client (Axis 1.2 RC3) that is communicating to a .Net web service correctly, however, the rpc encoded variable problem is cropping up and causing the .NET service to not correctly pull in the passed strings. We know we need to turn off the rpc encoding so that the Axis client will send the parameters as document/literal, problem is we don't know how to turn it off in the java client code. We suspect that with RC 3 it is doable (according to the release message it accomodates literal/document and .net). So our plead for help is - Which property do we set, or which flag do we toggle to turn off rpc and turn on literal/document? Any assistance would be of great help! I included the client code below. Thanks Walter Parton Documentum Consulting // Decompiled by DJ v3.5.5.77 Copyright 2003 Atanas Neshkov Date: 2/1/2005 7:58:00 PM // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! // Decompiler options: packimports(3) // Source File Name: CalcClient.java package samples.userguide.example2; import java.io.PrintStream; import java.net.URL; import javax.xml.namespace.*; import javax.xml.rpc.ParameterMode; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.TypeMappingImpl; import org.apache.axis.encoding.XMLType; import org.apache.axis.encoding.XMLType; import org.apache.axis.utils.Options; import org.apache.axis.encoding.*; public class rm_call { public rm_call() { } public static void main(String args[]) throws Exception { Options options = new Options(args); String endpoint = http://edmw04/RM/SMUDRecord.asmx; String action = http://rm.com/webservices/Synchronize; //SOAPMappingREgistry smr = new SOAPMappingRegistry(); //StringDeserializer sd = new StringDeserializer(); args = options.getRemainingArgs(); if(args == null || args.length != 6) { //String method = args[0]; //if(!method.equals(add) !method.equals(subtract)) //{ System.err.println(Usage: rm_call prefix fileLevel subject author docbase documentId); return; } else { String strPrefix = new String(args[0]) ; String strFileLevel = new String(args[1]); String strSubject = new String(args[2]); String strAuthor = new String(args[3]); String strDocbase = new String(args[4]); String strDocId = new String(args[5]); String method = Synchronize; Service service = new Service(); Call call = (Call)service.createCall(); //set the target to the RMSynchronization service call.setTargetEndpointAddress(new URL(endpoint)); call.setOperationName(method); TypeMappingImpl.dotnet_soapenc_bugfix = true; call.addParameter(prefix, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(fileLevel, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(subject, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(author, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(docbase, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(documentId, XMLType.XSD_STRING, ParameterMode.IN); /* call.addParameter(prefix, XMLType.QNAME_LITERAL_ITEM, ParameterMode.IN); call.addParameter(fileLevel, XMLType.QNAME_LITERAL_ITEM, ParameterMode.IN); call.addParameter(subject, XMLType.QNAME_LITERAL_ITEM, ParameterMode.IN); call.addParameter(author, XMLType.QNAME_LITERAL_ITEM, ParameterMode.IN); call.addParameter(docbase, XMLType.QNAME_LITERAL_ITEM, ParameterMode.IN); call.addParameter(documentId, XMLType.QNAME_LITERAL_ITEM, ParameterMode.IN); */ //String strEncode = call.getEncodingStyle(); //call.SEND_TYPE_ATTR = false; //call.addParameter(, XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_STRING); call.setUseSOAPAction(true); call.setSOAPActionURI(action); //call.setProperty(Call.OPERATION_STYLE_PROPERTY,); //call.setProperty(javax.xml.rpc.encodingstyle.namespace.uri,); //call.setEncodingStyle(http://schemas.xmlsoap.org/soap/encoding/); // System.out.println(encode = + strEncode); String ret = ; //String ret = (String)call.invoke(new Object[] {strPrefix,strFileLevel,strSubject,strAuthor,strDocbase,strDocId}); try { ret = (String)call.invoke(new Object[] {strPrefix,strFileLevel,strSubject,strAuthor,strDocbase,strDocId}); } catch (Exception e) { System.out.println(Got result : + ret + e.getMessage()); } System.out.println(Got result : + ret ); return; } } }
RE: Problems sending String parameters with Axis 1.2 RC 3 client to .Net 1.1 service
We have to set up the service in .net as it calls a dll on a windows machine - Ok, I get that part... hence using the generic soap interface which i guess is not so interoperable after all. I don't get why the use of .NET implies that you should or must use the generic (low level) soap programming interfaces. the client code is based on examples in the developer guide to axis 1.2 so it should work fine True, but it sure is ugly to figure out. The tools can generate all that for you. If you are really in love with the low-level API, maybe what you can do is use the WSDL2Java to create a client stub (doc/lit), snatch the XML on the wire with TCPMonitor, then re-work your Java AXIS (low level) client to produce the message you see. -D -Original Message- From: Walter Parton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 5:55 PM To: axis-user@ws.apache.org Subject: RE: Problems sending String parameters with Axis 1.2 RC 3 client to .Net 1.1 service Well the client code is based on examples in the developer guide to axis 1.2 so it should work fine . Again the connection works just that the parameters are not picked up by the .net service. We have to set up the service in .net as it calls a dll on a windows machine - hence using the generic soap interface which i guess is not so interoperable after all. Walter -Original Message- From: Dino Chiesa [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 2:21 PM To: axis-user@ws.apache.org Subject: RE: Problems sending String parameters with Axis 1.2 RC 3 client to .Net 1.1 service The programming model in that client code is ... Really obtuse. Can you not do a Wsdl2Java and create a client-side stub, and get something more like: Stub mystub= new Stub(); mystub.Method1(param1, param2...) ; -D -Original Message- From: Walter Parton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 08, 2005 3:46 PM To: axis-user@ws.apache.org Subject: Problems sending String parameters with Axis 1.2 RC 3 client to .Net 1.1 service Hello, We have an Axis java client (Axis 1.2 RC3) that is communicating to a .Net web service correctly, however, the rpc encoded variable problem is cropping up and causing the .NET service to not correctly pull in the passed strings. We know we need to turn off the rpc encoding so that the Axis client will send the parameters as document/literal, problem is we don't know how to turn it off in the java client code. We suspect that with RC 3 it is doable (according to the release message it accomodates literal/document and .net). So our plead for help is - Which property do we set, or which flag do we toggle to turn off rpc and turn on literal/document? Any assistance would be of great help! I included the client code below. Thanks Walter Parton Documentum Consulting // Decompiled by DJ v3.5.5.77 Copyright 2003 Atanas Neshkov Date: 2/1/2005 7:58:00 PM // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! // Decompiler options: packimports(3) // Source File Name: CalcClient.java package samples.userguide.example2; import java.io.PrintStream; import java.net.URL; import javax.xml.namespace.*; import javax.xml.rpc.ParameterMode; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.TypeMappingImpl; import org.apache.axis.encoding.XMLType; import org.apache.axis.encoding.XMLType; import org.apache.axis.utils.Options; import org.apache.axis.encoding.*; public class rm_call { public rm_call() { } public static void main(String args[]) throws Exception { Options options = new Options(args); String endpoint = http://edmw04/RM/SMUDRecord.asmx; String action = http://rm.com/webservices/Synchronize; //SOAPMappingREgistry smr = new SOAPMappingRegistry(); //StringDeserializer sd = new StringDeserializer(); args = options.getRemainingArgs(); if(args == null || args.length != 6) { //String method = args[0]; //if(!method.equals(add) !method.equals(subtract)) //{ System.err.println(Usage: rm_call prefix fileLevel subject author docbase documentId); return; } else { String strPrefix = new String(args[0]) ; String strFileLevel = new String(args[1]); String strSubject = new String(args[2]); String strAuthor = new String(args[3]); String strDocbase = new String(args[4]); String strDocId = new String(args[5]); String method = Synchronize; Service service = new Service(); Call call = (Call)service.createCall(); //set the target to the RMSynchronization service call.setTargetEndpointAddress(new URL(endpoint)); call.setOperationName(method); TypeMappingImpl.dotnet_soapenc_bugfix = true; call.addParameter(prefix, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(fileLevel, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(subject, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(author, XMLType.XSD_STRING, ParameterMode.IN); call.addParameter(docbase, XMLType.XSD_STRING, ParameterMode.IN
RE: Interropability testing between j2ee and .NET
There is no standalone .NET soap toolkit . There is a thing called the Microsoft SOAP Toolkit. It was a COM-based library, suitable for use within VB6 and other COM environments. The MS SOAP Toolkit went through several revisions. The latest is v3.0. None of these revisions used .NET technology. The SOAP toolkit goes out of support in June 2005. Microsoft guidance is for those using the SOAP Toolkit to move to .NET. The .NET Framework is the all-up managed app framework. Web services support is built in, but so are lots of other features like IO, threading, transactions, data access and so on. There is no way to install Just the IO or Just the data access pieces of the .NET Framework, nor is there a way to install Just the webservices piece. The Framework runtime (something like a JRE) is a 22mb download. http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4 842-8157-034D1E7CF3A3displaylang=en It includes stuff you need to run apps built on .NET. The Framework SDK (like JDK) is a ~120mb download. http://www.microsoft.com/downloads/details.aspx?familyid=9b3a2ca6-3647-4 070-9f41-a333c6b9181ddisplaylang=en The SDK includes command line tools for building apps that run on the .NET Framework: compilers, debuggers, and other tools and utilities related to app development. There are no visual tools included in the SDK (except for a visual debugger). In a twist, the Framework *runtime* (the 22mb thing) includes compilers for VB.NET and C#. So you could just download that. Write apps in any text editor, compile them with vbc.exe or csc.exe. If you want to sign assemblies, do debugging, use makefiles, or use XML Serialization, then you will also want the full SDK. If you want to generate client-side proxies from a WSDL file, then you need the SDK, as it includes the wsdl.exe tool. Both the Framework and SDK are free downloads, though of course you have to already have licensed Windows. If you install either of the above and you use Windows Update, you will be promoted to install SP1 of the .NET Framework, soon. Now, separate from those things, Visual Studio .NET is the visual development environment. It's big, installs from a DVD. It requires the .NET SDK. It's a commercial tool, prices vary. Unlike some Java environments, which bundle a runtime install (JRE) in the SDK (JDK), with .NET that is not the case. So you must install both the runtime piece and the SDK piece, if you want to use the .NET Framework SDK. -Original Message- From: babloosony [mailto:[EMAIL PROTECTED] Sent: Sunday, March 06, 2005 6:34 AM To: axis-user@ws.apache.org; axis-dev@ws.apache.org Subject: Interropability testing between j2ee and .NET Hi All, I have exposed ejb as document/wrapped web service on java platform that uses AXIS 1.2 RC2. I can test also successfully consume the ejb web service. However I want to write a client in .NET and consume my j2ee/java ejb document/wrapped web service. Now my question is can I install light weight .NET soap toolkit on my windows 2000 computer and consume wsdl exposed by my j2ee based websphere 5.0 application server deployed ejb web service. I dont want to install the heavy weight .NET MS-Visual Studio that has .NET soap toolkit in it to do this interropability testing. Can anyone please redirect me to relevant docs, links and information. Thanks Regards, Kumar.
RE: Arrays in WSDL
Don't do soapenc:arrayType . For an example of arrays of complex types, running on AXIS 1.2 RC3, see http://dinoch.dyndns.org:7070/axis1.2/AboutCtService.jsp -Original Message- From: Deepak S Patwardhan [mailto:[EMAIL PROTECTED] Sent: Saturday, March 05, 2005 2:36 AM To: axis-user@ws.apache.org Subject: Arrays in WSDL Hi all, I am a new user and this is my first mail. I am learning to use axis and WSDL for making web services. I am stuck with arrays at the moment. Let me describe my toy application. I have a GeometryService which has two ports. One of them is supposed to take a list of points (on a plane) and return whichever is the farthest from the origin. Silly thing to do, but the intention is to understand how to pass arrays in SOAP. The following is the WSDL file : ?xml version=1.0 ? !-- Functionality to be provided -- !-- double distance(Point2D p1, Point2D p2)-- !-- Point2D farthest(List l1) -- definitions name=GeometryDef targetNamespace=Geometry xmlns:tns=Geometry xmlns:typens=Geometry xmlns:xsd=http://www.w3.org/1999/XMLSchema; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns=http://schemas.xmlsoap.org/wsdl/; !-- Other than predefined types, I need the following -- types !-- A type for points -- xsd:complexType name=Point2D xsd:sequence xsd:element name=x_coordinate type=xsd:double/ xsd:element name=y_coordinate type=xsd:double/ /xsd:sequence /xsd:complexType !-- A type for arrays of point -- xsd:complexType name=ArrayOfPoint2D xsd:complexContent xsd:restriction base=soapenc:Array attribute ref=soapenc:arrayType wsdl:arrayType=typens:Point2D[]/ /xsd:restriction /xsd:complexContent /xsd:complexType /types !--Message declarations-- !-- kind 1 : carrying two points -- !-- kind 2 : carrying a double -- !-- kind 3 : carrying a point -- !-- kind 4 : carrying many points -- message name=TwoPoints part name=p1 type=tns:Point2D/ part name=p2 type=tns:Point2D/ /message message name=ADouble part name=doub type=xsd:decimal/ /message message name=APoint part name=p3 type=tns:Point2D/ /message message name=ManyPoints part name=pList type=tns:ArrayOfPoint2D/ /message !-- Port type declarations -- portType name=Planar operation name=distance input message=tns:TwoPoints/ output message=tns:ADouble/ /operation operation name=farthest input message=tns:ManyPoints/ output message=tns:APoint/ /operation /portType !-- bindings -- binding name=GeometrySOAPBinding type=tns:Planar soap:binding style=rpc transport=http://schemas.xmlsoap.org/soap/http// operation name=distance soap:operation soapAction=/ input soap:body use=encoded namespace=Geometry encodingStyle=http://schemas.xmlsoap.org/soap/encoding// /input output soap:body use=encoded namespace=Geometry encodingStyle=http://schemas.xmlsoap.org/soap/encoding// /output /operation operation name=farthest soap:operation soapAction=/ input soap:body use=encoded namespace=Geometry encodingStyle=http://schemas.xmlsoap.org/soap/encoding// /input output soap:body use=encoded namespace=Geometry encodingStyle=http://schemas.xmlsoap.org/soap/encoding// /output /operation /binding !-- service declaration-- service name=GeometryService port name=Planar binding=tns:GeometrySOAPBinding soap:address location=http://jaganmohini.cse.iitd.ac.in:8080/axis/Planar// /port /service /definitions *** When I run WSDL2Java on this file, a class is generated by the name Geometry.ArrayOfPoint2D. However, the class contains nothing which points to the fact that it is supposed to be an array of Point2D. It has no members. Ques ) How am I supposed to make use this class. How can a client make an array of points to send to the service ? Or am I missing something in the type declarataion ? thanks, Deepak S Patwardhan.
RE: how can I export constants
Wait... Let me clarify this... Are you saying, Start with the WSDL and XML Schema, first? -Dino -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: Monday, March 07, 2005 2:08 PM To: axis-user@ws.apache.org Subject: Re: how can I export constants Perhaps you shouldn't simply expose the bean. You should expose a more loosely coupled interface. You should define an enumeration in your WSDL interface with string values of play, pause, stop, ff, and rew, and when a client sets the action, it should specify one of these values. Your application should then take this input and set the appropriate internal constant. Anne On Mon, 7 Mar 2005 13:42:40 -0500, Jay Glanville [EMAIL PROTECTED] wrote: I have a class with public internal constants. For example: Public class TapeDrive { public static final int PLAY = 1; public static final int PAUSE = 2; public static final int STOP = 3; public static final int FF = 4; public static final int REW = 5; ... public void setAction( int act ) { ... I'm using the bean serializer to export my bean. I want my soap clients to be able to see these constants so that they can understand the meanings of the possible values for the setAction() method. Is there any way that I can configure my bean so that the constants are exported? Or, am I limited because of SOAP (i.e.: does SOAP allow the concept of constants, or is it limited to just methods and structures?) Thanks PS: Please don't say write a custom serializer, as no one has effectively answered my questions concerning my problems with custom serializers (http://marc.theaimsgroup.com/?l=axis-userm=111003930120769w=2) JDG --- Jay Glanville
RE: How to use AXIS CLIENT with proxy settings.
Related to that, Can I turn on, or off, the use of proxy per client stub? (org.apache.axis.client.Stub ) eg, something like // client code MyBindingStub stub = new MyBindingStub(); stub.setProxy(...); Also, can I turn OFF the http.proxyHost/port, once it is turned on? If I set the system property, then create a client stub, the client stub uses the specified http proxy. All good. If I then reset the system property, then instantiate another client stub, the client stub continues to use the previous proxyHost. The converse is also true; if http.proxyHost is unset, and I instantiate a client stub, then I set http.proxyHost, then instantiate another client stub, the 2nd stub does not utilize the (non-null) http.proxyHost setting. -D -Original Message- From: Matt Robinson [mailto:[EMAIL PROTECTED] Sent: Sunday, March 06, 2005 11:45 PM To: axis-user@ws.apache.org Cc: axis-user@ws.apache.org Subject: Re: How to use AXIS CLIENT with proxy settings. Are you putting in valid data for the second parameter, e.g.: System.setProperty(http.proxyHost, myproxy.xyz.net); System.setProperty(http.proxyPort, 3128); axis-user@ws.apache.org,Internet writes: System.setProperty(http.proxyHost, ); System.setProperty(http.proxyPort, ); Kind Regards, Matt Robinson E-Commerce Level 7 Flight Centre Limited 316 Adelaide Street Brisbane QLD 4000 Ph: 3032 9488 Mob: 0414 385 600 http://www.flightcentre.com
RE: Array serialization-deserialization
I had heard that WS-I BP1.0 says arrays should not be wrappered. But now looking at http://ws-i.org/profiles/BasicProfile-1.1-2004-08-24.html it seems they are mum on the topic. Highlights: - no "soapenc:Array" - there's an example of defining an array of simple types inline - descriptions should not use (or depend upon) the naming convention "ArrayOfXxx" to specify arrays But that does not add up to "Don't wrapper your arrays". I 'spose I will change that comment in the WSDL; at this point, it is more of a style issue . From: Bill Keese [mailto:[EMAIL PROTECTED] Sent: Thursday, March 03, 2005 9:04 PMTo: axis-user@ws.apache.orgSubject: Re: Array serialization-deserialization Hi Dino, !-- this WSDL artifact is not WS-I BP1.0 compliant, but is necessary to enable AXIS to serialize properly -- s:complexType name="Array_float" By the way, what is uncomplaint about this? It seems like most people use wrapper complexTypes for their arrays.BillDino Chiesa wrote: yes, that's what I get, too. From: Bill Keese [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 03, 2005 7:34 PMTo: axis-user@ws.apache.orgSubject: Re: Array serialization-deserializationMy latest experience with this is that (with Axis 1.2, at least), you don't have to declare arrays in your WSDD file. However, if you have a wrapper class like this: s:complexType name="Array_float" s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="item" type="s:float" / /s:sequence /s:complexType... then you have to declare Array_float as a BEAN (not an Array). This makes sense when you really think about although it's counter-intuitive at first.Anyway, if you use bare arrays like this: s:element name="GetArrayOfSingleResult" s:complexType s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="floatItem" type="s:float" / /s:sequence /s:complexType /s:element... then you don't have to declare anything.Dino Chiesa wrote: Resurrecting this from a couple days ago... Is Axis smart enough to automatically use an ArraySerializer to serialize/deserialize arrays of simple types, a String[] for instance? Or do I have to declare a typeMapping for String[] wherever a service uses one? I basically just want to know whether it's sufficient for me to declare String[]s in my .wsdl without having to declare them a second time in my server-config.wsdd file. I think the answer is Yes, if you use AXIS 1.2RC3, No, if you use AXIS 1.1. Using AXIS 1.1, I cannot get arrays of simple types (string float, etc) to serialize properly without a wrapper. I think the ArraySerializer always uses soap encoding, which is probably not what you want. Suppose I define a message element in the wsdl representing an array of a simple type, such as s:element name="GetArrayOfSingleResult" s:complexType s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="floatItem" type="s:float" / /s:sequence /s:complexType /s:element Then I run WSDL2Java --server-side , and generate the interface and the deploy.wsdd. If I then provide my own implementation, and deploy it all (wrapped/literal), the response is not serialized properly. I get: soapenv:Body GetArrayOfSingleResponse xmlns="urn:ionic.basics.nowrapper.2005.03" GetArrayOfSingleReturn soapenc:arrayType="xsd:float[4]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" item xmlns=""0.58614534/item item xmlns=""0.619/item item xmlns=""0.6607646/item item xmlns=""0.00925833/item /GetArrayOfSingleReturn /GetArrayOfSingleResponse /soapenv:Body Ick. This seems wrong since the wsdd says "doc/literal". Also it's not going to work for interop with .NET clients. I didn't try it with other clients. On the other hand if in the WSDL I define a complexType that wraps the sequence of elements, such as s:element name="GetArrayOfSingleResult" s:complexType s:sequence s:element minOccurs="0" maxOccurs="1" name="floatItem" type="s0:Array_float" / /s:sequence /s:complexType /s:element !-- this WSDL artifact is not WS-I BP1.0 compliant, but is necessary to enable AXIS to serialize properly -- s:complexType name="Array_float" s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="item" type="s:float" / /s:sequence /s:complexType Then, interop works. The XML on the wire looks like this: soapenv:Body GetArrayOfSingleResponse xmlns="http://example.org/webservices/" GetArrayOfSingleReturn item0.1324557/item item0.46750873/item /GetArrayOfSingleReturn /GetArrayOfSingleResponse /soapenv:Body Which is fine. Somebody else has previously pointed out that the element name
RE: Newbie question for Doc/literal web service using Axis
Good basic rules. I'm gonna take that flame bait. atm_says You should always start with WSDL -- not from Java. /atm_says in principle, this is a good idea, but in practice it is hard for most people. Bootstrapping a WSDL with Java code (or C# code) is a practical step. This is what I typically do: 1- write a prototype in Java (or C#, or whatever) 2- Generate the WSDL, using the approriate xxxToWsdl tool (AXIS' Java2WSDL per ejemplo) 3- modify that generated WSDL, and add comments 4- generate server-skeleton from the modified WSDL 5- iterate on 3 and 4 until you're happy. 6- promote the modified WSDL to source, stuff it into source control, and discard the Java prototype interface. For simpler projects, I just start with a blank WSDL template, something like what I have in step 2. But for more complex interfaces, it helps to prototype it in source code, first. -D -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: Friday, March 04, 2005 9:28 AM To: axis-user@ws.apache.org Subject: Re: Newbie question for Doc/literal web service using Axis flameOn The documentation in the user guide is terrible. You should always start with WSDL -- not from Java. /flameOn Here are some basic rules: If you want to generate a web service from your Java interface, then you should always use wrapped/literal. Wrapped/literal supports multiple parameters, whereas document/literal does not. If you want to generate document/literal from your Java interface, then you need to design your interface such that it accepts a single object as input and returns a single object. Better yet, write your WSDL first, and generate your Java code from it. Anne On Fri, 04 Mar 2005 13:17:30 +0900, Bill Keese [EMAIL PROTECTED] wrote: Do you really want document/literal rather than wrapped/literal? Most people send messages like concatentate in0hello/in0 in0world/in0 /concatenate ...which is wrapped literal (since the top tag is the name of the function). Ketan Deshpande wrote: Hi all! I am a newbie at this, so please be gentle... I am trying to write a web service that is document-literal. I am following the example give in the Axis guide: (I am using axis-1_2RC2) 1. Create an interface Compile it to .class public interface MyWebService { public String concatenate(String str1, String str2); } 2. Generate WSDL from it: java -classpath %MY_CLASSPATH% org.apache.axis.wsdl.Java2WSDL -o myws.doc.wsdl -u LITERAL --style DOCUMENT -l%MY_LOCATION% -n urn:MyWebServiceNS MyWebService 3. Now generate server code from it: java -classpath %MY_CLASSPATH% org.apache.axis.wsdl.WSDL2Java -W -s -S true -o server.doc.generated myws.doc.wsdl When I run this, I get a NullPointerException on the Server side, in Axis code. SOAPMonitor shows the client sending this message in the envelope: soapEnv:Body in0 xmlns=urn:MyWebServiceNSA/in0 in1 xmlns=urn:MyWebServiceNSB/in1 /soapEnv:Body When I looked into the server code, I saw that the server skeleton was more like RPC or Wrapped: public java.lang.String concatenate(java.lang.String in0, java.lang.String in1) throws java.rmi.RemoteException { java.lang.String ret = impl.concatenate(in0, in1); return ret; } What am I doing wrong? Any pointers you can provide will be most gratefully appreciated. Thanks much! -Ketan = Ketan Deshpande [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: JAC-RPC 2.0 (was: Axis2: RPC - Message advantages)
And now for something Totally Off Topic. . . The next release of JAX-RPC (2.0) delegates XML mapping to JAXB. Axis 2.0 will support JAX-RPC 2.0, and it will make it much easier for you to use an external serialization service, but it will also continue to support automatic serialization using a highly optimized processor. So what happens to - Castor - XMLBeans - all the other Java-to-XML mapping frameworks ? I had assumed that with the donation of XMLBeans to Apache, there would be a consolidation or convergence, at least within Apache, on a common Java-to-XML binding framework. That XMLBeans would replace the serialization schtuff within AXIS. I assumed wrong, I guess? The problem with JAXB is it is so darn ... Heavy. I think there are 24 classes or something, generated at build time, for each class you want to be able to de/serialize. With AXIS it is pretty simple and implicit. -D -Original Message- From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] Sent: Friday, March 04, 2005 9:18 AM To: axis-user@ws.apache.org Subject: Re: Axis2: RPC - Message advantages Eugene, Why SOAP implementations do this? I can use another tools for transformation between XML and Java objects or database (Castor or Hibernate for example - it's better choise because them specialized for this task). So SOAP can be only transport for XML created by other specific tools. SOAP engines do this in order to provide developers with an RPC-style programming experience. Also, the JAX-RPC 1.1 specification requires them to do so. The next release of JAX-RPC (2.0) delegates XML mapping to JAXB. Axis 2.0 will support JAX-RPC 2.0, and it will make it much easier for you to use an external serialization service, but it will also continue to support automatic serialization using a highly optimized processor. One advantage of letting the SOAP engine do the serialization is that it consumes fewer resources -- the engine can process the message using SAX or a pull parser. If you want to use an external serialization engine, then the engine converts the message into a DOM and passes the DOM to the external serialization engine. There are serious resource consumption issues with this approach. (JAX-RPC 2.0 will mitigate some of these resource issues, though.) SOAP does much more than just XML serialization and transport, though. The real value of SOAP is in the pipeline processing model. The separation of SOAP header from SOAP body allows for the clean separation of system-level processing from application-level processing. SOAP messages may be sent directly from the sender node to the receiver node, or they may be routed through any number of intermediaries, which may perform a variety of system-level functions. Also, within a given SOAP node, the SOAP message processor may invoke any number of interceptors (handlers) to perform additional system-level functionality. All of this system level functionality may be specified using declarative policy statements. Full support for this advanced SOAP processing model is another goal of the Axis 2 project. One moment, please. Can I automaticaly give same functionality to my SOAP clients in rpc style and message style? Can you give me some examples of this? RPC vs message style refers to the programming style. It corresponds to the differences between RMI and JMS. In Axis terms, it refer to the provider you use (RPC vs MESSAGE). This programming style is orthogonal to the message encoding style (rpc/encoded vs document/literal). In other words, you can use the RPC programming style to generate both rpc/encoded and document/literal messages. Likewise, you can use the messaging programming style to generate both rpc/encoded and document/literal messages (although I don't recommend using the messaging programming style with rpc/encoded). When using the RPC programming style, you let Axis do the XML serialization. When using the messaging programming style, Axis gives you a DOM, and it's up to you to process it. I know that SOAP is not best choise instead of RMI, CORBA and EJB, but I not need full distributed objects support and biggest part of my clients (for example Mozilla-based) knows only about HTTP, XML-RPC and SOAP. I disagree with you. I think that SOAP is far superior to RMI, CORBA, and EJB. My point is that it is different from distributed objects, and therefore you need to think about the problem differently. SOAP is fundamentally a messaging system, not a distributed object system. It requires a different mindset. Anne On Fri, 04 Mar 2005 08:54:58 +0300, Eugene Prokopiev [EMAIL PROTECTED] wrote: Thanks for great answer! You should not assume that document/literal means you have to do raw XML processing. Most SOAP implementations support automatic marshaling of SOAP messages and automatic transformation of XML into Java objects when using document/literal. Why SOAP implementations do this? I can use another tools for
RE: problem with jboss installation
When I do this, I create a new exploded webapp directory in Jboss ( like c:\jbossserver\default\deploy\axis.war ) Then within WEB-INF\lib, dump all the AXIS jars.Copy over the web.xml, and I think that's it ! This allows me to run multiple independent versions of AXIS in different webapps. This is with a 3.0.x version of Jboss, though, before AXIS was added. -D -Original Message- From: Harm de Laat [mailto:[EMAIL PROTECTED] Sent: Friday, March 04, 2005 10:16 AM To: axis-user@ws.apache.org Subject: Re: problem with jboss installation I forgot to mention that you cannot use your own version of Axis in JBoss if your using scoped deployment... On Fri, 4 Mar 2005 16:14:58 +0100, Harm de Laat [EMAIL PROTECTED] wrote: We have the same setup here. Just copy axis.war in to server/default/deploy Then copy all jars from axis.dist/lib (except commons-logging.jar and log4j-1.2.8.jar) to server/default/lib If you have jboss.net in your runserver (remove it, it is using a fork of axis code). Regards, Harm de Laat Ciber Netherlands Ltd On Fri, 4 Mar 2005 09:19:27 -0500 (EST), Weichang Shi [EMAIL PROTECTED] wrote: Thanks. But I still got the same exception: - 2005-03-04 09:07:11,806 INFO [org.jboss.web.tomcat.tc5.TomcatDeployer] deploy, ctxPath=/axis, warUrl=file:/C:/jboss-3.2.6/server/default/deploy/axis.war/ 2005-03-04 09:07:20,979 INFO [org.jboss.web.localhost.Engine] StandardContext[/axis]Marking servlet AdminServlet as unavailable 2005-03-04 09:07:21,039 ERROR [org.jboss.web.localhost.Engine] StandardContext[/axis]Error loading [EMAIL PROTECTED] org.apache.axis.transport.http.AdminServlet java.lang.ClassNotFoundException: org.apache.axis.transport.http.AdminServlet .. What I did: 1.installed a new Jboss3.2.6, started server, OK, no problem. 2.shut down and copy axis(1.2RC2) from axis-download dir\webapps to jboss\server\default\deploy\ renamed it to axis.war 3.moved saaj.jar and jaxrpc to \server\default\deploy\jbossweb-tomcat50.sar 4.removed server\all\deploy\jboss-net.sar 5. restart server and got an exception! What's wrong? Please help me! Thanks! --- [EMAIL PROTECTED] wrote: Remove the jboss-net.sar directory from your deploy directory. Should be ok after that. Quoting Weichang Shi [EMAIL PROTECTED]: Thanks. But I'd like to using my own version of Axis so that I can deploy to other Application Server. Any ideas? --- Rajdeep Dua [EMAIL PROTECTED] wrote: Weichang, i think jboss 3.2.x already has axis embedded in it check jboss-net.sar in the deploy directory. Weichang Shi [EMAIL PROTECTED] wrote: Hello All, I'm trying to install Axis with JBoss 3.2.X but always get an exception. I've copied to saaj.jar and jaxrpc.jar to jbossweb-tomcat50.sar. Seems there are no answers I can find. What's wrong and what can I do? Thanks in advance! Leo 2005-03-03 17:16:56,776 INFO [org.jboss.web.tomcat.tc5.TomcatDeployer] deploy, ctxPath=/axis, warUrl=file:/C:/jboss/server/default/deploy/axis.war/ 2005-03-03 17:17:00,070 INFO [org.jboss.web.localhost.Engine] StandardContext[/axis]Marking servlet AdminServlet as unavailable 2005-03-03 17:17:00,241 ERROR [org.jboss.web.localhost.Engine] StandardContext[/axis]Error loading [EMAIL PROTECTED] org.apache.axis.transport.http.AdminServlet java.lang.ClassNotFoundException: org.apache.axis.transport.http.AdminServlet at java.net.URLClassLoader$1.run(URLClassLoader.java:199) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWra pper.java:964) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper. java:862) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardCon text.java:4013) at org.apache.catalina.core.StandardContext.start(StandardContext.j ava:4357) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerB ase.java:823) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase. java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.ja va:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessor Impl.java:39) at
RE: axis.1.02
there is no server-config.wsdd by default in the "starter" webapp, for AXIS 1.2RC3. The first service you deploy using the command line tool (org.apache.axis.client.AdminClient) , should cause the server-config.wsdd to be created with its default settings (NoremoteAdmin, etc, etc) From: Suzy Fynes [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 12:25 PMTo: axis-user@ws.apache.orgSubject: axis.1.02 Hey, Ive downloaded the new version of Axis and as I done with axis 1.0 I put the axis folder from the webapps directory into my tomcat webapps folder. The HappyAxis works fine. There are two deployed services, adminService and Version. I want to deploy my services but there is no server-config.wsdd avail in the web-inf directory. Am I installing it wrong or is the new version different?? Any help would be great thanks!!! Suzy
RE: failed requests
Probably your endpoint Url is wrong, then. Go to http://servlethost:servletport/axisdir/servlet/AxisServlet and see the various services deployed. View the WSDL for the service you are trying to contact , and verify that the endpoint Url in that WSDL is the same one your .NET app is using. In .NET, as with the Axis client, the Url is a read/write property on thewebservice proxy class. You will also get the "unable to connect" if forsome reason you have specified an HTTPproxy, either in the xxx.exe.config file, or inthe application code in your .NET client, and that Http proxy is not available. This is less common, though. Every once in a while when I forget to start my proxytrace , I get this error. -D From: Suzy Fynes [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 11:24 AMTo: axis-user@ws.apache.orgSubject: RE: failed requests The only detail I have is that the client is unable to connect to the service.. The client a .NET client and the client can connect to other services on the same server. -Original Message-From: Dino Chiesa [mailto:[EMAIL PROTECTED] Sent: 02 March 2005 16:14To: axis-user@ws.apache.orgSubject: RE: failed requests need more detail on the failure From: Suzy Fynes [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 6:17 AMTo: axis-user@ws.apache.orgSubject: failed requests Hi, Can anyone give me some reason as to why a request to an axis web service would fail given that other services setup in the same way and on the same site work fine? Other than the typical, Firewalls, client not been connected to the internet, invalid data .. Thanks Suzy
RE: Digital Signatures and Axis 1.2 RC2/RC3
Title: Message Sun's JWSDP v1.5 does XML DSIG http://java.sun.com/webservices/docs/1.5/tutorial/doc/XMLDigitalSignatureAPI.html and .NET does XML DSIG http://blogs.msdn.com/shawnfa/archive/2003/11/12/57030.aspx so possibly you could "roll your own" by grabbing just the part of Sun JWSDP that you need and using that within your AXIS app. I haven't tried this. From: Faucher, Christian [mailto:[EMAIL PROTECTED] Sent: Thursday, March 03, 2005 5:46 PMTo: axis-user@ws.apache.orgSubject: Digital Signatures and Axis 1.2 RC2/RC3 Hi all, We've been investigating a way to certify that the client calling our server is really the expected client. We came across digital signatures (SOAP-DSIG). Is this a supported feature by Axis? Or do I need to install WSSE as well? Is it supported as well by .NET in a compatible way? In our case, the server-side processing could be an Handler intercepting the SOAP request, looking for SOAPSEC, get the signature and valid it. But we would like to avoid as much as possible WSSE4J (time constraints, nothing personal...). Christian Faucher Concepteur/Designer AXA Canada Tech 2020, rue University, Bureau 600 Montréal (Québec) H3A 2A5 T: (514) 282-6817,x2943 F: (514) 282-6017 Email: [EMAIL PROTECTED] "Ce message est confidentiel, à l'usage exclusif du destinataire ci-dessus et son contenu ne représente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par écrit de la part de AXA. Toute publication, utilisation ou diffusion, même partielle, doit être autorisée préalablement. Si vous n'êtes pas destinataire de ce message, merci d'en avertir immédiatement l'expéditeur.""This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately."
RE: deployment with Axis1.2
I use WSDL2Java (have I mentioned that before? ) and it generates a deploy.wsdd for me. Then I use the AdminClient and deploy the service. Voila! From: Suzy Fynes [mailto:[EMAIL PROTECTED] Sent: Thursday, March 03, 2005 10:34 AMTo: axis-user@ws.apache.orgSubject: deployment with Axis1.2 How did anyone deploy their services using the new release of axis? The server-config.wsdd wasnt in the WEB-INF folder of axis. Thanks Suzy
RE: Array serialization-deserialization
yes, that's what I get, too. From: Bill Keese [mailto:[EMAIL PROTECTED] Sent: Thursday, March 03, 2005 7:34 PMTo: axis-user@ws.apache.orgSubject: Re: Array serialization-deserialization My latest experience with this is that (with Axis 1.2, at least), you don't have to declare arrays in your WSDD file. However, if you have a wrapper class like this: s:complexType name="Array_float" s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="item" type="s:float" / /s:sequence /s:complexType... then you have to declare Array_float as a BEAN (not an Array). This makes sense when you really think about although it's counter-intuitive at first.Anyway, if you use bare arrays like this: s:element name="GetArrayOfSingleResult" s:complexType s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="floatItem" type="s:float" / /s:sequence /s:complexType /s:element... then you don't have to declare anything.Dino Chiesa wrote: Resurrecting this from a couple days ago... Is Axis smart enough to automatically use an ArraySerializer to serialize/deserialize arrays of simple types, a String[] for instance? Or do I have to declare a typeMapping for String[] wherever a service uses one? I basically just want to know whether it's sufficient for me to declare String[]s in my .wsdl without having to declare them a second time in my server-config.wsdd file. I think the answer is Yes, if you use AXIS 1.2RC3, No, if you use AXIS 1.1. Using AXIS 1.1, I cannot get arrays of simple types (string float, etc) to serialize properly without a wrapper. I think the ArraySerializer always uses soap encoding, which is probably not what you want. Suppose I define a message element in the wsdl representing an array of a simple type, such as s:element name="GetArrayOfSingleResult" s:complexType s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="floatItem" type="s:float" / /s:sequence /s:complexType /s:element Then I run WSDL2Java --server-side , and generate the interface and the deploy.wsdd. If I then provide my own implementation, and deploy it all (wrapped/literal), the response is not serialized properly. I get: soapenv:Body GetArrayOfSingleResponse xmlns="urn:ionic.basics.nowrapper.2005.03" GetArrayOfSingleReturn soapenc:arrayType="xsd:float[4]" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" item xmlns=""0.58614534/item item xmlns=""0.619/item item xmlns=""0.6607646/item item xmlns=""0.00925833/item /GetArrayOfSingleReturn /GetArrayOfSingleResponse /soapenv:Body Ick. This seems wrong since the wsdd says "doc/literal". Also it's not going to work for interop with .NET clients. I didn't try it with other clients. On the other hand if in the WSDL I define a complexType that wraps the sequence of elements, such as s:element name="GetArrayOfSingleResult" s:complexType s:sequence s:element minOccurs="0" maxOccurs="1" name="floatItem" type="s0:Array_float" / /s:sequence /s:complexType /s:element !-- this WSDL artifact is not WS-I BP1.0 compliant, but is necessary to enable AXIS to serialize properly -- s:complexType name="Array_float" s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="item" type="s:float" / /s:sequence /s:complexType Then, interop works. The XML on the wire looks like this: soapenv:Body GetArrayOfSingleResponse xmlns="http://example.org/webservices/" GetArrayOfSingleReturn item0.1324557/item item0.46750873/item /GetArrayOfSingleReturn /GetArrayOfSingleResponse /soapenv:Body Which is fine. Somebody else has previously pointed out that the element name is always Always ALWAYS "item", but that's only a minor thing. The main drawback is that there is an extra wrapper in the Java-side programming model. I cannot return float[], I have to deal with a wrapper class (bean) that has a float[] as a property. Like so: public Array_float getArrayOfSingle(...) { Array_float a= new Array_float(); a.setItem(new float[n]); return a; } That was all for AXIS 1.1. I guess the wrapper type on the server side is the price you pay for using "simple arrays". In AXIS 1.2RC3, it just works for me. A working example of an AXIS web service that sends Arrays of simple types to .NET clients is here (with app source). http://dinoch.dyndns.org:7070/axis1.2/AboutArrays.jsp -Dino Laran says: The only thing I found in the archives was Patrick Van Kann's issues with serializing Collections. I basically just want to know whether it's sufficient for me to declare String[]s in
RE: failed requests
need more detail on the failure From: Suzy Fynes [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 6:17 AMTo: axis-user@ws.apache.orgSubject: failed requests Hi, Can anyone give me some reason as to why a request to an axis web service would fail given that other services setup in the same way and on the same site work fine? Other than the typical, Firewalls, client not been connected to the internet, invalid data .. Thanks Suzy
RE: where to put the wsdd
I don't think it matters? It is not handled by the server runtime. Instead it is a param you pass to the AXIS AdminClient , so deploy.wsdd needs to be accessible from the command line when you run: $ java org.apache.axis.client.AdminClient deploy.wsdd BUT,(grinding that axe again) if you follow the guideline of designing your WSDL first, then the dpeloy.wsdd gets generated for you, and is inserted into the output dir, along with the java artifacts like the ServiceLocator, the Stub, etc. It goes in the directory corresponding to the package you specify on the Wsdl2Java command line. -D From: Paul Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 11:43 AMTo: axis-user@ws.apache.orgSubject: where to put the wsdd Hi there, To what directory should I deploy the deploy.wsdd file. I am using Tomcat 5.0.28 Thanks a million, Paul
RE: newbie: serializing deserializing nested custom object
Fabrizio, mi scusi, man non parlo o scritto l'italiano bene. If you look at some of the recent discussion on the axis-user list, you'll see some recommendations such as: 1- stay away from custom collections (such as Hashtable) in web services interfaces 2- define your WSDL first, primo. Before providing the implementation. Provide your implementation after running WSDL2Java. Despite this, someone on this list may be able to help you if you wish to ignore recommendation #1. -Dino -Original Message- From: fabrizio picca [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 12:36 PM To: axis-user@ws.apache.org Subject: newbie: serializing deserializing nested custom object This is my first post, i'm new to axis, so excuse the eventual oddness of this question. i wanna call a remote service like this setTrigger(hashtable triggerMap,String urlRef,String ipRef) The hashtable triggerMap contains Trigger custom objects. Those Triggers are made of String and another custom object : Event. Event,in the end is made up of two strings and the last custom Object: Parameter which contains only strings. following the example found in axis documentation i've wrote down this: QNameqnT = new QName( endpoint , Trigger ); QNameqnP = new QName( endpoint , Parameter ); QNameqnE = new QName( endpoint , Event ); call.registerTypeMapping(Parameter.class, qnP, new org.apache.axis.encoding.ser.BeanSerializerFactory(Parameter.class, qnP), new org.apache.axis.encoding.ser.BeanDeserializerFactory(Parameter.class, qnP)); call.registerTypeMapping(Event.class, qnE, new org.apache.axis.encoding.ser.BeanSerializerFactory(Event.class, qnE), new org.apache.axis.encoding.ser.BeanDeserializerFactory(Event.class, qnE)); call.registerTypeMapping(Trigger.class, qnT, new org.apache.axis.encoding.ser.BeanSerializerFactory(Trigger.class , qnT), new org.apache.axis.encoding.ser.BeanDeserializerFactory(Trigger.class, qnT)); But all i can obtain is an Exception like: No Deserializer for {[endpoint]}Trigger. I hope i was quite clear in explanation. Tanks a lot. Fabrizio
RE: Handmade WSDL?
Don't waste the effort! Instead, fix it at the source. . . -Original Message- From: Airline Pedestal [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 6:29 PM To: axis-user@ws.apache.org; Anne Thomas Manes Subject: Re: Handmade WSDL? Hi Anne, Could you provide an example how to extract that? Thanks, A --- Anne Thomas Manes [EMAIL PROTECTED] wrote: Ah -- I see. This DataSet is coming from a .NET service (probably generated by ADO.NET), and then stuffed into the SOAP message as a string. Unfortunately, because the string starts with the ?xml declaration, you won't be able to get Axis to process it for you. You are going to have to extract the string and then process it using SAX or DOM. You need to go abuse the card processing folks. This is what's known as a worst practice. Anne __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail
RE: Document/Literal problem with .NET client
= / - wsdl:input name=getAllIRTypeRequest wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:input - wsdl:output name=getAllIRTypeResponse wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:output - wsdl:fault name=GenericException wsdlsoap:fault encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; name=GenericException namespace=urn:ihis use=encoded / /wsdl:fault /wsdl:operation - wsdl:operation name=findIRTypes wsdlsoap:operation soapAction= / - wsdl:input name=findIRTypesRequest wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:input - wsdl:output name=findIRTypesResponse wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:output - wsdl:fault name=GenericException wsdlsoap:fault encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; name=GenericException namespace=urn:ihis use=encoded / /wsdl:fault /wsdl:operation - wsdl:operation name=findSpecificDataWithFullValue wsdlsoap:operation soapAction= / - wsdl:input name=findSpecificDataWithFullValueRequest wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:input - wsdl:output name=findSpecificDataWithFullValueResponse wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:output /wsdl:operation - wsdl:operation name=findSpecificDataWithPatialValue wsdlsoap:operation soapAction= / - wsdl:input name=findSpecificDataWithPatialValueRequest wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:input - wsdl:output name=findSpecificDataWithPatialValueResponse wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; namespace=urn:ihis use=encoded / /wsdl:output /wsdl:operation /wsdl:binding - wsdl:service name=JaxRpcIRTypeServiceService - wsdl:port binding=impl:IRTypeServiceSoapBinding name=IRTypeService wsdlsoap:address location=http://localhost:8080/ihis/services/IRTypeService; / /wsdl:port /wsdl:service /wsdl:definitions Regards, Murad On Mon, 28 Feb 2005 11:16:49 -0800, Dino Chiesa [EMAIL PROTECTED] wrote: We could help if you sent the WSDL and a copy of the request and response. If .NET does not see the namespace it expects, you'll get null. Even the smallest namespace change in the XML response document will cause the .NET client proxy to return null to the application. We saw this with Pradeep's collection of ContainerBeans last week. And someone else posted a similar story, too. But it's not possible to diagnose with just your WSDD file. -Original Message- From: Murad [mailto:[EMAIL PROTECTED] Sent: Saturday, February 26, 2005 4:43 AM To: axis-user@ws.apache.org Subject: Document/Literal problem with .NET client Hello, I am using Axis1.2RC2. .Net clients successfully make a request and axis also produces a successful response(see through TCP monitor). But as a return value I am getting null.Proxy client is generating without giving any error(I am using wsdl.exe comes with visual studio.net).With default options(by not mentioning style and literal attributes) everything works fine. Here is the service element from server-config.wsdd : service name=IRTypeService provider=java:RPC style=document use=literal namespaceurn:ihis/namespace parameter name=allowedMethods value=*/ parameter name=scope value=session/ parameter name=className value=com.sikraft.ihis.inpatient.roomtype.JaxRpcIRTypeService/ beanMapping qname=ihis:IRTypeDTO xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.ihis.inpatient.roomtype.IRTypeD TO / beanMapping qname=ihis:PersistantCapable xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.business.PersistantCapab le / beanMapping qname=ihis:PersistantCapableDTO xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.business.PersistantCapab le DTO/ beanMapping qname=ihis:BusinessEntity xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.ihis.common.BusinessEntity/ beanMapping qname=ihis:SearchCapableDTO xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.search.SearchCapableDTO/ beanMapping qname=ihis:SearchableBusinessEntity xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.ihis.common.SearchableBusinessE nt ity/ beanMapping qname=ihis:Result xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.business.Result/ beanMapping qname=ihis:GenericException xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.exception.GenericExcepti on / beanMapping qname=ihis:SystemException xmlns:ihis=urn:ihis languageSpecificType
Why Castor + AXIS?
What's the typical reason for using Castor with AXIS? - AXIS is missing features that Castor has? - Castor is already in use and the org wants to add webservices capability - something else? -Dino -Original Message- From: Kenneth Stephen [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 12:33 PM To: axis-user@ws.apache.org Subject: Fault code not being reported when CastorSerializer throws exception Hi, I am seeing a validation failure in my response (which is an application failure that I will correct), but the associated fault code isnt being reported back to the client. Here is the exception that I see in the application server logs : [2/28/05 11:19:34:782 CST] 35205df6 SystemOut U - Exception: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.io.IOException: Message doesn't comply with the associated XML schema :The following exception occured while validating field: _items of class: services.ice.catalog.details.DetailResponseType faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.io.IOException: Message doesn't comply with the associated XML schema :The following exception occured while validating field: _items of class: services.ice.catalog.details.DetailResponseType at org.apache.axis.encoding.ser.castor.CastorSerializer.serialize(CastorSer ializer.java:120) at org.apache.axis.encoding.SerializationContext.serializeActual(Serializat ionContext.java:1353) at org.apache.axis.encoding.SerializationContext.serialize(SerializationCon text.java:880) at org.apache.axis.message.RPCParam.serialize(RPCParam.java:177) But on the client side, I get an empty response with an HTTP status code of 200. Has anyone seen this behaviour? Any known fixes? I am using 1.2RC2 on WebSphere v4. Thanks, Kenneth
RE: Document/Literal problem with .NET client
We could help if you sent the WSDL and a copy of the request and response. If .NET does not see the namespace it expects, you'll get null. Even the smallest namespace change in the XML response document will cause the .NET client proxy to return null to the application. We saw this with Pradeep's collection of ContainerBeans last week. And someone else posted a similar story, too. But it's not possible to diagnose with just your WSDD file. -Original Message- From: Murad [mailto:[EMAIL PROTECTED] Sent: Saturday, February 26, 2005 4:43 AM To: axis-user@ws.apache.org Subject: Document/Literal problem with .NET client Hello, I am using Axis1.2RC2. .Net clients successfully make a request and axis also produces a successful response(see through TCP monitor). But as a return value I am getting null.Proxy client is generating without giving any error(I am using wsdl.exe comes with visual studio.net).With default options(by not mentioning style and literal attributes) everything works fine. Here is the service element from server-config.wsdd : service name=IRTypeService provider=java:RPC style=document use=literal namespaceurn:ihis/namespace parameter name=allowedMethods value=*/ parameter name=scope value=session/ parameter name=className value=com.sikraft.ihis.inpatient.roomtype.JaxRpcIRTypeService/ beanMapping qname=ihis:IRTypeDTO xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.ihis.inpatient.roomtype.IRTypeDTO / beanMapping qname=ihis:PersistantCapable xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.business.PersistantCapable / beanMapping qname=ihis:PersistantCapableDTO xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.business.PersistantCapable DTO/ beanMapping qname=ihis:BusinessEntity xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.ihis.common.BusinessEntity/ beanMapping qname=ihis:SearchCapableDTO xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.search.SearchCapableDTO/ beanMapping qname=ihis:SearchableBusinessEntity xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.ihis.common.SearchableBusinessEnt ity/ beanMapping qname=ihis:Result xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.business.Result/ beanMapping qname=ihis:GenericException xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.exception.GenericException / beanMapping qname=ihis:SystemException xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.exception.SystemException / beanMapping qname=ihis:BusinessRuleException xmlns:ihis=urn:ihis languageSpecificType=java:com.sikraft.welkin.exception.BusinessRuleExce ption/ /service Please help... Regards, Murad
RE: Speaking of deserialize exceptions
Ah, no. I believe Mariano is saying : WSDL is the contract. The promise that is made between server and client. (I promise, that if you send me a message that looks like X, I will send you a reply that looks like Y). The De-serializer falls under the execution of the contract. That is to say, whether the contract is being fulfilled or not. (Example: A message that looks like X is received, and maybe a message that DOES NOT look like Y is returned.) In order to properly respond to incoming requests, AXIS needs to be able to de-serialize data from the XML. If the server-side AXIS app does not de-serialize, then I suppose it will not be able to honor the WSDL contract. -Original Message- From: Joaco [mailto:[EMAIL PROTECTED] Sent: Friday, February 25, 2005 8:56 AM To: axis-user@ws.apache.org Subject: Re: Speaking of deserialize exceptions Hi mariano, Thenks for your fast answer. So?. you said that wsdl does not have all the information that the client need to understand the server ? Regards Joaco. -- Mensaje original -- Reply-To: axis-user@ws.apache.org Date: Fri, 25 Feb 2005 09:13:11 +0100 From: Mariano Eloy Fernández [EMAIL PROTECTED] To: axis-user@ws.apache.org Subject: Re: Speaking of deserialize exceptions Hi Joaco, The client probably does not work because if you remove that particular deserializer the server does not know how to deserialize incoming XML request from your client (.NET). WSDL does not change becouse De/Serializers and WSDL are two different things. Regards, Mariano. Joaco wrote: Hi everybody! Me again?? with my questions ;) When I delete for example deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory in my server-config.wsdl (typeMapping), the ws´s wsdl don?t change. But the client ( .net ) don´t work. My question is: Of course the client don?t see my server-config.wsdl :), so I don?t understand why is necessary if the wsdl don?t change. and I don?t understand Why if the client is .net I need to set up this attribute (deserializer) with a Java class. I hope someone have the answers. Tanks! Joaquín.
RE: Handmade WSDL?
Not stupid... Your approach is reasonable, but... Can you not contact the card processing service people and ask them to resolve the difference between the doc and the WSDL ? -Original Message- From: Elaine Nance [mailto:[EMAIL PROTECTED] Sent: Monday, February 28, 2005 3:45 PM To: axis-user@ws.apache.org Subject: Handmade WSDL? Hope this is not stupid, but Problem: the wsdl for our (supposedly) enterprise credit card processing service shows well defined request parameters, but the SOAP responses are all designated as string, as shown below. I am thinking that the best way to generate the client stubs I need in Java is to create a wsdl with better response typing and generate the stubs using WSDL2Java and then test. Does it make sense to proceed like the above? or should I just build parsers using SAX or DOM or whatever? Thank you, Elaine - example request s:element name=GetAVSResponseCodeValue s:complexType s:sequence s:element minOccurs=0 maxOccurs=1 name=sCode type=s:string / /s:sequence /s:complexType /s:element - example response as given s:element name=GetAVSResponseCodeValueResponse s:complexType s:sequence s:element minOccurs=0 maxOccurs=1 name=GetAVSResponseCodeValueResult type=s:string / /s:sequence /s:complexType /s:element - WHAT THE RESPONSE SHOULD LOOK LIKE (I THINK) s:element name=GetAVSResponseCodeValueResponse s:complexType type=s:AVSRespCode s:sequence s:element minOccurs=1 maxOccurs=1 name=AVSCode type=s:string/ s:element minOccurs=1 maxOccurs=1 name=AVSMessage type=s:string/ s:element minOccurs=1 maxOccurs=1 name=ID type=s:string/ s:element minOccurs=1 maxOccurs=1 name=Status type=s:string/ /s:sequence /s:complexType /s:element - ALTERNATIVELY s:element name=GetAVSResponseCodeValueResponse s:complexType type=s:NewDataSet s:sequence type=s:AVSRespCode s:element minOccurs=1 maxOccurs=1 name=AVSCode type=s:string/ s:element minOccurs=1 maxOccurs=1 name=AVSMessage type=s:string/ s:element minOccurs=1 maxOccurs=1 name=ID type=s:string/ s:element minOccurs=1 maxOccurs=1 name=Status type=s:string/ /s:sequence /s:complexType /s:element - the web service docs indicate that the xml returned (minus SOAP envelope) will look like the following: NewDataSet AVSRespCode AVSCode1/AVSCode AVSMessageNo Address Supplied/AVSMessage ID1/ID StatusE/Status /AVSRespCode /NewDataSet ~~ | Computers are useless. They can only give you answers. | -- Pablo Picasso -- ~~
RE: Problem in talking to Web Service
Rather than going to the dynamic invocation pattern, could you not specify a webservices interface that accepted and replied with XmlElement ? Then any arbitrary XML could be accepted as an input and output message, and you can use XMLBeans as the serializer/de-serializer in your application layer, after AXIS hands your code the XmlElement. This would allow you to keep the RPC/stub programming model, on both the server and on clients. But you'd have flexible message interpretation on the server side. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 8:32 AM To: [EMAIL PROTECTED]; axis-user@ws.apache.org Subject: Problem in talking to Web Service Importance: High Hi Tom I tried the way you said. I am enclosing the sample code also. But I am getting this following error. Please help me how to proceed further from here org.xml.sax.SAXException: Bad types (class java.lang.String - class oasisNamesT cSPML101.BatchRequest) Regards Deepak -Original Message- From: Tom Oinn [mailto:[EMAIL PROTECTED] Sent: 22 February 2005 13:39 To: axis-user@ws.apache.org Subject: Re: Problem in talking to Web Service [EMAIL PROTECTED] wrote: Hi Tom Thanks a lot for the reply. Can you just explain a little bit further on this. 1) How to I cast the bean to the autogenerated class You don't - in fact, I'd avoid all autogenerated code other than your XMLBeans, forget about the Axis tools in this case. 2) Can you provide some information on document style dynamic invocation The idea is that you give Axis the entire XML payload - in this case Axis is responsible for enclosing that payload in the requisite SOAP body, managing the network communication etc. It is also resonsible, where this is configured, for handling aspects such as WS-security. This is why there's actually a point to having Axis rather than just making the call yourself (which can seem similar at first glance) To invoke the service you create an array of SOAPBodyElement objects from your XML (you get the XML from the XMLBean). This array should be length 1 unless you're doing something really strange (I think, anyone correct me on this?). You should be able to find the appropriate methods to populate the SOAPBodyElement in the javadoc. You then need to create a Call object - this is the handle Axis uses to the service which you can then use to invoke it : String url = http://foo.bar.com/ServiceEndpoint;; Service service = new Service(); Call call = (Call) service.createCall(); call.setTargetEndpointAddress(url); (You'll need to further configure the call object with your operation name etc) To invoke you then use : Vector result = (Vector) call.invoke(input) Where 'input' is your SOAPBodyElement[] you created earlier. The result is a Vector object which contains a SOAPBodyElement corresponding to the result, you can get the DOM objects from this element with : SOAPBodyElement resultElement = (SOAPBodyElement)result.get(0); Element e = resultElement.getAsDOM(); You should then have an instance of org.w3c.dom containing your results as per the schema in the WSDL file, I'm not familiar with XMLBeans particularly but I would imagine you could use this to create a corresponding result XMLBean? 3) Can it be found out from the WSDL file that our service is document style or not. I am enclosing the WSDL file with the mail It can, and yours is - look for : - wsdl:binding name=SPMLSoapBinding type=tns:SPMLRequestPortType soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http; / - wsdl:operation name=SPMLBatchRequest soap:operation style=document soapAction=urn:oasis:names:tc:SPML:1:0/batchRequest / You'll also find various use=literal statements. Cheers, Tom -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 266.3.0 - Release Date: 2/21/2005
RE: rpc/literal vs document/literal, and returning a list of objects
sounds right. as we discussed previously, .NET can use a wrapperclass in the same way, but doesn't need to. From: Bill Keese [mailto:[EMAIL PROTECTED] Sent: Monday, February 21, 2005 11:45 PMTo: axis-user@ws.apache.orgSubject: Re: rpc/literal vs document/literal, and returning a list of objects Yeah, I did add those. Basically, I think this all boils down to a misunderstanding of how Axis works. What I learned recently is that, if you have an array-wrapper in your WSDL schema definition, so that the XML looks like this:employee nameBill/name phoneNumbers item123-4546/item item415-3030/item /phoneNumbers/employee... then in the java code needs a array wrapper class too: class employee { String name; ArrayOfPhoneNumbers phoneNumbers; } class ArrayOfPhoneNumbers{ String[] numbers; }On a similar note, you may want to use that class for functions that return arrays directly. For example: ArrayOfPhoneNumbers getPhoneNumbers() { }(not String[] getPhoneNumbers() )This confused me because it seems like unnecessary overhead, and it's not the way .NET works. On the other hand, I guess that it keeps the alignment between the java beans and the schema types pure.Hope I didn't mess up the explanation; I think I finally understand it though now.BillSebastien Mayemba Mbokoso wrote: Hi Bill, do u already try to map your array in your WSDD ? Something like that : typeMapping xmlns:ns="urn:MyNS" qname="ns:Employe" type="java:bill.keese.Employe" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" / typeMapping xmlns:ns="urn:MyNS" qname="ns:ArrayOfEmployee" type="java:bill.keese.Employe[]" serializer="org.apache.axis.encoding.ser.ArraySerializerFactory" deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory" encodingStyle="" / --- Sebastien On Thu, 17 Feb 2005 15:15:17 +0900, Bill Keese [EMAIL PROTECTED] wrote: Wow, great answer. Thanks! I was actually just asking about issue #2, wrapped or bare arrays. I looked over the Axis code again and realized that in ArraySerializer.java version 1.31, the code I mentioned in my previous mail was corrected to output wrapped or bare arrays in concordance with the WSDL file. The problem is that there is still a bug when an operation returns an array directly, rather than a structure containing an array (ie, an operation like "Employee[] getEmployees()"). Bill Dino Chiesa wrote: I am not clear. Seems there are two issues, 1. SOAP encoding (blch!) vs Literal 2. wrapped or bare arrays Let's stay away from SOAPENC:arrayType since we all listen to WS-I. So, on issue #2, are you asking, does .NET expect arrays embedded in types to be serialized as [Example 1]: Container param1 foo/param1 wrapper param2bar/param2 param2blah/param2 ... /wrapper /Container or as [Example 2] Container param1 foo/param1 param2bar/param2 param2blah/param2 ... /Container ? The answer is, .NET can go either way. It takes its cue from the WSDL. If the WSDL uses a complexType to wrap an array, such as this: s:complexType name="Container" s:sequence s:element minOccurs="1" maxOccurs="1" name="param1" nillable="true" type="s:string" / s:element minOccurs="1" maxOccurs="1" name="wrapper" nillable="true" type="tns:ArrayOfString" / /s:sequence /s:complexType s:complexType name="ArrayOfString" s:sequence s:element minOccurs="0" maxOccurs="unbounded" name="param2" type="s:string" / /s:sequence /s:complexType ... then .NET will expect the XML on the wire to be "wrapped", as in [Example 1] above. If the WSDL does not use a complexType to wrap the array, but instead uses an element with maxOccurs != 1, like so: s:complexType name="Container" s:sequence s:element minOccurs="1" maxOccurs="1" name="param1" nillable="true" type="s:string" / s:element minOccurs="0" maxOccurs="unbounded" name="param2" type="s:string" / /s:sequence /s:complexType ...then .NET will expect XML on the wire that does not wrap the array in an element, such as in [Example 2] above. So you can do whatever. what format do people usually use? I guess it's a matter of style and taste. From the app programmer's perspective
RE: rpc/literal vs document/literal, and returning a list of objects
yes, and don't you also need the array getter and setter?, such as publicString[] getPhoneNumbers() { return phoneNumbers; } public void setPhoneNumbers(StringphoneNumberArray[]) { phoneNumbers = phoneNumberArray; } From: Praveen Peddi [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 22, 2005 10:03 AMTo: axis-user@ws.apache.orgSubject: Re: rpc/literal vs document/literal, and returning a list of objects Or I think you can have get and set methods for the getting setting corresponding array elements as follows: class employee { String name; String[] phoneNumbers; publicString getPhoneNumbers(index i) { return phoneNumbers[i]; } public void setPhoneNumbers(index i, Strong phoneNumber) { phoneNumbers[i] = phoneNumber; } } Doing this doesn't need a wrapper class. I think having a wrapper class is un necessary overhead and also not obvious. Praveen - Original Message - From: Dino Chiesa To: axis-user@ws.apache.org Sent: Tuesday, February 22, 2005 12:53 PM Subject: RE: rpc/literal vs document/literal, and returning a list of objects sounds right. as we discussed previously, .NET can use a wrapperclass in the same way, but doesn't need to. From: Bill Keese [mailto:[EMAIL PROTECTED] Sent: Monday, February 21, 2005 11:45 PMTo: axis-user@ws.apache.orgSubject: Re: rpc/literal vs document/literal, and returning a list of objects Yeah, I did add those. Basically, I think this all boils down to a misunderstanding of how Axis works. What I learned recently is that, if you have an array-wrapper in your WSDL schema definition, so that the XML looks like this:employee nameBill/name phoneNumbers item123-4546/item item415-3030/item /phoneNumbers/employee... then in the java code needs a array wrapper class too: class employee { String name; ArrayOfPhoneNumbers phoneNumbers; } class ArrayOfPhoneNumbers{ String[] numbers; }On a similar note, you may want to use that class for functions that return arrays directly. For example: ArrayOfPhoneNumbers getPhoneNumbers() { }(not String[] getPhoneNumbers() )This confused me because it seems like unnecessary overhead, and it's not the way .NET works. On the other hand, I guess that it keeps the alignment between the java beans and the schema types pure.Hope I didn't mess up the explanation; I think I finally understand it though now.BillSebastien Mayemba Mbokoso wrote: Hi Bill, do u already try to map your array in your WSDD ? Something like that : typeMapping xmlns:ns="urn:MyNS" qname="ns:Employe" type="java:bill.keese.Employe" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" / typeMapping xmlns:ns="urn:MyNS" qname="ns:ArrayOfEmployee" type="java:bill.keese.Employe[]" serializer="org.apache.axis.encoding.ser.ArraySerializerFactory" deserializer="org.apache.axis.encoding.ser.ArrayDeserializerFactory" encodingStyle="" / --- Sebastien On Thu, 17 Feb 2005 15:15:17 +0900, Bill Keese [EMAIL PROTECTED] wrote: Wow, great answer. Thanks! I was actually just asking about issue #2, wrapped or bare arrays. I looked over the Axis code again and realized that in ArraySerializer.java version 1.31, the code I mentioned in my previous mail was corrected to output wrapped or bare arrays in concordance with the WSDL file. The problem is that there is still a bug when an operation returns an array directly, rather than a structure containing an array (ie, an operation like "Employee[] getEmployees()"). Bill Dino Chiesa wrote: I am not clear. Seems there are two issues, 1. SOAP encoding (blch!) vs Literal 2. wrapped or bare arrays Let's stay away from SOAPENC:arrayType since we all listen to WS-I. So, on issue #2, are you asking, does .NET expect arrays embedded in types to be serialized as [Example 1]: Container param1 foo/param1 wrapper param2bar/param2 param2blah/param2 ... /wrapper /Container or as [Example 2] Container param1 foo/param1 param2bar/param2 param2blah/param2 ... /Container ? The answer is, .NET can go either way. It takes its cue from the WSDL. If the WSDL uses a complexType to wrap an array, such as this: s:complexType name="Container" s:sequence s:element minOccurs="1" maxOccurs="1" name="param1" nillable="true" type="s:string" / s:element minOccurs="1" maxOccurs="1" name=&qu