> I have the following two schemas and sample xml file which I have
> validated with Xerxes SAX.  Castor creates the code fine, but when I try
> to unmarshall the soapTester.Binding object, and it gets to the
> soap:binding element, it trys to call soapTester.Binding methods as
> opposed to soap.Binding methods.  I appreciate any advice.  The error
> messages are at the end of this posting.
> 
> THIS IS THE PARENT SCHEMA THAT IS COMPILED INTO PACKAGE SOAPTESTER
> <schema xmlns="http://www.w3.org/2001/XMLSchema"; 
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
>         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
>       xmlns:mine="http://myNamespace";
>       xmlns:soap="http://mySpace";
>       >
> 
>     <import namespace="http://mySpace"; schemaLocation="soap-a.xsd"/>
>     <element name="binding">
>     <complexType >
>           <sequence>
>     
>     <element name="operation">
>     <complexType  >
>       <sequence>
>          <element name="input" type="xsd:string"/>
>          <element name="output" type="xsd:string"/>
>          <element ref="soap:binding" />
>       </sequence>
>       <attribute name="name" type="xsd:string" use="required"/>
>     </complexType>
>     </element>
> 
>           </sequence>
>           <attribute name="name" type="xsd:string" use="required"/>
>           <attribute name="type" type="xsd:QName" use="required"/>
>     </complexType>
>     </element>
> 
> </schema>
> 
> 
> THIS IS THE CHILD SCHEMA THAT IS COMPILED INTO THE SOAP PACKAGE.
> <?xml version="1.0" encoding="UTF-8" ?> 
> 
> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema";
>         xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
>         xmlns:soap="http://mySpace";
>         targetNamespace="http://mySpace";
>       >
> 
>     <xsd:element name="binding" type="soap:bindingType"/>
>     <xsd:complexType name="bindingType">
>       <xsd:attribute name="transport" type="xsd:string" use="optional"/>
>       <xsd:attribute name="style" type="xsd:string" use="optional"/>
>     </xsd:complexType>
> 
>     <xsd:simpleType name="styleChoice">
>       <xsd:restriction base="xsd:string">
>           <xsd:enumeration value="rpc"/>
>           <xsd:enumeration value="document"/>
>       </xsd:restriction>
>     </xsd:simpleType>
> </xsd:schema>
> 
> <?xml version="1.0"?>
> <binding name="bind1" type="someType"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>         xmlns:soap="http://mySpace";
>          xsi:noNamespaceSchemaLocation='soap.xsd'>
> 
>     <operation name="GetTradePrice">
>       <input> "hello" </input>
>       <output> "world" </output>
>       <soap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"; />
>     </operation>
> </binding>
> 
> binding is missing required attribute: name
>   - line: 9 column: 79
> org.xml.sax.SAXException: binding is missing required attribute: name
>   - line: 9 column: 79
>         at
> org.exolab.castor.xml.UnmarshalHandler.processAttribute(UnmarshalHandler.j
> ava:1231)
>         at
> org.exolab.castor.xml.UnmarshalHandler.processAttributes(UnmarshalHandler.
> java:1162)
>         at
> org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:
> 1041)
>         at
> org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1340)
>         at
> org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValid
> ator.java:1191)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScan
> ner.java:1864)
>         at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(
> XMLDocumentScanner.java:1240)
>         at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanne
> r.java:381)
>         at
> org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:338)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:270)
>         at
> org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:391)
>         at soapTester.Binding.unmarshal(Binding.java:143)
>         at soapTest.main(soapTest.java:35)
> 
> Thanks,
> Patrick Armstrong
> Wells Fargo Bank
> 
> 
> 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to