首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在eWayHeader eWay服务上创建eWay

如何在eWayHeader eWay服务上创建eWay
EN

Stack Overflow用户
提问于 2013-02-21 03:12:01
回答 1查看 305关注 0票数 0

我在eWay webservice上遇到了麻烦。

我用test.asmx?WSDL创建了wsimport客户机ws

使用生成的文件,我调用ws的方法。

代码语言:javascript
复制
ManageRebillTestSoap soap = new ManageRebillTest() .getManageRebillTestSoap();
CustomerDetails details = soap.createRebillCustomer(....);

消息返回错误是: 'eWayCustomerID‘元素根据其数据类型有一个无效的值。

Soap消息的格式是

代码语言:javascript
复制
<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>

在上面的方法上,只要添加<Soap:Body>,谁知道在调用eWayHeader或<soap:Header>方法时添加eWay when服务?请帮帮我。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-02-25 00:16:21

这个问题已经在这里得到了回答- wsimport doesnt generate code related to soap headers

在wsimport命令中添加选项'-XadditionalHeaders‘解决了这个问题。它为可以传递/检索标头的方法生成一个额外的参数。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14993938

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档