Sorry, this is long. I'm new to Java web services, and have been moving through examples on the web to create a Java client to a pair of WCF services hosted by a vendor application. I am able to create the client for each separately, but when I try and put them together, the second service bindings overwrite the first. I'm pretty sure it's the ObjectFactory class that's getting overwritten.
I'm using Metro (not installed in eclipse) and the following ant build in exclipse.
build.xml:
<project default="wsimport">
<target name="wsimport">
<exec executable="C:/Metro/bin/wsimport.bat">
<arg line="-keep -s ../src -d ../bin -extension -Xnocompile -XadditionalHeaders -b ../build/wcf.jaxb -B-XautoNameResolution http://my.host.name/ptsqamt/Maintain/services/reports/2010/09/ReportServices.svc?singleWSDL"/>
</exec>
<exec executable="C:/Metro/bin/wsimport.bat">
<arg line="-keep -s ../src -d ../bin -extension -Xnocompile -XadditionalHeaders -b ../build/wcf.jaxb -B-XautoNameResolution http://my.host.name/ptsqamt/Maintain/services/reports/2010/09/ReportFileService.svc?singleWSDL"/>
</exec>
</target>
</project>
Connecting to the ReportFileService works, but when I connect to the ReportServices service, I get the following exception:
Exception in thread "main" javax.xml.ws.WebServiceException: {http://tempuri.org/}ReportServices is not a valid service. Valid services are: {http://tempuri.org/}ReportFileService
I have tried to put the build's in separate packages, which works, but I get a similar issue at runtime.
I have looked at various threads, to either change the target name space from http://tempuri.org/ to something else, or change the ObjectFactory class name to something custom.
I have this inline code (found here), but I don't know how to use it / change it to an external file.
<xsd:complexType name="ObjectFactory">
<xsd:annotation>
<xsd:appinfo>
<jxb:class name="ReportServicesObjectFactory" />
</xsd:appinfo>
</xsd:annotation>
</xsd:complexType>
Can anyone help on how I can resolve this.