soap 相关问题

简单对象访问协议(SOAP)是用于在Web服务的实现中交换结构化信息的协议规范。

Spring Boot 3 更新:没有“jakarta.xml.ws.WebServiceContext”类型的合格 bean 可用

从 Spring Boot 2.7 更新后。到版本 3 时,出现了奇怪的错误,即没有可用的“jakarta.xml.ws.WebServiceContext”类型的合格 bean。我按照迁移步骤进行操作(jav...

回答 2 投票 0

使用Asp.Net Core将参数传递给soap方法SOAPCORE

我使用SoapCore开发了肥皂方法。 这是我的代码: [ServiceContract(命名空间 = "http://txn.xxx.com")] 公共接口 ISampleService { [操作合约()...

回答 1 投票 0

通过 Python suds 在 JIRA 中创建问题时设置受让人字段

使用 JIRA 版本 4.2。使用 Python 2.7 和 suds 0.4,如何创建受让人字段集的问题?下面的代码中将忽略受让人字段。 new_issue = client.service.createIssue...

回答 4 投票 0

While 循环在解组时不循环遍历整个 xml 字符串

我有一个已解组的 xml 字符串,但它只返回第一部分。我相信我的 while 循环不正确。 while(xsr.hasNext()){ if(xsr.isStartElement() && "list".equa...

回答 1 投票 0

在没有任何命名空间的情况下解析标头元素

我正在尝试构建一个 CoreWCF 服务,它可以解析 XML 请求,如下所示 - 我正在尝试构建一个可以解析 XML 请求的 CoreWCF 服务,如下所示 - <NS1:Envelope xmlns:NS1="http://schemas.xmlsoap.org/soap/envelope/"> <NS1:Header> <Tag1>Value 1</Tag2> <Tag2>Value 2</Tag2> </NS1:Header> <NS1:Body> <!-- Body elements here --> </NS1:Body> </NS1:Envelope> 所以,我宣布了一个与此类似的MessageContract - [MessageContract] public class Class1 { [MessageHeader] public string Tag1 { get; set; } [MessageHeader] public string Tag2 { get; set; } // other body tag declaration } 但是,当我的服务收到请求时,它无法解析 Tag1 和 Tag2 的值,因为这些标签中的请求中没有给出命名空间。 我尝试将 [XmlElement(Form=XmlSchemaForm.Unqualified)] 设置为如下属性 - [MessageContract] public class Class1 { [MessageHeader] [XmlElement(Form=XmlSchemaForm.Unqualified)] public string Tag1 { get; set; } [MessageHeader] [XmlElement(Form=XmlSchemaForm.Unqualified)] public string Tag2 { get; set; } // other body tag declaration } 但是当我尝试从浏览器访问 WSDL 页面时,这会引发错误,我收到以下错误 - 在架构顶层声明的元素不能是无限定的 任何人都可以建议我如何在没有命名空间的情况下解析这些值。请求格式无法更改。 根据我的理解,您的请求中不应该有命名空间,但服务中有。 您可以尝试通过将 MessageHeader 属性的 Namespace 参数设置为空字符串来删除 XML 命名空间,如下所示: public class Class1 { [MessageHeader(Namespace = "")] public string Tag1 { get; set; } [MessageHeader(Namespace = "")] public string Tag2 { get; set; } // other body tag declaration }

回答 1 投票 0

解析 ksoap2 响应

我使用 ksoap2 lib 从 Android 客户端与 SOAP Web 服务进行通信。 ksoap 团队做得很好,但问题是,没有任何好的例子如何在不同的环境中正确使用它

回答 4 投票 0


C# 中的 Web 服务肥皂中的命名空间

我不知道如何修改我的网络服务肥皂中的 xml 请求中的命名空间 我正在 C# 标准 iso 20022 中做一个 Web 服务 Soap,我有这样的请求 xml: 我需要它看起来像...

回答 1 投票 0

Web 服务中的 Delphi dbGo

我正在尝试构建一个从 SQL Server 后端检索数据的 SOAP 服务器。我正在使用 Delphi 10.4 Community Edition 和 ADO 连接到数据库。我收到以下错误:CoInitial...

回答 2 投票 0

如何使用 XmlMapper 序列化带有命名空间的 SOAP 请求类?

对于 SOAP API,我需要采用以下格式 POST 请求 XML: 对于 SOAP API,我需要采用以下格式 POST 请求 XML: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws1="http://ws1.myapi.ch/"> <soapenv:Header/> <soapenv:Body> <ws1:Suchen> <ws1:Benutzername>test</ws1:Benutzername> <ws1:Passwort>test</ws1:Passwort> <ws1:Sprache>De</ws1:Sprache> <ws1:Datenname>Arten</ws1:Datenname> <ws1:Einstellungen></ws1:Einstellungen> </ws1:Suchen> </soapenv:Body> </soapenv:Envelope> 在我的 Java 代码中,我有以下 POJO: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "benutzername", "passwort", "sprache", "datenname", "suchwerte", "einstellungen" }) @XmlRootElement(name = "Suchen") public class Suchen { @XmlElement(name = "Benutzername") protected String benutzername; @XmlElement(name = "Passwort") protected String passwort; @XmlElement(name = "Sprache") protected String sprache; @XmlElement(name = "Datenname") protected String datenname; @XmlElement(name = "Suchwerte") protected String suchwerte; @XmlElement(name = "Einstellungen") protected String einstellungen; /** * Gets the value of the benutzername property. * * @return possible object is {@link String } */ public String getBenutzername() { return benutzername; } /** * Sets the value of the benutzername property. * * @param value allowed object is {@link String } */ public void setBenutzername(String value) { this.benutzername = value; } /** * Gets the value of the passwort property. * * @return possible object is {@link String } */ public String getPasswort() { return passwort; } /** * Sets the value of the passwort property. * * @param value allowed object is {@link String } */ public void setPasswort(String value) { this.passwort = value; } /** * Gets the value of the sprache property. * * @return possible object is {@link String } */ public String getSprache() { return sprache; } /** * Sets the value of the sprache property. * * @param value allowed object is {@link String } */ public void setSprache(String value) { this.sprache = value; } /** * Gets the value of the datenname property. * * @return possible object is {@link String } */ public String getDatenname() { return datenname; } /** * Sets the value of the datenname property. * * @param value allowed object is {@link String } */ public void setDatenname(String value) { this.datenname = value; } /** * Gets the value of the suchwerte property. * * @return possible object is {@link String } */ public String getSuchwerte() { return suchwerte; } /** * Sets the value of the suchwerte property. * * @param value allowed object is {@link String } */ public void setSuchwerte(String value) { this.suchwerte = value; } /** * Gets the value of the einstellungen property. * * @return possible object is {@link String } */ public String getEinstellungen() { return einstellungen; } /** * Sets the value of the einstellungen property. * * @param value allowed object is {@link String } */ public void setEinstellungen(String value) { this.einstellungen = value; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Suchen suchen = (Suchen) o; return Objects.equals(benutzername, suchen.benutzername) && Objects.equals(passwort, suchen.passwort) && Objects.equals(sprache, suchen.sprache) && Objects.equals(datenname, suchen.datenname) && Objects.equals(suchwerte, suchen.suchwerte) && Objects.equals(einstellungen, suchen.einstellungen); } @Override public int hashCode() { return Objects.hash(benutzername, passwort, sprache, datenname, suchwerte, einstellungen); } } final String requestData = xmlMapper.writeValueAsString(requestPojo); requestData看起来像这样: <Suchen> <benutzername>test</benutzername> <passwort>test</passwort> <sprache>De</sprache> <datenname>Arten</datenname> <suchwerte/> <einstellungen/> </Suchen> 根本不符合要求。 那么如何添加这些特殊的命名空间 xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws1="http://ws1.myapi.ch/? 添加这些元素名称前缀(如 <ws1:Suchen>)的最佳方法是什么? 我正在尝试同样的方法,对于 SpringBoot 应用程序,如果您有答案,请分享

回答 1 投票 0

针对 3PL Central 的 PHP SOAP 请求

任何人都可以指导我如何使用 3PL Central API 发出 PHP SOAP 请求吗? 我有 3PL KEY、登录名、密码和设施 ID。客户端给出的文件是 WSDL 文件、XML 请求文件、XML

回答 2 投票 0

datapower 中的请求类型 SOAP 和 XML

这个问题可能听起来很幼稚和愚蠢,但因为我目前无法访问 DataPower 请原谅我提出这个问题。 我的问题是假设我有 SOAP 请求。 我可以...

回答 2 投票 0

Jmeter 中的 Counter 和 XPath Extractor 断言失败

我想比较从服务请求的响应 XML 字段中获取的断言中的值,并且我想使用多个线程来执行此操作以测试 Soap Web 服务。问题是

回答 2 投票 0

在 laravel 中使用 Laminas SOAP 生成具有复杂子类型的 WSDL

我正在尝试弄清楚如何在我的 Laravel 中使用 Laminas SOAP 生成多级 wsdl.. 我也阅读了文档和 chatgpt.. 但我仍然困惑如何设置,这是链接: https://...

回答 1 投票 0

使用 NUSoap 客户端的 PHP Web 服务无法工作

我们需要与 .NET Webservice url 进行通信,并通过传递相应的参数从方法中获取日期。当尝试在响应中使用 NUSOAP 库时,我收到了错误...

回答 1 投票 0

“没有端点适配器”,类标记为 @XmlType 作为返回类型

我在使用 spring-boot 实现 SOAP Web 服务时遇到问题。 我有课 @端点 公共类 EndpointPortTypeImpl 实现 EndpointPortType { @PayloadRoot( 命名空间...

回答 1 投票 0

springboot不会从wsdl生成类

我尝试了有关通过 Spring Boot 使用 SOAP Web 服务的教程(入门 - 使用 SOAP Web 服务)。但运行 Maven 构建时不会生成类。我完全没问题...

回答 4 投票 0

WSDL 中的 <binding> 和 <portType> 有什么区别?

和似乎都定义了一个操作及其消息。我不太明白,为什么它们都是必要的?

回答 5 投票 0

使用DefaultWsdl11Definition自动生成wsdl

我在使用 DefaultWsdl11Definition 自动生成 wsdl 时遇到问题 联系服务操作.xsd 我在使用 DefaultWsdl11Definition 自动生成 wsdl 时遇到问题 联系服务操作.xsd <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://com/blog/samples/webservices/contactservice" xmlns:Contact="http://webservices.samples.blog.com" targetNamespace="http://com/blog/samples/webservices/Contact" elementFormDefault="qualified"> <xsd:import namespace="http://webservices.samples.blog.com" schemaLocation="Contact.xsd" /> <xsd:element name="ContactRequest"> <xsd:complexType> <xsd:sequence> <xsd:element name="Id" type="xsd:integer" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="ContactResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="Contact" type="Contact:Contact" /> </xsd:sequence> </xsd:complexType> </xsd:element> springapp-servlet.xml <mvc:annotation-driven /> <sws:annotation-driven /> <context:component-scan base-package="*" /> <bean id="ContactService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition"> <property name="schemaCollection"> <bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection"> <property name="inline" value="true" /> <property name="xsds"> <list> <value>/xsd/ContactServiceOperations.xsd</value> </list> </property> </bean> </property> <property name="portTypeName" value="ContactService" /> <property name="locationUri" value="http://localhost:8080/SpringWS/ContactService/" /> </bean> web.xml <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>springapp</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springapp</servlet-name> <url-pattern>/jsp/*</url-pattern> </servlet-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:*.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <servlet> <servlet-name>webservices</servlet-name> <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class> <init-param> <param-name>transformWsdlLocations</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>contextConfigLocation</param-name> <param-value></param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>webservices</servlet-name> <url-pattern>*.wsdl</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>webservices</servlet-name> <url-pattern>/ContactService/*</url-pattern> </servlet-mapping> 我可以正常启动 Tomcat。然后,我访问这个网址: http://localhost:8080/SpringWS/ContactService/contactService.wsdl 并且浏览器显示空白页面而不是生成的 wsdl。 也许我的配置有问题。有什么想法可以帮助我吗? 谢谢 更正了这个问题,ContactService.wsdl localhost:8080/SpringWS/ContactService/ContactService.wsdl 问题出在您的 web.xml 文件上。尝试为 DispatcherServlet 和 MessageDispatcherServlet 使用不同的上下文文件。 <servlet> <servlet-name>dispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/dispatcher-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> ...... .... <servlet> <servlet-name>webservices</servlet-name> <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class> <init-param> <param-name>transformWsdlLocations</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/springws-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> 我在运行 Spring Boot 演示时也有类似的经历。如果您的问题和我的一样,那么它is有效。 Spring 发送带有 xml 标头的 wsdl,即 <?xml version="1.0" encoding="UTF-8" standalone="no"?><wsdl:definitions ... 我使用的是 Firefox,它会在显示空白屏幕之前闪烁 wsdl。因此,查看页面源代码会显示完整的 wsdl 文件。 有一个使用 Spring Boot 注释执行此操作的简单可下载示例: https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-webservices

回答 3 投票 0

未捕获的 SoapFault 异常:[HTTP] 未找到

这是我的代码 $client = new SOAPClient('http://torcache.net/torcache.wsdl'); var_dump($client->cacheTorrent()); 我在 $client 的 var_dump 之后得到了这个 对象(SoapClient)#1 (2) { ["

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.