【问题标题】:How to create eWayHeader on eWay webservice如何在 eWay 网络服务上创建 eWayHeader
【发布时间】:2013-02-06 06:51:32
【问题描述】:

我在使用 eWay 网络服务时遇到问题。
我通过 wsimport 使用 https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx?WSDL 创建了客户端 ws
生成文件后,我调用ws的方法

ManageRebillTestSoap soap = new ManageRebillTest() .getManageRebillTestSoap();
CustomerDetails details = soap.createRebillCustomer(....);

消息返回错误是:“eWayCustomerID”元素根据其数据类型具有无效值。

Soap 消息的格式为

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <eWAYHeader xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
      <eWAYCustomerID>string</eWAYCustomerID>
      <Username>string</Username>
      <Password>string</Password>
    </eWAYHeader>
  </soap:Header>
  <soap:Body>
    <CreateRebillCustomer xmlns="http://www.eway.com.au/gateway/rebill/manageRebill">
      <customerTitle>string</customerTitle>
      <customerFirstName>string</customerFirstName>
      <customerLastName>string</customerLastName>
      <customerAddress>string</customerAddress>
      <customerSuburb>string</customerSuburb>
      <customerState>string</customerState>
      <customerCompany>string</customerCompany>
      <customerPostCode>string</customerPostCode>
      <customerCountry>string</customerCountry>
      <customerEmail>string</customerEmail>
      <customerFax>string</customerFax>
      <customerPhone1>string</customerPhone1>
      <customerPhone2>string</customerPhone2>
      <customerRef>string</customerRef>
      <customerJobDesc>string</customerJobDesc>
      <customerComments>string</customerComments>
      <customerURL>string</customerURL>
    </CreateRebillCustomer>
  </soap:Body>
</soap:Envelope>

上面的方法只需添加&lt;Soap:Body&gt; 有人知道在 eWay 网络服务上调用方法时添加 eWayHeader 或 &lt;soap:Header&gt; 吗?请帮帮我。

【问题讨论】:

  • 你好@Jimmy,我是支付网关的新手。对于 eway,您正在使用 java 第三方库吗?请发送为 eaway 定义 Java api 的链接。
  • @jimmy 这个问题你解决了吗?

标签: java web-services soap


【解决方案1】:

这里已经回答了 - wsimport doesnt generate code related to soap headers

将选项“-XadditionalHeaders”添加到 wsimport 命令解决了该问题。它为可以传递/检索标头的方法生成一个额外的参数。

【讨论】:

  • 非常感谢。这就是我要找的。很有帮助。
猜你喜欢
  • 2011-06-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-01-20
  • 2014-03-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多