HTTP 上的 SOAP 端点是否会返回除 200 和 500 之外的任何状态代码?我有一个 SOAP 端点,它具有一些业务逻辑,可以在请求过多时拒绝请求。我想知道在这种情况下正确的 HTTP 响应代码是什么 - 500 或 429?在SOAP规范似乎隐隐约约对我说:
SOAP HTTP 遵循 HTTP 状态代码的语义,用于在 HTTP 中传递状态信息。例如,2xx 状态代码表示客户端的请求(包括 SOAP 组件)已成功接收、理解和接受等。
如果在处理请求时发生 SOAP 错误,SOAP HTTP 服务器必须发出 HTTP 500“内部服务器错误”响应并在响应中包含一个 SOAP 消息,该消息包含一个 SOAP Fault 元素(参见第 4.4 节),指示 SOAP 处理错误。
我需要在 Java 测试中获取当前 Git 分支的名称。也许我可以解析git status结果。是否有其他方法或现成的代码片段可用?
我有两个接收者,应该从一个主题中阅读。但是只有一个随机接收者会收到消息,就像它实际上是从队列中读取而不是主题一样。我已经读过这个答案,但是似乎没有用。这是我的代码。
Application.java:
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.support.converter.MappingJackson2MessageConverter;
import org.springframework.jms.support.converter.MessageConverter;
import org.springframework.jms.support.converter.MessageType;
import javax.jms.ConnectionFactory;
@SpringBootApplication
@EnableJms
public class Application {
public static final String MAILBOX_TOPIC = "inbox.topic";
public static void main(String[] args) {
// Launch the application
ConfigurableApplicationContext context = SpringApplication.run(Application.class, args);
JmsTemplate jmsTemplate = context.getBean(JmsTemplate.class);
// Send a message with a POJO - the template reuse the message converter
System.out.println("Sending an …Run Code Online (Sandbox Code Playgroud)