Re: import schema to wsdl
=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://ie.tcd/taylorjw/flightbooking; xsd:import namespace = http://ie.tcd/taylorjw/flightbooking; schemaLocation=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types message name=bookFlightsReq part name=parameters element=types:bookFlightsRequest / /message message name=bookFlightsResp part name=parameters element=types:bookFlightsResponse / /message portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType Quoting Anne Thomas Manes [EMAIL PROTECTED]: James, If you want an interface that accepts parameters rather than an object, then you must define your WSDL so that it matches the wrapped convention. What that means is that your input message element name must be identical to your operation name. Currently your input message element name is bookFlightsRequest and your operation name is bookFlights. If you fix it so that they are the same, it should give you what you want. Anne On 6/6/05, Jeff [EMAIL PROTECTED] wrote: In general, I wouldn't let Axis provide a WSDL file. Tell it to use your WSDL file by adding a wsdlFile element to the WSDD file before you deploy so you wind up with something like: deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; wsdlFile/MyService.wsdl/wsdlFile service name=... Put MyService.wsdl in Tomcat\webapps\axis\WEB-INF\classes You will want to edit MyService.wsdl so that the endpoint near the end of the file is something that clients can connect instead of: http://localhost:9081/AxisWeb/services/BookFlightsSOAPPort Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Monday, June 06, 2005 5:02 AM Subject: Re: import schema to wsdl Thanks for your help jeff. The main problem was the conflicting target namespaces I was trying to import into my wsdl. I've gotten the wsdl2java tool to work fine now. Just a question on what will when the service gets deployed to axis. I presume axis will make a different wsdl then the one I gave to the tool as it has defined a method signature for the portType as public java.lang.Object bookFlights(java.lang.Object parameters) throws java.rmi.RemoteException; would any one mind commenting on this as I defined the method signature in the wsdl more specific then this... I know that I defined a custom collection bean that is of type object - I presume I'll cast the parameters to get at it. Regards, James. My wsdl and external schema... definitions targetNamespace=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:types=http://ie.tcd/taylorjw/flightbooking; types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://ie.tcd/taylorjw/flightbooking; xsd:import namespace = http://ie.tcd/taylorjw/flightbooking; schemaLocation=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types message name=bookFlightsReq part name=parameters element=types:bookFlightsRequest / /message message name=bookFlightsResp part name=parameters element=types:bookFlightsResponse / /message portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType binding name=BookFlightsSOAPBinding type=tns:IBookFlightsPort soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http; / operation name=bookFlights
Re: import schema to wsdl
That reminds me, I found that WSDL2Java doesn't support maxOccurs in sequence, e.g. xsd:element name=bookFlightsResponse xsd:sequence maxOccurs=unbounded xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element - Original Message - From: Anne Thomas Manes [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Wednesday, June 08, 2005 4:41 PM Subject: Re: import schema to wsdl James, This definition: xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element will return on Flight object. If you want to return an array of flight objects you should define it thus: xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight maxOccurs=unbounded/ /xsd:sequence /xsd:element Anne On 6/8/05, James Taylor [EMAIL PROTECTED] wrote: Hey anne, I've followed your advice by changing the method name in the portType to the same as in the message in the wsdl. But when I ran it through wsdl2java it produced the following dtd that says its doc-literal and the message signature in SoabBindingImp still says Object and return type Object. To get wrapped style do I have to change these manually? The exposed web service message should take a BookFlight object and return a list of booked flights. Just a question on the return type. In the xsd I have declare it as xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element does this not mean it should return a list of Flight objects? Regards, James. PS - Here's generated deploy.wsdd. !-- Use this file to deploy some handlers/chains and services -- !-- Two ways to do this: -- !-- java org.apache.axis.client.AdminClient deploy.wsdd -- !-- after the axis server is running -- !-- or -- !-- java org.apache.axis.utils.Admin client|server deploy.wsdd -- !-- from the same directory that the Axis engine runs -- deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; !-- Services from BookFlightsService WSDL service -- service name=BookFlightsSOAPPort provider=java:RPC style=document use=literal parameter name=wsdlTargetNamespace value=http://ie/tcd/taylorjw/flightbooking/wsdl/ parameter name=wsdlServiceElement value=BookFlightsService/ parameter name=wsdlServicePort value=BookFlightsSOAPPort/ parameter name=className value=flightCompany.bookFlights.rpcservice.BookFlightsSOAPBindingImpl/ parameter name=wsdlPortType value=IBookFlightsPort/ operation name=bookFlights qname=bookFlights returnQName=retNS:bookFlightsResponse xmlns:retNS=http://ie.tcd/taylorjw/flightbooking; returnType=rtns:anyType xmlns:rtns=http://www.w3.org/2001/XMLSchema; soapAction=bookFlights parameter qname=pns:bookFlightsRequest xmlns:pns=http://ie.tcd/taylorjw/flightbooking; type=tns:anyType xmlns:tns=http://www.w3.org/2001/XMLSchema/ /operation parameter name=allowedMethods value=bookFlights/ parameter name=scope value=Session/ typeMapping xmlns:ns=http://ie.tcd/taylorjw/flightbooking; qname=ns:Flight type=java: flightCompany.bookFlights.rpcservice.Flight serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle= / typeMapping xmlns:ns=http://ie.tcd/taylorjw/flightbooking; qname=ns:Passenger type=java: flightCompany.bookFlights.rpcservice.Passenger serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle= / typeMapping xmlns:ns=http://ie.tcd/taylorjw/flightbooking; qname=ns:Booking type=java: flightCompany.bookFlights.rpcservice.Booking serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle= / /service /deployment Quoting Anne Thomas Manes [EMAIL PROTECTED]: Sorry for the delay -- I've been away from this list for a couple of days... You need to change the message definition in the WSDL like so: message name=bookFlightsReq part name=parameters element=types:bookFlights / /message and in your schema you need to rename the bookFlightsRequest element to bookFlights. No other changes are required. Anne On 6/6/05
Re: import schema to wsdl
Ok well what I've done is add a flightList complexType to my external xsd that is like so xsd:complexType name=flightList xsd:sequence xsd:element name=flight type=fb:Flight minOccurs=0 maxOccurs=unbounded/ /xsd:sequence /xsd:complexType and referenced this as a return type for the message and wsdl2java has generated a class for this. xsd:element name=bookFlightsResponse xsd:sequence xsd:element name=flight type=fb:flightList/ /xsd:sequence /xsd:element Quoting Jeff [EMAIL PROTECTED]: That reminds me, I found that WSDL2Java doesn't support maxOccurs in sequence, e.g. xsd:element name=bookFlightsResponse xsd:sequence maxOccurs=unbounded xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element - Original Message - From: Anne Thomas Manes [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Wednesday, June 08, 2005 4:41 PM Subject: Re: import schema to wsdl James, This definition: xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element will return on Flight object. If you want to return an array of flight objects you should define it thus: xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight maxOccurs=unbounded/ /xsd:sequence /xsd:element Anne On 6/8/05, James Taylor [EMAIL PROTECTED] wrote: Hey anne, I've followed your advice by changing the method name in the portType to the same as in the message in the wsdl. But when I ran it through wsdl2java it produced the following dtd that says its doc-literal and the message signature in SoabBindingImp still says Object and return type Object. To get wrapped style do I have to change these manually? The exposed web service message should take a BookFlight object and return a list of booked flights. Just a question on the return type. In the xsd I have declare it as xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element does this not mean it should return a list of Flight objects? Regards, James. PS - Here's generated deploy.wsdd. !-- Use this file to deploy some handlers/chains and services -- !-- Two ways to do this: -- !-- java org.apache.axis.client.AdminClient deploy.wsdd -- !-- after the axis server is running -- !-- or -- !-- java org.apache.axis.utils.Admin client|server deploy.wsdd -- !-- from the same directory that the Axis engine runs -- deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; !-- Services from BookFlightsService WSDL service -- service name=BookFlightsSOAPPort provider=java:RPC style=document use=literal parameter name=wsdlTargetNamespace value=http://ie/tcd/taylorjw/flightbooking/wsdl/ parameter name=wsdlServiceElement value=BookFlightsService/ parameter name=wsdlServicePort value=BookFlightsSOAPPort/ parameter name=className value=flightCompany.bookFlights.rpcservice.BookFlightsSOAPBindingImpl/ parameter name=wsdlPortType value=IBookFlightsPort/ operation name=bookFlights qname=bookFlights returnQName=retNS:bookFlightsResponse xmlns:retNS=http://ie.tcd/taylorjw/flightbooking; returnType=rtns:anyType xmlns:rtns=http://www.w3.org/2001/XMLSchema; soapAction=bookFlights parameter qname=pns:bookFlightsRequest xmlns:pns=http://ie.tcd/taylorjw/flightbooking; type=tns:anyType xmlns:tns=http://www.w3.org/2001/XMLSchema/ /operation parameter name=allowedMethods value=bookFlights/ parameter name=scope value=Session/ typeMapping xmlns:ns=http://ie.tcd/taylorjw/flightbooking; qname=ns:Flight type=java: flightCompany.bookFlights.rpcservice.Flight serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle= / typeMapping xmlns:ns=http://ie.tcd/taylorjw/flightbooking; qname=ns:Passenger type=java: flightCompany.bookFlights.rpcservice.Passenger serializer=org.apache.axis.encoding.ser.BeanSerializerFactory deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory encodingStyle= / typeMapping xmlns:ns=http://ie.tcd/taylorjw/flightbooking; qname=ns:Booking type=java
Re: import schema to wsdl
Fun, this XML stuff, isn't it. I bet we could play all day with elements and things :-) If you think XML has a serious purpose, then be more thoughtful. Anne's suggestion is right on the money. Perhaps James is teasing us with his! The flightList element serves no purpose. All data structures should be as concise as possible otherwise we wind up with useless baggage. As an aid to understanding the implications of schemas, you might want to write down sample instances. James' solution: bookFlightsResponse xmlns=http://ie.tcd/taylorjw/flightbooking; flightList flight flightNum123/flightNum sourceAirportLAX/sourceAirport destAirportYYK/destAirport flightDate1005-08-12/flightDate seatsAvailible31/seatsAvailible seatPrice$175.95/seatPrice numberOfSeatsToBook3/numberOfSeatsToBook bookingNumber456/bookingNumber informationCharter/information /flight flight flightNum321/flightNum sourceAirportLON/sourceAirport destAirportADH/destAirport flightDate1005-07-25/flightDate seatsAvailible17/seatsAvailible seatPrice$365.95/seatPrice numberOfSeatsToBook1/numberOfSeatsToBook bookingNumber789/bookingNumber information/information /flight /flightList /bookFlightsResponse Anne's solution: bookFlightsResponse xmlns=http://ie.tcd/taylorjw/flightbooking; bookedFlights flightNum123/flightNum sourceAirportLAX/sourceAirport destAirportYYK/destAirport flightDate1005-08-12/flightDate seatsAvailible31/seatsAvailible seatPrice$175.95/seatPrice numberOfSeatsToBook3/numberOfSeatsToBook bookingNumber456/bookingNumber informationCharter/information /bookedFlights bookedFlights flightNum321/flightNum sourceAirportLON/sourceAirport destAirportADH/destAirport flightDate1005-07-25/flightDate seatsAvailible17/seatsAvailible seatPrice$365.95/seatPrice numberOfSeatsToBook1/numberOfSeatsToBook bookingNumber789/bookingNumber information/information /bookedFlights /bookFlightsResponse Slight variations on your schema, James, could well justify the use of flightList but not as it stands. What was your question, BTW? :-) Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org; Jeff [EMAIL PROTECTED] Cc: axis-user@ws.apache.org; Anne Thomas Manes [EMAIL PROTECTED] Sent: Wednesday, June 08, 2005 8:41 PM Subject: Re: import schema to wsdl Ok well what I've done is add a flightList complexType to my external xsd that is like so xsd:complexType name=flightList xsd:sequence xsd:element name=flight type=fb:Flight minOccurs=0 maxOccurs=unbounded/ /xsd:sequence /xsd:complexType and referenced this as a return type for the message and wsdl2java has generated a class for this. xsd:element name=bookFlightsResponse xsd:sequence xsd:element name=flight type=fb:flightList/ /xsd:sequence /xsd:element Quoting Jeff [EMAIL PROTECTED]: That reminds me, I found that WSDL2Java doesn't support maxOccurs in sequence, e.g. xsd:element name=bookFlightsResponse xsd:sequence maxOccurs=unbounded xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element - Original Message - From: Anne Thomas Manes [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Wednesday, June 08, 2005 4:41 PM Subject: Re: import schema to wsdl James, This definition: xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element will return on Flight object. If you want to return an array of flight objects you should define it thus: xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight maxOccurs=unbounded/ /xsd:sequence /xsd:element Anne On 6/8/05, James Taylor [EMAIL PROTECTED] wrote: Hey anne, I've followed your advice by changing the method name in the portType to the same as in the message in the wsdl. But when I ran it through wsdl2java it produced the following dtd that says its doc-literal and the message signature in SoabBindingImp still says Object and return type Object. To get wrapped style do I have to change these manually? The exposed web service message should take a BookFlight object and return a list of booked flights. Just a question on the return type. In the xsd I have declare it as xsd:element name=bookFlightsResponse xsd:sequence xsd:element name = bookedFlights type=fb:Flight/ /xsd:sequence /xsd:element
Re: import schema to wsdl
James, If you want an interface that accepts parameters rather than an object, then you must define your WSDL so that it matches the wrapped convention. What that means is that your input message element name must be identical to your operation name. Currently your input message element name is bookFlightsRequest and your operation name is bookFlights. If you fix it so that they are the same, it should give you what you want. Anne On 6/6/05, Jeff [EMAIL PROTECTED] wrote: In general, I wouldn't let Axis provide a WSDL file. Tell it to use your WSDL file by adding a wsdlFile element to the WSDD file before you deploy so you wind up with something like: deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; wsdlFile/MyService.wsdl/wsdlFile service name=... Put MyService.wsdl in Tomcat\webapps\axis\WEB-INF\classes You will want to edit MyService.wsdl so that the endpoint near the end of the file is something that clients can connect instead of: http://localhost:9081/AxisWeb/services/BookFlightsSOAPPort Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Monday, June 06, 2005 5:02 AM Subject: Re: import schema to wsdl Thanks for your help jeff. The main problem was the conflicting target namespaces I was trying to import into my wsdl. I've gotten the wsdl2java tool to work fine now. Just a question on what will when the service gets deployed to axis. I presume axis will make a different wsdl then the one I gave to the tool as it has defined a method signature for the portType as public java.lang.Object bookFlights(java.lang.Object parameters) throws java.rmi.RemoteException; would any one mind commenting on this as I defined the method signature in the wsdl more specific then this... I know that I defined a custom collection bean that is of type object - I presume I'll cast the parameters to get at it. Regards, James. My wsdl and external schema... definitions targetNamespace=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:types=http://ie.tcd/taylorjw/flightbooking; types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://ie.tcd/taylorjw/flightbooking; xsd:import namespace = http://ie.tcd/taylorjw/flightbooking; schemaLocation=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types message name=bookFlightsReq part name=parameters element=types:bookFlightsRequest / /message message name=bookFlightsResp part name=parameters element=types:bookFlightsResponse / /message portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType binding name=BookFlightsSOAPBinding type=tns:IBookFlightsPort soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http; / operation name=bookFlights soap:operation style=document soapAction=bookFlights / input soap:body use=literal / /input output soap:body use=literal / /output /operation /binding service name=BookFlightsService port name=BookFlightsSOAPPort binding=tns:BookFlightsSOAPBinding soap:address location=http://localhost:9081/AxisWeb/services/BookFlightsSOAPPort; / /port /service /definitions !--BookFlights.xsd -- ?xml version=1.0 ? schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; targetNamespace = http://ie.tcd/taylorjw/flightbooking; xmlns:fb=http://ie.tcd/taylorjw/flightbooking; xsd:complexType name=Booking xsd:sequence xsd:element name=passenger type=fb:Passenger/ xsd:element name=flight type=fb:Flight minOccurs=0 maxOccurs=unbounded/ /xsd:sequence /xsd:complexType xsd:complexType name=Passenger xsd:sequence xsd:element name=passengerNum type=xsd:integer / xsd:element name=firstName type=xsd:string / xsd:element name=lastName type=xsd:string / xsd:element name=address type=xsd:string / /xsd:sequence /xsd:complexType xsd:complexType name=Flight xsd:sequence xsd:element name=flightNum type=xsd:integer / xsd:element name=sourceAirport type=xsd:string / xsd:element name=destAirport type=xsd:string / xsd:element name=flightDate type=xsd:string / xsd:element name=seatsAvailible type=xsd:integer / xsd:element name=seatPrice type=xsd:integer / xsd:element name=numberOfSeatsToBook type=xsd:string / xsd:element name=bookingNumber type=xsd:integer / xsd:element name=information type=xsd:string
Fwd: Re: import schema to wsdl
So I should just chang change types:bookFlightsRequest to types:bookFlights and reflect this in the external schema, will I have to change input message=tns:bookFlightsReq / input message=tns:bookFlights / also? ...heres the bit of the wsdl that would have to be changed... portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://ie.tcd/taylorjw/flightbooking; xsd:import namespace = http://ie.tcd/taylorjw/flightbooking; schemaLocation=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types message name=bookFlightsReq part name=parameters element=types:bookFlightsRequest / /message message name=bookFlightsResp part name=parameters element=types:bookFlightsResponse / /message portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType Quoting Anne Thomas Manes [EMAIL PROTECTED]: James, If you want an interface that accepts parameters rather than an object, then you must define your WSDL so that it matches the wrapped convention. What that means is that your input message element name must be identical to your operation name. Currently your input message element name is bookFlightsRequest and your operation name is bookFlights. If you fix it so that they are the same, it should give you what you want. Anne On 6/6/05, Jeff [EMAIL PROTECTED] wrote: In general, I wouldn't let Axis provide a WSDL file. Tell it to use your WSDL file by adding a wsdlFile element to the WSDD file before you deploy so you wind up with something like: deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; wsdlFile/MyService.wsdl/wsdlFile service name=... Put MyService.wsdl in Tomcat\webapps\axis\WEB-INF\classes You will want to edit MyService.wsdl so that the endpoint near the end of the file is something that clients can connect instead of: http://localhost:9081/AxisWeb/services/BookFlightsSOAPPort Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Monday, June 06, 2005 5:02 AM Subject: Re: import schema to wsdl Thanks for your help jeff. The main problem was the conflicting target namespaces I was trying to import into my wsdl. I've gotten the wsdl2java tool to work fine now. Just a question on what will when the service gets deployed to axis. I presume axis will make a different wsdl then the one I gave to the tool as it has defined a method signature for the portType as public java.lang.Object bookFlights(java.lang.Object parameters) throws java.rmi.RemoteException; would any one mind commenting on this as I defined the method signature in the wsdl more specific then this... I know that I defined a custom collection bean that is of type object - I presume I'll cast the parameters to get at it. Regards, James. My wsdl and external schema... definitions targetNamespace=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:types=http://ie.tcd/taylorjw/flightbooking; types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://ie.tcd/taylorjw/flightbooking; xsd:import namespace = http://ie.tcd/taylorjw/flightbooking; schemaLocation=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types message name=bookFlightsReq part name=parameters element=types:bookFlightsRequest / /message message name=bookFlightsResp part name=parameters element=types:bookFlightsResponse / /message portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType binding name=BookFlightsSOAPBinding type=tns:IBookFlightsPort soap:binding style=document transport=http://schemas.xmlsoap.org/soap/http; / operation name=bookFlights soap:operation style=document soapAction=bookFlights / input
RE: import schema to wsdl
You don't have to specify any other changes in wsdl or WSDL2Java script. Once you run WSDL2Java, check the **SOAPBindingImpl.java, the method should return correct return type (Flight). Kiran mailto:[EMAIL PROTECTED] From: James Taylor [mailto:[EMAIL PROTECTED] Sent: Mon 6/6/2005 3:17 PM To: axis-user@ws.apache.org Subject: Re: import schema to wsdl If I make the changes below will I have to specify anything else in the wsdl or in wsdl2java to get wrapped-literal style? Quoting James Taylor [EMAIL PROTECTED]: So I should just chang change types:bookFlightsRequest to types:bookFlights and reflect this in the external schema, will I have to change input message=tns:bookFlightsReq / input message=tns:bookFlights / also? ...heres the bit of the wsdl that would have to be changed... portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://ie.tcd/taylorjw/flightbooking; xsd:import namespace = http://ie.tcd/taylorjw/flightbooking; schemaLocation=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types message name=bookFlightsReq part name=parameters element=types:bookFlightsRequest / /message message name=bookFlightsResp part name=parameters element=types:bookFlightsResponse / /message portType name=IBookFlightsPort operation name=bookFlights input message=tns:bookFlightsReq / output message=tns:bookFlightsResp / /operation /portType Quoting Anne Thomas Manes [EMAIL PROTECTED]: James, If you want an interface that accepts parameters rather than an object, then you must define your WSDL so that it matches the wrapped convention. What that means is that your input message element name must be identical to your operation name. Currently your input message element name is bookFlightsRequest and your operation name is bookFlights. If you fix it so that they are the same, it should give you what you want. Anne On 6/6/05, Jeff [EMAIL PROTECTED] wrote: In general, I wouldn't let Axis provide a WSDL file. Tell it to use your WSDL file by adding a wsdlFile element to the WSDD file before you deploy so you wind up with something like: deployment xmlns=http://xml.apache.org/axis/wsdd/; xmlns:java=http://xml.apache.org/axis/wsdd/providers/java; wsdlFile/MyService.wsdl/wsdlFile service name=... Put MyService.wsdl in Tomcat\webapps\axis\WEB-INF\classes You will want to edit MyService.wsdl so that the endpoint near the end of the file is something that clients can connect instead of: http://localhost:9081/AxisWeb/services/BookFlightsSOAPPort Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Monday, June 06, 2005 5:02 AM Subject: Re: import schema to wsdl Thanks for your help jeff. The main problem was the conflicting target namespaces I was trying to import into my wsdl. I've gotten the wsdl2java tool to work fine now. Just a question on what will when the service gets deployed to axis. I presume axis will make a different wsdl then the one I gave to the tool as it has defined a method signature for the portType as public java.lang.Object bookFlights(java.lang.Object parameters) throws java.rmi.RemoteException; would any one mind commenting on this as I defined the method signature in the wsdl more specific then this... I know that I defined a custom collection bean that is of type object - I presume I'll cast the parameters to get at it. Regards, James. My wsdl and external schema... definitions targetNamespace=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://ie/tcd/taylorjw/flightbooking/wsdl; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:types=http://ie.tcd/taylorjw/flightbooking; types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://ie.tcd/taylorjw/flightbooking; xsd:import namespace = http://ie.tcd/taylorjw/flightbooking; schemaLocation=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types message
import schema to wsdl
Hey folks if one refers to a outside shema in a wsdl, like in this listing, types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://localhost:8080/axis/services/bookflights/wsdl/importtypes; xmlns:bf=http://localhost:8080/axis/services/bookflights/flightbooking; import namespace = http://localhost:8080/axis/services/bookflights/flightbooking; location = FlightBooking.xsd / import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types should the schema be in the same directory as the wsdl. I've this wsdl in /project/bookflights and the ant build file in /ant. I'm using axis's wsdl2java tool. Just wondering will ant and wsdl2java pick up FlightBooking.xsd. Also would appreciate it if anyone spotted any mistakes in this listing. Regards, James. -- Between the question and the answer lies free will
Re: import schema to wsdl
I'm getting this error and am not sure how to fix it wsdl2java: [echo] Using wsdl in WSDL2Java task... [java] WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_P REFIX: Unable to determine namespace of 'bf:bookFlightsRequest'.: running this ant task java classname=org.apache.axis.wsdl.WSDL2Java fork=yes failonerror=true classpath refid=projectClasspath / arg value = -o / arg file = ${pathToService} / arg value = -d / arg value = Session / arg value = -s / arg value = -N http://localhost:8080/axis/services/bookflights/flightbooking=${servicePackage}; / arg value = -N http://localhost:8080/axis/services/bookflights/wsdl=${servicePackage}; / arg file = ${pathToService}/bookFlights.wsdl / /java Quoting James Taylor [EMAIL PROTECTED]: Hey folks if one refers to a outside shema in a wsdl, like in this listing, types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://localhost:8080/axis/services/bookflights/wsdl/importtypes; xmlns:bf=http://localhost:8080/axis/services/bookflights/flightbooking; import namespace = http://localhost:8080/axis/services/bookflights/flightbooking; location = FlightBooking.xsd / import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types should the schema be in the same directory as the wsdl. I've this wsdl in /project/bookflights and the ant build file in /ant. I'm using axis's wsdl2java tool. Just wondering will ant and wsdl2java pick up FlightBooking.xsd. Also would appreciate it if anyone spotted any mistakes in this listing. Regards, James. -- Between the question and the answer lies free will -- Between the question and the answer lies free will
Re: import schema to wsdl
Presumably, bf:bookFlightsRequest is in FlightBooking.xsd so you would have to examine that file. This issue falls within the scope of application domain debugging and, as such, not a legitimate matter to raise on the Axis mail-list. Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, June 05, 2005 10:18 PM Subject: Re: import schema to wsdl I'm getting this error and am not sure how to fix it wsdl2java: [echo] Using wsdl in WSDL2Java task... [java] WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_P REFIX: Unable to determine namespace of 'bf:bookFlightsRequest'.: running this ant task java classname=org.apache.axis.wsdl.WSDL2Java fork=yes failonerror=true classpath refid=projectClasspath / arg value = -o / arg file = ${pathToService} / arg value = -d / arg value = Session / arg value = -s / arg value = -N http://localhost:8080/axis/services/bookflights/flightbooking=${servicePackage}; / arg value = -N http://localhost:8080/axis/services/bookflights/wsdl=${servicePackage}; / arg file = ${pathToService}/bookFlights.wsdl / /java Quoting James Taylor [EMAIL PROTECTED]: Hey folks if one refers to a outside shema in a wsdl, like in this listing, types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://localhost:8080/axis/services/bookflights/wsdl/importtypes; xmlns:bf=http://localhost:8080/axis/services/bookflights/flightbooking; import namespace = http://localhost:8080/axis/services/bookflights/flightbooking; location = FlightBooking.xsd / import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types should the schema be in the same directory as the wsdl. I've this wsdl in /project/bookflights and the ant build file in /ant. I'm using axis's wsdl2java tool. Just wondering will ant and wsdl2java pick up FlightBooking.xsd. Also would appreciate it if anyone spotted any mistakes in this listing. Regards, James. -- Between the question and the answer lies free will -- Between the question and the answer lies free will
Re: import schema to wsdl
Yes that's true to a point, but what I'm trying get help with is deploying a wsdl that references a external schema using axis' wsdl2java tool. Thats essentially what I'm trying to do. I'm not sure how to the wsdl2java tool will pick up the xsd file. This is the error i'm getting now [java] java.io.IOException: Element {http://localhost:8080/axis/services/bo okflights/types}bookFlightsRequest is referenced but not defined The bf:bookFlightsRequest is declared at the start of the wsdl like this definitions targetNamespace=http://localhost:8080/axis/services/bookflights/wsdl; xmlns=http://schemas.xmlsoap.org/wsdl/; xmlns:tns=http://localhost:8080/axis/services/bookflights/wsdl; xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/; xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/; xmlns:bf=http://localhost:8080/axis/services/bookflights/types; and imported in the types part like so types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://localhost:8080/axis/services/bookflights/wsdl/types; xsd:import namespace = http://localhost:8080/axis/services/bookflights; location=BookFlights.xsd/ xsd:import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types Quoting Jeff [EMAIL PROTECTED]: Presumably, bf:bookFlightsRequest is in FlightBooking.xsd so you would have to examine that file. This issue falls within the scope of application domain debugging and, as such, not a legitimate matter to raise on the Axis mail-list. Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, June 05, 2005 10:18 PM Subject: Re: import schema to wsdl I'm getting this error and am not sure how to fix it wsdl2java: [echo] Using wsdl in WSDL2Java task... [java] WSDLException (at /definitions/message[1]/part): faultCode=UNBOUND_P REFIX: Unable to determine namespace of 'bf:bookFlightsRequest'.: running this ant task java classname=org.apache.axis.wsdl.WSDL2Java fork=yes failonerror=true classpath refid=projectClasspath / arg value = -o / arg file = ${pathToService} / arg value = -d / arg value = Session / arg value = -s / arg value = -N http://localhost:8080/axis/services/bookflights/flightbooking=${servicePackage}; / arg value = -N http://localhost:8080/axis/services/bookflights/wsdl=${servicePackage}; / arg file = ${pathToService}/bookFlights.wsdl / /java Quoting James Taylor [EMAIL PROTECTED]: Hey folks if one refers to a outside shema in a wsdl, like in this listing, types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://localhost:8080/axis/services/bookflights/wsdl/importtypes; xmlns:bf=http://localhost:8080/axis/services/bookflights/flightbooking; import namespace = http://localhost:8080/axis/services/bookflights/flightbooking; location = FlightBooking.xsd / import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types should the schema be in the same directory as the wsdl. I've this wsdl in /project/bookflights and the ant build file in /ant. I'm using axis's wsdl2java tool. Just wondering will ant and wsdl2java pick up FlightBooking.xsd. Also would appreciate it if anyone spotted any mistakes in this listing. Regards, James. -- Between the question and the answer lies free will -- Between the question and the answer lies free will -- Between the question and the answer lies free will
Re: import schema to wsdl
Sure will give it a spin. I thought the uri's don't really matter as long as they are unique within the document?! Quoting Jeff [EMAIL PROTECTED]: URIs like: http://localhost:8080/axis/services/bookflights/wsdl/importtypes are not suitable for use as namespaces. Try something like: http://ie.tcd/taylorjw/bookflights instead. Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, June 05, 2005 8:48 PM Subject: import schema to wsdl Hey folks if one refers to a outside shema in a wsdl, like in this listing, types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://localhost:8080/axis/services/bookflights/wsdl/importtypes; xmlns:bf=http://localhost:8080/axis/services/bookflights/flightbooking; import namespace = http://localhost:8080/axis/services/bookflights/flightbooking; location = FlightBooking.xsd / import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types should the schema be in the same directory as the wsdl. I've this wsdl in /project/bookflights and the ant build file in /ant. I'm using axis's wsdl2java tool. Just wondering will ant and wsdl2java pick up FlightBooking.xsd. Also would appreciate it if anyone spotted any mistakes in this listing. Regards, James. -- Between the question and the answer lies free will -- Between the question and the answer lies free will
Re: import schema to wsdl
They don't really matter as long as they are unique within planet Earth. Why else do you think namespaces exist? - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Monday, June 06, 2005 1:10 AM Subject: Re: import schema to wsdl Sure will give it a spin. I thought the uri's don't really matter as long as they are unique within the document?! Quoting Jeff [EMAIL PROTECTED]: URIs like: http://localhost:8080/axis/services/bookflights/wsdl/importtypes are not suitable for use as namespaces. Try something like: http://ie.tcd/taylorjw/bookflights instead. Jeff - Original Message - From: James Taylor [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Sunday, June 05, 2005 8:48 PM Subject: import schema to wsdl Hey folks if one refers to a outside shema in a wsdl, like in this listing, types xsd:schema xmlns:xsd = http://www.w3.org/2001/XMLSchema; elementFormDefault = qualified targetNamespace = http://localhost:8080/axis/services/bookflights/wsdl/importtypes; xmlns:bf=http://localhost:8080/axis/services/bookflights/flightbooking; import namespace = http://localhost:8080/axis/services/bookflights/flightbooking; location = FlightBooking.xsd / import namespace = http://www.w3.org/2001/XMLSchema; / /xsd:schema /types should the schema be in the same directory as the wsdl. I've this wsdl in /project/bookflights and the ant build file in /ant. I'm using axis's wsdl2java tool. Just wondering will ant and wsdl2java pick up FlightBooking.xsd. Also would appreciate it if anyone spotted any mistakes in this listing. Regards, James. -- Between the question and the answer lies free will -- Between the question and the answer lies free will