- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我收到来自某些旧代码的 SOAP 请求,并使用 JAX-WS 生成的对象来处理该请求,该对象来自旧代码使用的同一 WSDL,但在处理该请求时收到 Unmarshalling Error:unmarshalling error:意外元素错误。
此请求的 WSDL 部分如下:(请注意“架构”已替换我们 WSDL 的所有实际架构位置)
<xsd:complexType name="Administrate">
<xsd:sequence>
<xsd:element name="AdminOperation" type="typens:AdminOperation" maxOccurs="unbounded" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="Administrate" type="typens:Administrate"/>
<xsd:complexType name="AdministrateResponse">
<xsd:sequence>
<xsd:element name="Status" type="typens:SoapResponseStatus"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="AdministrateResponse" type="typens:AdministrateResponse"/>
<xsd:complexType name="AdminOperation">
<xsd:sequence>
<xsd:choice>
<xsd:element name="Transaction" type="typens:Transaction" minOccurs="0"/>
<xsd:element name="CreateUser" type="typens:CreateUser" minOccurs="0"/>
<xsd:element name="DeleteUser" type="typens:DeleteUser" minOccurs="0"/>
<xsd:element name="UpdateUser" type="typens:UpdateUser" minOccurs="0"/>
<xsd:element name="CreateGroup" type="typens:CreateGroup" minOccurs="0"/>
<xsd:element name="DeleteGroup" type="typens:DeleteGroup" minOccurs="0"/>
<xsd:element name="UpdateGroup" type="typens:UpdateGroup" minOccurs="0"/>
<xsd:element name="CreateChannel" type="typens:CreateChannel" minOccurs="0"/>
<xsd:element name="DeleteChannel" type="typens:DeleteChannel" minOccurs="0"/>
<xsd:element name="UpdateChannel" type="typens:UpdateChannel" minOccurs="0"/>
<xsd:element name="CreateRole" type="typens:CreateRole" minOccurs="0"/>
<xsd:element name="DeleteRole" type="typens:DeleteRole" minOccurs="0"/>
<xsd:element name="UpdateRole" type="typens:UpdateRole" minOccurs="0"/>
<xsd:element name="CreateFileType" type="typens:CreateFileType" minOccurs="0"/>
<xsd:element name="DeleteFileType" type="typens:DeleteFileType" minOccurs="0"/>
<xsd:element name="UpdateFileType" type="typens:UpdateFileType" minOccurs="0"/>
<xsd:element name="CreateFolder" type="typens:CreateFolder" minOccurs="0"/>
<xsd:element name="DeleteFile" type="typens:DeleteFile" minOccurs="0"/>
<xsd:element name="MoveFile" type="typens:MoveFile" minOccurs="0"/>
<xsd:element name="CopyFile" type="typens:CopyFile" minOccurs="0"/>
<xsd:element name="UpdateFile" type="typens:UpdateFile" minOccurs="0"/>
<xsd:element name="DeleteJob" type="typens:DeleteJob" minOccurs="0"/>
<xsd:element name="DeleteJobNotices" type="typens:DeleteJobNotices" minOccurs="0"/>
<xsd:element name="UpdateJobSchedule" type="typens:UpdateJobSchedule" minOccurs="0"/>
<xsd:element name="UpdateVolumeProperties" type="typens:UpdateVolumeProperties" minOccurs="0"/>
<xsd:element name="UpdateOpenSecurityCache" type="typens:UpdateOpenSecurityCache" minOccurs="0"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
以及发送的请求:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns="schema">
<SOAP-ENV:Header>
<AuthId>7</AuthId>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<Administrate>
<UpdateFile>
<SetPermissions>
<Permission SOAP-ENC:arrayType="Permission[1]">
<UserName>username</UserName>
<AccessRight>rights</AccessRight>
</Permission>
</SetPermissions>
<NameList>
<String>folder1</String>
<String>folder1/folder2</String>
<String>folder1/folder2/file.ext</String>
</NameList>
</UpdateFile>
</Administrate>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
但是我的代码出现以下错误:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unmarshalling Error: unexpected element
(uri:"schema", local:"UpdateFile"). Expected elements
are <{schema}AdminOperation> </faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
管理 JAX-WS 生成的对象仅包含带有 getter 的 AdminOperations ArrayList,
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Administrate", propOrder = {
"adminOperation"
})
public class Administrate {
@XmlElement(name = "AdminOperation")
protected List<AdminOperation> adminOperation;
/**
* Gets the value of the adminOperation property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the adminOperation property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAdminOperation().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link AdminOperation }
*
*
*/
public List<AdminOperation> getAdminOperation() {
if (adminOperation == null) {
adminOperation = new ArrayList<AdminOperation>();
}
return this.adminOperation;
}
}
但是从发送的旧请求和 WSDL 来看,该操作标记被替换为操作选择,例如更新文件等对吗?
由于我无法更改旧请求或旧 WSDL,因此我不确定如何继续。任何帮助将不胜感激,所以提前致谢!
最佳答案
你的怀疑是正确的。在这种情况下,客户端实际上发送的请求不符合所提供的架构。
由于您无法控制客户端代码并且显然必须容纳客户端,因此我希望它是此服务的唯一客户端。最简单的前进路径是将服务调整为实际构建客户端的契约(Contract)。您可以手动调整架构以指示 UpdateFile 是 Administrate 的子级,然后重新生成相关对象或(不关心对象的重新生成)调整 Administrate java 对象注释以将 FileUpdate 反射(reflect)为第一级子级:... @XmlType(name = "管理", propOrder = { “更新文件” }) 公开课管理{
@XmlElement(name = "UpdateFile")
protected UpdateFileType updateFile;
...
尽职调查还包括识别其他形式的请求(它们是否符合契约(Contract)),以确保在调整服务端点时不会出现进一步的破坏。
关于java - 解码错误: unexpected element from legacy request with legacy WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11560636/
为什么 WSDL 引入 wsdl:message?和消息部分? 与在操作参数(输入、输出、故障)中直接使用 XSD 相比,他们可以带来什么优势? 它们(带有 wsdl 消息部分的 wsdl 消息)如何
这个问题看起来很简单,但我找不到合适的地方在 WSDL 文档中设置其定义的版本。 目标是能够很容易地看到它何时过时,以及我将来何时更新它。 我要把它设为 1.0。如果将来我向它添加新操作,我将其设置为
在 WSDL 文件中,函数可以返回类型或元素。到目前为止,我仅使用自定义类型作为结果。但是,我想知道什么时候Element应该比Type更合适?它们有什么区别? 有什么区别吗 和
我在 web sphere 服务器上部署了一个 jax-ws web 服务,当我尝试使用 url 在浏览器中访问 wsdl 时 "Http://localhost:7001/HelloWorldSer
我在使用 SVCUtil 为 WCF 生成代理时遇到错误。错误是 Attempting to download metadata from 'net.pipe://localhost/WebServi
我正在遵循 WSDL-first(由我们的客户提供)方法来开发 WCF 服务,但是从我的 wcf 服务生成的 WSDL 与我们的客户提供给我的 WSDL 略有不同,并且由于这种不匹配,客户在调用我的服
我有嵌套的 WSDL,我想将其扁平化。 wsdl 导入 xsd 文件,这些文件又包含其他文件等。我喜欢把整个东西压平成一个文件,以便将它提供给一个无法执行导入/包含的工具。有没有我可以使用的简单工具(
我正在尝试使用一些统计信息进行 WSDL 解析(使用 c#.net)。我的统计数据取决于 WSDL 中的文档标签。我想知道可以包含文档标签的 wsdl 标签列表来检查它们。 我试图阅读 WS-I 基本
我有一个 WSDL 文件。我想将 wsdl 文件转换为 Web 服务类文件。 是否可以?如果是,请向我详细解释。 最佳答案 在解决方案资源管理器中右键单击 您的项目并转到“添加服务 引用...” 按窗
我正在使用 Axis 为示例 WebService 建模。我现在正在做的是试图了解自动化 wsdl 和代码生成的局限性。 现在对于一些服务器端代码: 这是示例 Web 服务的框架: public cl
我有一个 Silverlight 应用程序,它通过 WCF 服务与服务器端的 ADO.Net 数据实体通信。实际上,我正在使用多个 WCF 服务与三个不同的数据 ADO.Net 数据实体进行通信。我最
是否有使用服务端点地址获取服务 WSDL 的通用方法。我知道这可以通过将 ?wsdl 附加到 Axis2 服务来完成。但是这个属性是否也适用于其他 Web 服务容器? 最佳答案 ?wsdl 适用于所有
例如使用 png归档其 mime-type是“图像/png”;那么 wsdl 的 MIME 类型是什么?文件 ? 最佳答案 text/xml - WSDL 是基于 XML 格式的服务描述。 您可以在“
我的服务是从一个 wsdl 文件中选取的。但是发布的服务 wso2 是 chenged。如果我希望 wso2 像我的 wsdl 文件一样发布。如何设置?例如,我的 wsdl 文件是:
我需要在给定 XSD 文件的情况下生成 WSDL 文件。我该怎么做呢?我可以在VS2005中这样做吗?最简单的方法是什么? 最佳答案 你不能 - XSD 描述数据方面,例如Web 服务的功能 - WS
有什么方法可以从 wsdl 生成 xsd 吗?任何链接或工具也可以。最简单的方法是什么? 最佳答案 您可以使用SoapUI:http://www.soapui.org/这是一个通常很方便的程序。创建一
我启动我的 azure 应用程序,浏览到 svc 文件 http://127.0.0.1:82/transaction.svc ,我得到了通常的结果: You have created a servi
我使用动态端点 wsdl(通过 http 的 wsdl)来生成客户端。这工作得很好。 是否可以从动态wsdl的http链接生成静态wsdl? 问题是动态 wsdl 只能从一台机器访问。 我想在另一台电
我想知道是否可以将请求从一个 wsdl 发送到另一个 wsdl。如果是,那我该怎么做? 流程将是: 我想使用 switchyard 公开一个 wsdl,比如 wsdl-1,它可能有 100 个参数,带
我按照定义的步骤使用 Spring Boot 创建了一个网络服务 here当我尝试下载 wsdl 时,我不得不在 url 中使用 .wsdl 。但是,当我使用 ?wsdl 时,不会下载 wsdl。当我
我是一名优秀的程序员,十分优秀!