【问题标题】:Default portname value in SOAP Web ServiceSOAP Web 服务中的默认端口名值
【发布时间】:2015-06-06 15:53:12
【问题描述】:

在部署SOAP Web Service 时,有人可以澄清WSDl 文件中的默认portname 值是什么吗?我已阅读规范JSR-181,他们声明(第 14 页)它是@WebService.name +”Port”。不过我已经在Glassfish 部署了以下Web Service:

@WebService(name="interfaceName")
public interface SampleWSInterface 
{

    public int add(int a, int b);

    public int multipy(int a, int b);

}

@WebService(endpointInterface="com.xyz.webservicetest.SampleWSInterface")
public class SampleWS
{

    public int add(int a, int b){
        return a + b;
    }

    public int multipy(int a, int b){
        return a * b;
    }

}

WSDL 文件看起来:

 <service name="SampleWSService">
    <port name="SampleWSPort" binding="tns:SampleWSPortBinding">
      <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
    </port>
  </service>

我说得对吗,它只有在 SIB 上定义时才获得名称(当不引用 SEI 时),否则它是 SIB + Port

【问题讨论】:

    标签: java web-services soap wsdl jax-ws


    【解决方案1】:
    @WebService()
    public class SampleWS
    {}
    

    端口名称= SampleWSPort(默认)

    @WebService(portName="myPortName")
        public class SampleWS
        {}
    

    端口名称 = myPortName(自定义)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-24
      • 2011-10-11
      • 1970-01-01
      相关资源
      最近更新 更多