Any chance you can save the WSDL/XSDs to your local machine and point to
those during the *wsdl2Java *invocation. Typically, we place those into
the /META-INF/wsdl folder of the project FIRST, and then generate from
there using the *wsdlLocation *attribute during the generation:
For Ant scripting (there are also equivalents in Maven as well but we are
not fully "Mavenized" yet). The ${ws.endpointName} below is only relevant
for our build because we are looping through a series of WSDL files but you
can simply replace this with a value that points to your actual filename.
<!-- JAX-WS task definitions for CXF -->
<target name="cxfWSDLToJava" depends="init, copy-wsdl-local">
<java classname="org.apache.cxf.tools.wsdlto.WSDLToJava"
fork="true">
<arg value="-wsdlLocation" />
<arg value="/META-INF/wsdl/${ws.endpointName}.wsdl" />
<arg value="-d" />
<arg value="${src}" />
<arg value="-client" />
<arg value="-verbose" />
<arg value="${src}/META-INF/wsdl/${ws.endpointName}.wsdl" />
<classpath>
<path refid="cxf.classpath" />
<path refid="project.classpath" />
</classpath>
</java>
</target>
You also need to make sure that IF you use a local copy of the WSDL, you
will have to insure that *if there are imported XSDs specified in the WSD*L,
that you make sure that the URLs are changed such that they are ALSO
referenced from the location where the WSDL is:
/META-INF/wsdl/ should contain the WSDL and the XSDs and the imports if
there are any might look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="BookOrderManagerService"
targetNamespace="http://webservices.book.acme.com/" xmlns:ns1="
http://util.book.acme.com/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="
http://webservices.book.acme.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://webservices.book.acme.com/"
schemaLocation="BookOrderManagerService_schema1.xsd" />
<import namespace="http://util.book.acme.com/"
schemaLocation="BookOrderManagerService_schema2.xsd" />
<import namespace="http://dvo.services.book.acme.com/"
schemaLocation="BookOrderManagerService_schema3.xsd" />
</schema>
</wsdl:types>
...
....
.....
On Mon, Jul 16, 2012 at 10:19 AM, Ganesh <[email protected]> wrote:
> Hi Mark,
>
> Thanks for Reply..
>
> It's exactly similar to localizing WSDL/XSD. We have a third party WSDL/XSD
> and we need to develop Mock service for our development testing.
>
> I understood the packaging WSDL locally from your above link. But while
> generating artifacts itself we are getting the error. So not able to
> proceed
> further.
>
> Regards,
> Ganesh.
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/WSDLException-faultCode-PARSER-ERROR-Connection-reset-tp5711085p5711108.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
*HTH
Mark
*