Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java <;soap:地址>;使用Netbeans New时的位置属性->;使用XMLSpy从WSDL创建Web服务_Java_Web Services_Netbeans_Wsdl_Xmlspy - Fatal编程技术网

Java <;soap:地址>;使用Netbeans New时的位置属性->;使用XMLSpy从WSDL创建Web服务

Java <;soap:地址>;使用Netbeans New时的位置属性->;使用XMLSpy从WSDL创建Web服务,java,web-services,netbeans,wsdl,xmlspy,Java,Web Services,Netbeans,Wsdl,Xmlspy,我正在尝试使用Netbeans 7.1.2中WSDL中的New->Web服务创建一个Web服务 我继续使用XMLSpy创建了一个WSDL。以下是我创建的基本WSDL: <wsdl:definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns

我正在尝试使用Netbeans 7.1.2中WSDL中的New->Web服务创建一个Web服务

我继续使用XMLSpy创建了一个WSDL。以下是我创建的基本WSDL:

<wsdl:definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
xmlns:wsp="http://www.w3.org/ns/ws-policy" 
xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:tns="http://planningservice.ohs.com/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://docs.oasis-open.org/wsn/t-1" xmlns:ns1="http://www.isotc211.org/2005/gco" xmlns:ns2="http://www.isotc211.org/2005/gmd" xmlns:ns3="http://www.isotc211.org/2005/gsr" xmlns:ns4="http://www.isotc211.org/2005/gss" xmlns:ns5="http://www.isotc211.org/2005/gts" xmlns:ns6="http://www.opengis.net/gml/3.2" xmlns:ns7="http://www.opengis.net/ows/1.1" xmlns:ns8="http://www.opengis.net/sps/2.0" xmlns:ns9="http://www.opengis.net/swe/2.0" xmlns:ns10="http://www.opengis.net/swes/2.0" xmlns:ns11="http://www.w3.org/2005/08/addressing" name="PlanningService" targetNamespace="http://planningservice.ohs.com/">
<wsdl:import namespace="http://www.opengis.net/sps/2.0" location="http://schemas.opengis.net/sps/2.0/spsGetFeasibility.xsd"/>
<wsdl:types>
    <xsd:schema>
        <xsd:import namespace="http://ps.ca"/>
    </xsd:schema>
</wsdl:types>
<wsdl:message name="GetFeasibility">
    <wsdl:part name="parameters" type="ns8:GetFeasibilityType"/>
</wsdl:message>
<wsdl:message name="GetFeasibilityResponse">
    <wsdl:part name="parameters" type="ns8:GetFeasibilityResponseType"/>
</wsdl:message>
<wsdl:portType name="PlanningService">
    <wsdl:operation name="GetFeasibility">
        <wsdl:input message="tns:GetFeasibility" wsam:Action="http://planningservice.ohs.com/PlanningService/getFeasibility"/>
        <wsdl:output message="tns:GetFeasibilityResponse" wsam:Action="http://planningservice.ohs.com/PlanningService/getFeasibilityResponse"/>
    </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PlanningSerivcePortBinding" type="tns:PlanningService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="GetFeasibility">
        <soap:operation soapAction="' '"/>
        <wsdl:input>
            <soap:body use="literal"/>
        </wsdl:input>
        <wsdl:output>
            <soap:body use="literal"/>
        </wsdl:output>
    </wsdl:operation>
</wsdl:binding>
<wsdl:service name="PlanningSerivce">
    <wsdl:port name="PlanningService" binding="tns:PlanningSerivcePortBinding">
        <soap:address location="http://localhost:8080/PlanningService/"/>
    </wsdl:port>
</wsdl:service>

当我尝试使用上述方法时,“来自WSDL的新Web服务”向导会说“在指定的WSDL文件中没有服务”

如果不指定location属性,如下所示:

<wsdl:service name="PlanningSerivce">
    <wsdl:port name="PlanningService" binding="tns:PlanningSerivcePortBinding">
        <soap:address/>
    </wsdl:port>
</wsdl:service>

我没有那个通知,但是在创建Web服务的过程中,我得到一个错误,说属性丢失了

所以我的问题是,如果服务没有部署到任何地方,我应该在location属性中添加什么来让Netbeans识别有一个已定义的服务

谢谢大家


~D

提供的WSDL文档并非完全有效

第一个问题是文档样式的声明,但是rpc样式中的消息声明。Rpc使用根据“类型”定义的消息部分。文档使用根据“元素”定义的消息部分。我查看了导入到WSDL中的XSD,找到了其中定义的“GetOxiability”和“GetOxiabilityResponse”元素。因此,将wsdl:message节点更改为

  <wsdl:message name="GetFeasibility">
    <wsdl:part name="parameters" element="ns8:GetFeasibility"/>
  </wsdl:message>
  <wsdl:message name="GetFeasibilityResponse">
    <wsdl:part name="parameters" element="ns8:GetFeasibilityResponse"/>
  </wsdl:message>

通过使消息定义与文档样式服务保持一致来提供帮助。 关于wsdl构造w.r.t.声明的样式,有一篇很好的文章

下一个问题是模式导入。关于wsdl:import语句有一些特殊的限制。通常,拉入模式的合适位置是wsdl:types部分。如果你使用类似

  <wsdl:types>
    <xsd:schema>
      <xsd:import namespace="http://www.opengis.net/sps/2.0" 
      schemaLocation="http://schemas.opengis.net/sps/2.0/spsGetFeasibility.xsd"/>
      <xsd:import namespace="http://ps.ca"/>
    </xsd:schema>
  </wsdl:types>

(不确定ps.ca导入的值),相关类型可用于wsdl导入机制。wsdl导入的writeup位于


一旦进行了这些修改,wsimport仍然在opengis.net的支持模式中看到了名称冲突的错误,但希望这能让您有足够的时间推动我们的项目,您可以专注于名称冲突,而不是与wsdl结构对抗。

是,使用您的更改后,我能够解决命名冲突。