WSDL client build not completed?

Just tried to generate Java client generation from WSDL file (using XFire, using XMLBeans binding)

I can create a client + error message (no errors), however, the input message and the output message were not generated, nor do they generate an operation in the client. Is there something wrong with my WSDL file, or is there something I missed?

Update:

  • I updated my XFire test project here .

  • I am starting to suspect that the problem may be rejected in the WSDL (because I can successfully generate another WSDL). I found these warnings that I feel about:

    WS-I: (BP2402) The wsdl: binding element does not use soapbind: the connecting element, as defined in "3 SOAP Binding". from the WSDL 1.1 specification.

    WS-I: (BP2032) Defective soapbind: fault element: the value of the "name" attribute does not match the value of the "name" attribute on the parent wsdl: fault element.

    WS-I: (AP2901) The description uses neither the MIME WSDL binding, as described in WSDL 1.1 Section 5, nor the WSDL SOAP binding, as described in WSDL 1.1 Section 3 for each of the output elements wsdl: input or wsdl: output wsdl: binding .

  • Just found that soap12 can cause a problem. If I changed xmlns: soap = "http://schemas.xmlsoap.org/wsdl/soap12/" to xmlns: soap = "http://schemas.xmlsoap.org/wsdl/soap/" and removing soapActionRequired in soap: an operation can successfully generate a client. But webservice is currently only in soap1.2. Therefore, changing wsdl to use soap1.1 is not the case here.

Here is my WSDL file:

<!--Created by TIBCO WSDL--> <wsdl:definitions xmlns:tns="http://schemas.ocbc.com/soa/WSDL/service/CBS-CustAccountInfo-I" xmlns:soap1="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:jndi="http://www.tibco.com/namespaces/ws/2004/soap/apis/jndi" xmlns:ns="http://schemas.ocbc.com/soa/emf/common/envelope/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:jms="http://www.tibco.com/namespaces/ws/2004/soap/binding/JMS" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="Untitled" targetNamespace="http://schemas.ocbc.com/soa/WSDL/service/CBS-CustAccountInfo-I"> <wsdl:types> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.ocbc.com/soa/emf/common/envelope/" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:include schemaLocation="../Schemas/XML/CBS-CustAccountInfo-I-ServiceEnvelope.xsd"/> </xs:schema> </wsdl:types> <wsdl:service name="CBS-CustAccountInfo-I"> <wsdl:port name="CBS-CustAccountInfo-I_HTTP" binding="tns:CBS-CustAccountInfo-I_HTTPBinding"> <soap:address location="https://localhost:15038/Services/CBS-CustAccountInfo-I/Processes/MainRequestResponse_HTTP"/> </wsdl:port> </wsdl:service> <wsdl:portType name="PortType"> <wsdl:operation name="CBS-CustAccountInfo-I"> <wsdl:input message="tns:InputMessage"/> <wsdl:output message="tns:OutputMessage"/> <wsdl:fault name="fault1" message="tns:FaultMessage"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="CBS-CustAccountInfo-I_HTTPBinding" type="tns:PortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="CBS-CustAccountInfo-I"> <soap:operation style="document" soapAction="/Services/CBS-CustAccountInfo-I/Processes/MainRequestResponse_HTTP" soapActionRequired="true"/> <wsdl:input> <soap:body use="literal" parts="InputMessage"/> </wsdl:input> <wsdl:output> <soap:body use="literal" parts="OutputMessage"/> </wsdl:output> <wsdl:fault name="fault1"> <soap:fault use="literal" name="fault1"/> </wsdl:fault> </wsdl:operation> </wsdl:binding> <wsdl:message name="InputMessage"> <wsdl:part name="InputMessage" element="ns:ServiceEnvelope"/> </wsdl:message> <wsdl:message name="OutputMessage"> <wsdl:part name="OutputMessage" element="ns:ServiceEnvelope"/> </wsdl:message> <wsdl:message name="FaultMessage"> <wsdl:part name="FaultMessage" element="ns:ServiceEnvelope"/> </wsdl:message> </wsdl:definitions> 

And here is my ant task to generate:

 <!-- Generating XML Beans --> <target name="gen-xmlbeans"> <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler" classpathref="build.classpath" fork="true"> <arg value="-out"/> <arg value="${basedir}/lib/ocbc.jar"/> <arg value="${schema.path}"/> </java> </target> <!-- Generating Client --> <target name="ws-generate"> <taskdef name="wsgen" classname="org.codehaus.xfire.gen.WsGenTask"> <classpath> <fileset dir="${lib.dir}" includes="*.jar" /> </classpath> </taskdef> <wsgen outputDirectory="${basedir}/src/" wsdl="${wsdl.path}" package="test.client" overwrite="true" binding="xmlbeans"/> </target> 

Generated Client:

 public class CBS_CustAccountInfo_IClient { private static XFireProxyFactory proxyFactory = new XFireProxyFactory(); private HashMap endpoints = new HashMap(); public CBS_CustAccountInfo_IClient() { } public Object getEndpoint(Endpoint endpoint) { try { return proxyFactory.create((endpoint).getBinding(), (endpoint).getUrl()); } catch (MalformedURLException e) { throw new XFireRuntimeException("Invalid URL", e); } } public Object getEndpoint(QName name) { Endpoint endpoint = ((Endpoint) endpoints.get((name))); if ((endpoint) == null) { throw new IllegalStateException("No such endpoint!"); } return getEndpoint((endpoint)); } public Collection getEndpoints() { return endpoints.values(); } } 
+4
source share
1 answer

@Rudy If you need to use XFire, you can try another binding, such as a JAXB binding, and see if you can generate the code correctly.

+1
source

All Articles