Web services 使用名称空间的SOAP消息

Web services 使用名称空间的SOAP消息,web-services,soap,wsdl,jax-ws,Web Services,Soap,Wsdl,Jax Ws,我们正在设计一个由外部系统调用的Web应用程序。我们将从外部系统接收一个Web服务,如下所示: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tis="http://schemas.tis.com/1.2/" xmlns:der="http://schemas.tis.com/DataProvisioning/"> <soapenv:Header>

我们正在设计一个由外部系统调用的Web应用程序。我们将从外部系统接收一个Web服务,如下所示:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tis="http://schemas.tis.com/1.2/" xmlns:der="http://schemas.tis.com/DataProvisioning/">
   <soapenv:Header>
      <tis:SessionId>99999999</tis:SessionId>
   </soapenv:Header>
 <soapenv:Body>
  <tis:Create>
     <tis:MOType>SPPM@http://schemas.tis.com/DataProvisioning/</tis:MOType>
     <tis:MOId>
           <der:codex>12345677</der:msisdn>
     </tis:MOId>

     <tis:MOAttributes>
        <der:createSPDD ProfileID="1"  Action="createData">

           <der:TechProduct Action="add" BarCode="15">
            <der:Arguments ArgName="arg1" ArgType="string" ArgValue="1"></der:Arguments>
            <der:Arguments ArgName="arg3" ArgType="string" ArgValue="2"></der:Arguments>
           </der:TechProduct>
           <der:TechProduct Action="delete" BarCode="21">
            <der:Arguments ArgName="arg1" ArgType="string" ArgValue="1"></der:Arguments>
            <der:Arguments ArgName="arg3" ArgType="string" ArgValue="2"></der:Arguments>
           </der:TechProduct>
        </der:createSPDD>
     </tis:MOAttributes>
  </tis:Create>

99999999
SPPM@http://schemas.tis.com/DataProvisioning/
12345677

正如您所看到的,我们将收到的SOAP信封中包含名称空间。到目前为止,我的Web服务应用程序都是使用JAX-WS和自底向上的方法编写的(只是在类中添加@WebService和@WebMethod注释)。设计需要接收基于名称空间的消息的Web服务的正确方法是什么?我应该首先设计WSDL吗?我看不到如何收集标题或正文中的属性,如MoType或MoId。有什么帮助吗

非常感谢

从您的问题中很难理解您是想要公开web服务还是想要使用web服务。如果要公开具有此结构和命名空间的web服务,可以选择自底向上或自顶向下的方法。使用自上而下的方法,您将创建

  • WSDL(在这里,您可以清楚地提到与服务相关的详细信息的名称空间)
  • 架构(定义请求和响应元素的名称空间)
  • 从WSDL和模式生成Java类
  • 编写Web服务接口的实现
  • 如果您想使用该服务,则无需编写任何WSDL。从服务提供者获取WSDL和模式(如果有的话),从收到的WSDL和模式生成Java类。您不必担心读取基于名称空间的值,jaxws框架将为您完成这项工作

    谷歌搜索使用jaxws服务的步骤