Клиент PHP Soap, Java SOAP-сервер

Я пишу PHP SOAP-клиент, который будет подключаться к веб-сервису Java SOAP, а клиенту необходимо получить некоторые данные из веб-сервиса.

Веб-службы wsdl-файлы:

http://test.iaeste.net:8080/iws-ws/accessWS?wsdl

http://test.iaeste.net:8080/iws-ws/exchangeWS?wsdl

Мой код:

<?php $soapURL = "http://test.iaeste.net:8080/iws-ws/accessWS?wsdl" ; $options = array('features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS); $soapClient = new SoapClient($soapURL, $options); $soapResult = $soapClient->generateSession(Array("password"=>"mypassword", "username"=> "myusername")) ; var_dump($soapResult); $token = $soapResult->token->token; $obj= new stdClass(); $obj->exchangeYear=2015; $obj->fetchType="SHARED"; $obj->token=$token; $soapURL = "http://test.iaeste.net:8080/iws-ws/exchangeWS?wsdl" ; $soapClient2 = new SoapClient($soapURL, $options); $soapResult2 = $soapClient2->fetchOffers($obj) ; //$soapResult2 = $soapClient2->fetchOffers(Array("exchangeYear"=> 2015,"fetchType"=>"SHARED" , "token"=>"$token" )) ; var_dump($soapResult2); echo "<br>"; $soapResult = $soapClient->deprecateSession(Array("token"=>"$token")) ; var_dump($soapResult); ?> 

Все работает правильно, кроме метода fetchOffers. Я также попытался отправить массив вместо объекта. Он комментируется кодом, но результат тот же. Выходной сигнал soapResult2:

 object(stdClass)#9 (2) { ["error"]=> object(stdClass)#10 (2) { ["error"]=> int(401) ["description"]=> string(54) "Given data is insufficient to properly handle request." } ["message"]=> string(57) "Validation failed: {fetchType=The field may not be null.}" } 

Я немного озадачен этой проблемой, так как она должна работать. У меня также есть класс fetchType Java и класс fetchOfferRequest Java из веб-службы, чтобы правильно видеть, как форматировать объекты.

FetchOfferRequest:

 package net.iaeste.iws.ws; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for fetchOffersRequest complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="fetchOffersRequest"> * &lt;complexContent> * &lt;extension base="{http://ws.iws.iaeste.net/}abstractPaginatable"> * &lt;sequence> * &lt;element name="exchangeYear" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;element name="fetchType" type="{http://ws.iws.iaeste.net/}fetchType" minOccurs="0"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "fetchOffersRequest", propOrder = { "exchangeYear", "fetchType" }) public class FetchOffersRequest extends AbstractPaginatable { protected Integer exchangeYear; protected FetchType fetchType; /** * Gets the value of the exchangeYear property. * * @return * possible object is * {@link Integer } * */ public Integer getExchangeYear() { return exchangeYear; } /** * Sets the value of the exchangeYear property. * * @param value * allowed object is * {@link Integer } * */ public void setExchangeYear(Integer value) { this.exchangeYear = value; } /** * Gets the value of the fetchType property. * * @return * possible object is * {@link FetchType } * */ public FetchType getFetchType() { return fetchType; } /** * Sets the value of the fetchType property. * * @param value * allowed object is * {@link FetchType } * */ public void setFetchType(FetchType value) { this.fetchType = value; } } 

FetchType:

 package net.iaeste.iws.ws; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for fetchType. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="fetchType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="DOMESTIC"/> * &lt;enumeration value="SHARED"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "fetchType") @XmlEnum public enum FetchType { DOMESTIC, SHARED; public String value() { return name(); } public static FetchType fromValue(String v) { return valueOf(v); } } 

Я верю, что это вся информация, необходимая для решения этой проблемы. Если кто-то знает, как мне помочь, я был бы признателен.