Hi Martin,

I didn't get your case: is this WSDL was generated? Do you use WSDL-first or 
Java-first approach?

Reference on complex types seems to be corrupted in WSDL:
<xs:element name=&quot;shipTo&quot; type=&quot;&lt;b>USAddress*"/>

Cheers,
Andrei.

> -----Original Message-----
> From: martin [mailto:[email protected]]
> Sent: Dienstag, 27. November 2012 14:23
> To: [email protected]
> Subject: Malformed WSDL seems to be missing namespace references
> 
> I have run into something that i am not sure how to handle.
> I have a hello-world complexity service that is built on a number of XJC
> compiled classes.
> My problem is that the WSDL seems to malformed. The references to the
> complextypes in the wsdl are not receiving namespace references. It is not
> only preventing soapui and the CXF client code from calling the service, but 
> it
> is also giving some errors on tomcat so i can't undeploy save for stopping the
> service and deleting the war manually. I have tried exchanging my 2.7.0 files
> with the 2.6.3 release but to no avail.
> 
> Am i doing something horribly horribly wrong here? And what?
> 
> I have included the WSDL and a few classes of interest below. The WSDL is
> marked in bold where the problem spots are.
> 
> ---------------------------------------------------------------
> <?xml version='1.0' encoding='UTF-8'?><wsdl:definitions
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:tns="http://test.org/test";
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:ns1="http://schemas.xmlsoap.org/soap/http"; name="SaveObject"
> targetNamespace="http://test.org/test";>
>   <wsdl:types>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:tns="http://test.org/test"; attributeFormDefault="unqualified"
> elementFormDefault="unqualified"
> targetNamespace="http://test.org/test";>
>   <xs:import namespace="http://test.org/test"/>
>   <xs:element name="SavePurchaseOrderType"
> type="tns:SavePurchaseOrderType"/>
>   <xs:element name="SavePurchaseOrderTypeResponse"
> type="tns:SavePurchaseOrderTypeResponse"/>
>   <xs:complexType name="SavePurchaseOrderType">
>     <xs:sequence>
>       <xs:element minOccurs="0" name="arg0" type="PurchaseOrderType"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:complexType name="SavePurchaseOrderTypeResponse">
>     <xs:sequence>
>       <xs:element minOccurs="0" name="return" type="xs:string"/>
>     </xs:sequence>
>   </xs:complexType>
>   <xs:element name="Exception" type="tns:Exception"/>
>   <xs:complexType name="Exception">
>     <xs:sequence>
>       <xs:element minOccurs="0" name="message" type="xs:string"/>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> targetNamespace="http://test.org/test"; version="1.0"> <xs:element
> name="comment" type="xs:string"/> <xs:element
> name=&quot;purchaseOrder&quot;
> type=&quot;&lt;b>PurchaseOrderType*"/>
> <xs:complexType name="PurchaseOrderType">
>     <xs:sequence>
>       <xs:element name=&quot;shipTo&quot;
> type=&quot;&lt;b>USAddress*"/>
>       <xs:element name=&quot;billTo&quot;
> type=&quot;&lt;b>USAddress*"/>
>       <xs:element minOccurs="0" name="comment" type="xs:string"/>
>       <xs:element name=&quot;items&quot; type=&quot;&lt;b>Items*"/>
>     </xs:sequence>
>     <xs:attribute name="orderDate" type="xs:date"/>
>   </xs:complexType>
> <xs:complexType name="USAddress">
>     <xs:sequence>
>       <xs:element name="name" type="xs:string"/>
>       <xs:element name="street" type="xs:string"/>
>       <xs:element name="city" type="xs:string"/>
>       <xs:element name="state" type="xs:string"/>
>       <xs:element name="zip" type="xs:decimal"/>
>     </xs:sequence>
>     <xs:attribute name="country" type="xs:NMTOKEN"/>
>   </xs:complexType>
> <xs:complexType name="Items">
>     <xs:sequence>
>       <xs:element maxOccurs="unbounded" name="item">
>         <xs:complexType>
>           <xs:sequence>
>             <xs:element name="productName" type="xs:string"/>
>             <xs:element name="quantity" type="xs:int"/>
>             <xs:element name="USPrice" type="xs:decimal"/>
>             <xs:element minOccurs="0" name="comment" type="xs:string"/>
>             <xs:element minOccurs="0" name="shipDate" type="xs:date"/>
>           </xs:sequence>
>           <xs:attribute name="partNum" type="xs:string" use="required"/>
>         </xs:complexType>
>       </xs:element>
>     </xs:sequence>
>   </xs:complexType>
> </xs:schema>
>   </wsdl:types>
>   <wsdl:message name="Exception">
>     <wsdl:part element="tns:Exception" name="Exception">
>     </wsdl:part>
>   </wsdl:message>
>   <wsdl:message name="SavePurchaseOrderType">
>     <wsdl:part element="tns:SavePurchaseOrderType" name="parameters">
>     </wsdl:part>
>   </wsdl:message>
>   <wsdl:message name="SavePurchaseOrderTypeResponse">
>     <wsdl:part element="tns:SavePurchaseOrderTypeResponse"
> name="parameters">
>     </wsdl:part>
>   </wsdl:message>
>   <wsdl:portType name="CreateObjectSEI">
>     <wsdl:operation name="SavePurchaseOrderType">
>       <wsdl:input message="tns:SavePurchaseOrderType"
> name="SavePurchaseOrderType">
>     </wsdl:input>
>       <wsdl:output message="tns:SavePurchaseOrderTypeResponse"
> name="SavePurchaseOrderTypeResponse">
>     </wsdl:output>
>       <wsdl:fault message="tns:Exception" name="Exception">
>     </wsdl:fault>
>     </wsdl:operation>
>   </wsdl:portType>
>   <wsdl:binding name="SaveObjectSoapBinding"
> type="tns:CreateObjectSEI">
>     <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="SavePurchaseOrderType">
>       <soap:operation soapAction="" style="document"/>
>       <wsdl:input name="SavePurchaseOrderType">
>         <soap:body use="literal"/>
>       </wsdl:input>
>       <wsdl:output name="SavePurchaseOrderTypeResponse">
>         <soap:body use="literal"/>
>       </wsdl:output>
>       <wsdl:fault name="Exception">
>         <soap:fault name="Exception" use="literal"/>
>       </wsdl:fault>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="SaveObject">
>     <wsdl:port binding="tns:SaveObjectSoapBinding"
> name="CreateObjectSEIPort">
>       <soap:address
> location="http://localhost:8080/HyperJaxBPoC/services/create"/>
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
> 
> ---------------------------------------------------------------
> The Service SEI and implementation
> ---------------------------------------------------------------
> package service.SEI;
> 
> import javax.jws.WebService;
> import service.objects.PurchaseOrderType;
> 
> @WebService(serviceName = "SaveObject",
> targetNamespace = "http://test.org/test";) public interface CreateObjectSEI {
> 
>       public String SavePurchaseOrderType(PurchaseOrderType type)
> throws Exception;
> 
> }
> ---------------------------------------------------------------
> package service;
> 
> import java.io.StringWriter;
> import javax.jws.WebService;
> import javax.xml.bind.JAXBContext;
> import javax.xml.bind.Marshaller;
> import service.SEI.CreateObjectSEI;
> import service.objects.*;
> 
> @WebService(endpointInterface="service.SEI.CreateObjectSEI",
> targetNamespace="http://cxf.apache.org";,
> portName="CreateObjectSimplePort"
> )
> public class CreateObjectSimple implements CreateObjectSEI{
> 
>       public String SavePurchaseOrderType(PurchaseOrderType type)
> throws Exception {
>               JAXBContext jc = JAXBContext.newInstance(
> "service.objects" );
>               Marshaller m = jc.createMarshaller();
>         m.setProperty( Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE );
>         StringWriter writer = new StringWriter();
>         m.marshal( type, writer );
>         return writer.toString();
>       }
> 
> }
> ---------------------------------------------------------------
> One of the XJC generated classes. They all look alike.
> ---------------------------------------------------------------
> package service.objects;
> 
> import java.math.BigDecimal;
> import javax.xml.bind.annotation.XmlAccessType;
> import javax.xml.bind.annotation.XmlAccessorType;
> import javax.xml.bind.annotation.XmlAttribute;
> import javax.xml.bind.annotation.XmlElement;
> import javax.xml.bind.annotation.XmlSchemaType;
> import javax.xml.bind.annotation.XmlType;
> import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
> import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
> 
> 
> /**
>  * <p>Java class for USAddress complex type.
>  *
>  * <p>The following schema fragment specifies the expected content
> contained within this class.
>  *
>  * <pre>
>  * &lt;complexType name="USAddress">
>  *   &lt;complexContent>
>  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType";>
>  *       &lt;sequence>
>  *         &lt;element name="name"
> type="{http://www.w3.org/2001/XMLSchema}string"/>
>  *         &lt;element name="street"
> type="{http://www.w3.org/2001/XMLSchema}string"/>
>  *         &lt;element name="city"
> type="{http://www.w3.org/2001/XMLSchema}string"/>
>  *         &lt;element name="state"
> type="{http://www.w3.org/2001/XMLSchema}string"/>
>  *         &lt;element name="zip"
> type="{http://www.w3.org/2001/XMLSchema}decimal"/>
>  *       &lt;/sequence>
>  *       &lt;attribute name="country"
> type="{http://www.w3.org/2001/XMLSchema}NMTOKEN"; fixed="US" />
>  *     &lt;/restriction>
>  *   &lt;/complexContent>
>  * &lt;/complexType>
>  * </pre>
>  *
>  *
>  */
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "USAddress", propOrder = {
>     "name",
>     "street",
>     "city",
>     "state",
>     "zip"
> })
> public class USAddress {
> 
>     @XmlElement(required = true)
>     protected String name;
>     @XmlElement(required = true)
>     protected String street;
>     @XmlElement(required = true)
>     protected String city;
>     @XmlElement(required = true)
>     protected String state;
>     @XmlElement(required = true)
>     protected BigDecimal zip;
>     @XmlAttribute(name = "country")
>     @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
>     @XmlSchemaType(name = "NMTOKEN")
>     protected String country;
> 
>     /**
>      * Gets the value of the name property.
>      *
>      * @return
>      *     possible object is
>      *     {@link String }
>      *
>      */
>     public String getName() {
>         return name;
>     }
> 
>     /**
>      * Sets the value of the name property.
>      *
>      * @param value
>      *     allowed object is
>      *     {@link String }
>      *
>      */
>     public void setName(String value) {
>         this.name = value;
>     }
> 
>     /**
>      * Gets the value of the street property.
>      *
>      * @return
>      *     possible object is
>      *     {@link String }
>      *
>      */
>     public String getStreet() {
>         return street;
>     }
> 
>     /**
>      * Sets the value of the street property.
>      *
>      * @param value
>      *     allowed object is
>      *     {@link String }
>      *
>      */
>     public void setStreet(String value) {
>         this.street = value;
>     }
> 
>     /**
>      * Gets the value of the city property.
>      *
>      * @return
>      *     possible object is
>      *     {@link String }
>      *
>      */
>     public String getCity() {
>         return city;
>     }
> 
>     /**
>      * Sets the value of the city property.
>      *
>      * @param value
>      *     allowed object is
>      *     {@link String }
>      *
>      */
>     public void setCity(String value) {
>         this.city = value;
>     }
> 
>     /**
>      * Gets the value of the state property.
>      *
>      * @return
>      *     possible object is
>      *     {@link String }
>      *
>      */
>     public String getState() {
>         return state;
>     }
> 
>     /**
>      * Sets the value of the state property.
>      *
>      * @param value
>      *     allowed object is
>      *     {@link String }
>      *
>      */
>     public void setState(String value) {
>         this.state = value;
>     }
> 
>     /**
>      * Gets the value of the zip property.
>      *
>      * @return
>      *     possible object is
>      *     {@link BigDecimal }
>      *
>      */
>     public BigDecimal getZip() {
>         return zip;
>     }
> 
>     /**
>      * Sets the value of the zip property.
>      *
>      * @param value
>      *     allowed object is
>      *     {@link BigDecimal }
>      *
>      */
>     public void setZip(BigDecimal value) {
>         this.zip = value;
>     }
> 
>     /**
>      * Gets the value of the country property.
>      *
>      * @return
>      *     possible object is
>      *     {@link String }
>      *
>      */
>     public String getCountry() {
>         if (country == null) {
>             return "US";
>         } else {
>             return country;
>         }
>     }
> 
>     /**
>      * Sets the value of the country property.
>      *
>      * @param value
>      *     allowed object is
>      *     {@link String }
>      *
>      */
>     public void setCountry(String value) {
>         this.country = value;
>     }
> 
> }
> ---------------------------------------------------------------
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Malformed-
> WSDL-seems-to-be-missing-namespace-references-tp5719206.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to