我正在尝试使用http://cxf.apache.org/docs/developing-a-consumer.html上的教程开发肥皂服务消费者
在"使用上下文设置连接属性"一节中,我正在查看下面的代码
// Set request context property.
java.util.Map<String, Object> requestContext =
((javax.xml.ws.BindingProvider)port).getRequestContext();
requestContext.put(ContextPropertyName, PropertyValue);
// Invoke an operation.
port.SomeOperation();
Run Code Online (Sandbox Code Playgroud)
有人能告诉我是否可以使用requestContext属性设置代理服务器设置以及如何?我的代码在代理后面运行,我需要支出SOAP调用来使用代理服务器设置.
我创建了一个示例 Spring Boot 应用程序,当服务类都在一个包中时,它运行得非常好,但是如果一个 Service 类引用另一个包中的另一个服务类,那么我会得到 BeanCreationException
应用程序代码如下
主程序
@SpringBootApplication
public class Main {
public static void main(String[] args) {
SpringApplication.run(Main.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
我的跑步者
@Component
@ComponentScan(basePackages ="com.springboot.helloworld")
public class MyRunner implements CommandLineRunner {
@Autowired
private GreeterService greeterService;
@Override
public void run(String... args) throws Exception {
System.out.println(greeterService.greetGuest("John Doe"));
}
}
Run Code Online (Sandbox Code Playgroud)
GreeterService 和 GreeterServiceImpl 在 com.springboot.helloworld.Greeter
@Service
public class GreeterServiceImpl implements GreeterService {
@Autowired
Sample service;
@Override
public String greetGuest(String greeter) {
if (greeter == null) {
return "Looged in as …Run Code Online (Sandbox Code Playgroud) 我有一个像这样的更新查询
Update Table name set valstring = ? where valstring = ? and ID in (?)
Run Code Online (Sandbox Code Playgroud)
所以JPA交易是
em.CreateNativeQuery(Update_QUERY).setParameter(1, updatedStatus).setParameter(2,currentStatus).setParameter(3,ids).executeUpdate();
Run Code Online (Sandbox Code Playgroud)
方法的输入是List id,currentStatus和updatedStatus
如何将List作为单个参数传递,如果我将List转换为逗号分隔的String我得到错误指定的文本不是数字,因为In子句中不允许使用字符串