gpt4 book ai didi

java - wsimport 忘记了一个代理类

转载 作者:行者123 更新时间:2023-11-30 11:51:42 27 4
gpt4 key购买 nike

我使用 wsimport 从 WSDL 文件生成代理类。生成了 A 类,但是对应于 A 的构造函数参数的 B 类却没有。这可能是什么原因?谢谢。

这是 WSDL:

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.4-b01-. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://project-project.org/ref" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://project-project.org/ref" name="MyName">
<types>
<xsd:schema>
<xsd:import namespace="http://purl.org/dc/terms/" schemaLocation="http://X.X.X.X:8080/myName/MyName?xsd=1" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://project-project.org/ref/tools" schemaLocation="http://X.X.X.X:8080/myName/MyName?xsd=2" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://project-project.org/ref/datatypes" schemaLocation="http://X.X.X.X:8080/myName/MyName?xsd=3" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://project-project.org/ref/ProjectService" schemaLocation="http://X.X.X.X:8080/myName/MyName?xsd=4" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://project-project.org/ref/MyName" schemaLocation="http://X.X.X.X:8080/myName/MyName?xsd=5" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://project-project.org/ref" schemaLocation="http://X.X.X.X:8080/myName/MyName?xsd=6" />
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://project-project.org/objects" schemaLocation="http://X.X.X.X:8080/myName/MyName?xsd=7" />
</xsd:schema>
</types>
<message name="MyName">
<part name="parameters" element="tns:MyName" />
</message>
<message name="MyNameResponse">
<part name="parameters" element="tns:MyNameResponse" />
</message>
<message name="ProjectServicePull">
<part name="parameters" element="tns:ProjectServicePull" />
</message>
<message name="ProjectServicePullResponse">
<part name="parameters" element="tns:ProjectServicePullResponse" />
</message>
<portType name="MyName">
<operation name="MyName">
<input message="tns:MyName" />
<output message="tns:MyNameResponse" />
</operation>
<operation name="ProjectServicePull">
<input message="tns:ProjectServicePull" />
<output message="tns:ProjectServicePullResponse" />
</operation>
</portType>
<binding name="MyNamePortBinding" type="tns:MyName">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="MyName">
<soap:operation soapAction="http://project-project.org/ref/MyName" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
<operation name="ProjectServicePull">
<soap:operation soapAction="http://project-project.org/ref/ProjectService/Pull" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="MyName">
<port name="MyNamePort" binding="tns:MyNamePortBinding">
<soap:address location="http://X.X.X.X:8080/myName/MyName" />
</port>
</service>

最佳答案

可能是您的模式对于类 B 不完整,因此 jaxb 无法成功创建该类。如果我没理解错的话,你是说生成的类 A 由于缺少类而在生成后无法编译? wsimport 会发出任何警告吗?

关于java - wsimport 忘记了一个代理类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7299090/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com