Java WSDL创建解析错误

Java WSDL创建解析错误,java,soap,apache-camel,cxf,wsdl4j,Java,Soap,Apache Camel,Cxf,Wsdl4j,我试图公开soapweb服务。为此,我使用apachecamel。所以我必须使用ApacheCXF来公开SOAP web服务。但我的错误率越来越低 org.xml.sax.SAXParseException;行号:2;栏目号:223;这个 属性的值 “prefix=“xmlns”、localpart=“tns”、rawname=“xmlns:tns”无效。 带前缀的命名空间绑定不能为空 这是下面我已经编码的 @WebService(endpointInterface="com.ericsson.

我试图公开soapweb服务。为此,我使用apachecamel。所以我必须使用ApacheCXF来公开SOAP web服务。但我的错误率越来越低

org.xml.sax.SAXParseException;行号:2;栏目号:223;这个 属性的值 “prefix=“xmlns”、localpart=“tns”、rawname=“xmlns:tns”无效。 带前缀的命名空间绑定不能为空

这是下面我已经编码的

@WebService(endpointInterface="com.ericsson.fdp.SOAP.FulfillmentService", targetNamespace = "http://apache.org/hello_world_soap_http",portName="FulfillmentServicePort",serviceName="FulfillmentService")
public class FulfillmentServiceImpl implements FulfillmentService{


    @Produce(uri = "servlet:///fulfillmentService?servletName=FulfillmentService&matchOnUriPrefix=false")
    private ProducerTemplate template;

    @Override
    public FulfillmentResponse buyProduct(String input, String userName, String password, String msisdn, String iname) {

        Map<String,Object> queryMap = new HashMap<>();
        queryMap.put("input", input);
        queryMap.put("password", password);
        queryMap.put("msisdn", msisdn);
        queryMap.put("iname", iname);


        String response = (String) template.requestBodyAndHeaders(null, queryMap);
        FulfillmentResponse responseObject=null;
        try {
            responseObject = XmlUtil.unmarshall(response, FulfillmentResponse.class);
        } catch (JAXBException e) {
            e.printStackTrace();
        }
        return responseObject;
    }


}
我试着去登记。这是为上述代码创建的WSDL

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="fulfillmentService" targetNamespace="" xmlns:ns2="http://schemas.xmlsoap.org/soap/http" xmlns:ns1="http://apache.org/hello_world_soap_http" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
  <wsdl:import namespace="http://apache.org/hello_world_soap_http" location="fulfillmentService.wsdl">
    </wsdl:import>
  <wsdl:binding name="fulfillmentServiceSoapBinding" type="ns1:fulfillmentService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="buyProduct">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input name="buyProduct">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="buyProductResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="fulfillmentService">
    <wsdl:port name="fulfillmentServicePort" binding="fulfillmentServiceSoapBinding">
      <soap:address location="http://127.0.0.1:8980/cisBusiness/services/fulFillment"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


如何修复此错误?

尝试将相同的命名空间添加到以下内容

xmlns:tns="http://www.example.org" targetNamespace="http://www.example.org"
当然,你可以把“”改成你喜欢的

xmlns:tns="http://www.example.org" targetNamespace="http://www.example.org"