Soap JAXWS客户端总是发送HTTP而不是HTTPS

Soap JAXWS客户端总是发送HTTP而不是HTTPS,soap,jax-ws,jaxws-maven-plugin,Soap,Jax Ws,Jaxws Maven Plugin,嗨,我在我的java项目中使用jaxws生成wsdl。我使用Java11和JAXWSMaven插件导入我的wsdl 我的问题在我的wsdl中有一个块。我想用作url。 我生成并导入wsdl。这总是试图访问http地址而不是https。我如何强制我的webclient使用http地址 /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.3.2 * Generated source version: 2.2 * *

嗨,我在我的java项目中使用jaxws生成wsdl。我使用Java11和JAXWSMaven插件导入我的wsdl 我的问题在我的wsdl中有一个块。我想用作url。 我生成并导入wsdl。这总是试图访问http地址而不是https。我如何强制我的webclient使用http地址

/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.3.2
 * Generated source version: 2.2
 * 
 */
@WebServiceClient(name =

  MyResponse response=reply.getMyService().MyRequest(request);


   <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxws-maven-plugin</artifactId>
                    <version>2.6</version>
/**
*这个类是由JAX-WSRI生成的。
*JAX-WSRI 2.3.2
*生成的源版本:2.2
* 
*/
@WebServiceClient(名称=
MyResponse=reply.getMyService().MyRequest(请求);
org.codehaus.mojo
jaxws-maven插件
2.6

BindingProvider是解决方案

  QName qname2 = new QName("http://myschema", "MYserviceImpl");
                Service service = MYserviceImpl.create(new URL("https://mysiteRequest"), qname2);
                MYservice reply=   service.getPort(MYservice.class);
                BindingProvider bindingProvider = (BindingProvider)reply;
                bindingProvider.getRequestContext().put(
                        BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                        "https://mysite");

                MyResponse response=  reply.myRequest(request2);

您是否尝试过web.xml中良好的旧安全约束

   <security-constraint>
        <display-name>SecurityConstraint</display-name>
        <web-resource-collection>
            <web-resource-name>Secure Area</web-resource-name>
            <url-pattern>/your-webservice-url</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

安全培训
安全区
/您的Web服务url
保密的