title: Implementing multiple services in a single Java app
body: <p>I have two WSDL files for different services. Both services work great independently, but if I include both services in the same eclipse project I get several instances of the following errors: </p>
  
  <pre><code>There's no ObjectFactory with an @XmlElementDecl for the element {http://schemas.foobar.com/oms/2010/10/Models}City.
      this problem is related to the following location:
          at protected javax.xml.bind.JAXBElement com.foobar.schemas.oms._2010._10.models.BusinessUnitData.city
          at com.foobar.schemas.oms._2010._10.models.BusinessUnitData
          at protected com.foobar.schemas.oms._2010._10.models.BusinessUnitData com.foobar.schemas.oms._2010._10.businessunit.CreateBusinessUnitRequest.businessUnitData
          at com.foobar.schemas.oms._2010._10.businessunit.CreateBusinessUnitRequest
          at @javax.xml.bind.annotation.XmlSeeAlso(value=[class com.foobar.schemas.oms._2010._10.businessunit.CreateBusinessUnitRequest])
          at public com.foobar.schemas.oms._2010._10.businessunit.CCreateBusinessUnitRequest com.foobar.schemas.oms._2010._10.businessunit.ObjectFactory.createCCreateBusinessUnitRequest()
          at com.foobar.schemas.oms._2010._10.businessunit.ObjectFactory
          at protected javax.xml.bind.JAXBElement com.foobar.schemas.oms._2010._10.businessunit.AddToStructureRequest.unitStructureData
          at com.foobar.schemas.oms._2010._10.businessunit.AddToStructureRequest
          at @javax.xml.bind.annotation.XmlSeeAlso(value=[class com.foobar.schemas.oms._2010._10.businessunit.AddToStructureRequest])
  There's no ObjectFactory with an @XmlElementDecl for the element {http://schemas.foobar.com/oms/2010/10/Models}ClientKey.
      this problem is related to the following location:
          at protected javax.xml.bind.JAXBElement com.foobar.schemas.oms._2010._10.models.BusinessUnitData.clientKey
          at com.foobar.schemas.oms._2010._10.models.BusinessUnitData
          at protected com.foobar.schemas.oms._2010._10.models.BusinessUnitData com.foobar.schemas.oms._2010._10.businessunit.CreateBusinessUnitRequest.businessUnitData
          at com.foobar.schemas.oms._2010._10.businessunit.CreateBusinessUnitRequest
          at @javax.xml.bind.annotation.XmlSeeAlso(value=[class com.foobar.schemas.oms._2010._10.businessunit.CreateBusinessUnitRequest])
          at public com.foobar.schemas.oms._2010._10.businessunit.CCreateBusinessUnitRequest com.foobar.schemas.oms._2010._10.businessunit.ObjectFactory.createCCreateBusinessUnitRequest()
          at com.foobar.schemas.oms._2010._10.businessunit.ObjectFactory
          at protected javax.xml.bind.JAXBElement com.foobar.schemas.oms._2010._10.businessunit.AddToStructureRequest.unitStructureData
          at com.foobar.schemas.oms._2010._10.businessunit.AddToStructureRequest
          at @javax.xml.bind.annotation.XmlSeeAlso(value=[class com.foobar.schemas.oms._2010._10.businessunit.AddToStructureRequest])
  </code></pre>
  
  <p>These errors completely fill my terminal window, so I don't know how many times this happens.</p>
  
  <p>I'm generating the stub code one of two ways. First I tried generating both with wsdl2java, then packing the compiled code into a jar and included that in my build path. I also tried creating a new maven project with the cxf code-gen plugin. Then I ran "mvn install" and included the generated code as a maven dependency. Both techniques produce the same results. Each service works fine on it's own. But if both are included in the project, I get the Object Factory errors.</p>
  
  <p>What causes this type of error? Can it be fixed with a jaxb binding file? If so, I'm new to webservices, and have been having trouble finding an example binding file to learn how to format it.</p>