0

I have a trouble with eWay webservice.
I created client ws by wsimport with https://www.eway.com.au/gateway/rebill/test/manageRebill_test.asmx?WSDL
With the file generated, I call a method of ws

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

The message return error is : The 'eWayCustomerID' element has an invalid value according to its data type.

The format of Soap message is

<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>

On method above just add <Soap:Body> Anyone know to add eWayHeader or <soap:Header> when call method on eWay webservice ? Please help me.

Jimmy
  • 73
  • 1
  • 1
  • 4

1 Answers1

1

This has been answered here - wsimport doesnt generate code related to soap headers

Adding the option '-XadditionalHeaders' to the wsimport command solved the problem. It generates an extra argument for the method through which the header can be passed/retrieved.
Community
  • 1
  • 1