我试过在网上寻找问题,但我找不到灵魂。
我有一个wsdl文件。
此wsdl文件定义了2个xsd:schema。
其中一个xsd:schema正在另一个中导入。
<?xml version='1.0' encoding='UTF-8'?>
<wsdl:definitions name="identityService"
targetNamespace="http://ws.identityService.bls.risk.dummy.com/"
xmlns:ns1="http://cxf.apache.org/bindings/xformat" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://ws.identityService.bls.risk.dummy.com/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema attributeFormDefault="qualified"
elementFormDefault="qualified" targetNamespace="http://ns.dummy.com/identity-service/1.0"
version="9.0" xmlns:identity="http://ns.dummy.com/identity-service/1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
</xsd:schema>
<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="unqualified"
targetNamespace="http://ws.identityService.bls.risk.dummy.com/"
xmlns:ns0="http://ns.dummy.com/identity-service/1.0" xmlns:tns="http://ws.identityService.bls.risk.dummy.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://ns.dummy.com/identity-service/1.0" />
<xsd:element name="invokeIdentityService" type="tns:invokeIdentityService" />
</xsd:schema>
</wsdl:types>
<wsdl:message name="invokeIdentityServiceResponse">
<wsdl:part element="tns:invokeIdentityServiceResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="invokeIdentityService">
<wsdl:part element="tns:invokeIdentityService" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="IdentityServiceWS">
<wsdl:operation name="invokeIdentityService">
<wsdl:input message="tns:invokeIdentityService" name="invokeIdentityService">
</wsdl:input>
<wsdl:output message="tns:invokeIdentityServiceResponse"
name="invokeIdentityServiceResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="identityServiceSoapBinding" type="tns:IdentityServiceWS">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="invokeIdentityService">
<soap:operation soapAction="" style="document" />
<wsdl:input name="invokeIdentityService">
<soap:body use="literal" />
</wsdl:input>
<wsdl:output name="invokeIdentityServiceResponse">
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="identityService">
<wsdl:port binding="tns:identityServiceSoapBinding" name="IdentityServiceWSImplPort">
<soap:address
location="https://staging.identitymanagement.dummy.com/identity- service/services/identityServiceWS" />
</wsdl:port>
</wsdl:service>
我成功地生成了存根,并且在调用服务时,我得到以下错误。
org.apache.axis2.AxisFault: Unbound namespace URI 'http://ns.dummy.com/identity-service/1.0'
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)
at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84)
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
我如何解决这个问题。
给出的wsdl是第三方wsdl文件。
提前致谢。