做一个项目,调用的是JAVA写的WEBSERVICE,知道是调用的是类
用过nusoap调用,以数组的形式调用,结果是返回Not enough message parts were received for the operation.
一下是部分代码:
$SecurityCredential = array('agencyCode' => '########', 'password' => '########', 'securityCode' => '########');
$FlightCity = array('flightDate' => '2009-03-23', 'flightTime' => '2009-03-23', 'fromCity' => 'SHA', 'toCity' => 'PEK');
$searchFlightsRequest = array('credential' => $SecurityCredential, 'airline' => 'MU', 'routeType' => 'OW','citys' => $FlightCity);
// Check for a fault
$result = $proxy->SearchFlights($searchFlightsRequest);
以上是一个航空机票的webservice调用
调用地址是 http://webservice.51book.com:8000/liantuo/service/SearchFlightsService?wsdl
主要代码:
- <wsdl:binding name="SearchFlightsServiceHttpBinding" type="tns:SearchFlightsServicePortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="searchFlights">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="searchFlightsRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
- <wsdl:output name="searchFlightsResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
请问,如何用nusoap调用或者用php5的soap编程
我关心的问题是如何传递参数!
在使用nusoap中,可以调用http://www.webservicex.net/globalweather.asmx?WSDL 根据城市显示温度
是正常的,使用的是数组形式
用过nusoap调用,以数组的形式调用,结果是返回Not enough message parts were received for the operation.
一下是部分代码:
$SecurityCredential = array('agencyCode' => '########', 'password' => '########', 'securityCode' => '########');
$FlightCity = array('flightDate' => '2009-03-23', 'flightTime' => '2009-03-23', 'fromCity' => 'SHA', 'toCity' => 'PEK');
$searchFlightsRequest = array('credential' => $SecurityCredential, 'airline' => 'MU', 'routeType' => 'OW','citys' => $FlightCity);
// Check for a fault
$result = $proxy->SearchFlights($searchFlightsRequest);
以上是一个航空机票的webservice调用
调用地址是 http://webservice.51book.com:8000/liantuo/service/SearchFlightsService?wsdl
主要代码:
- <wsdl:binding name="SearchFlightsServiceHttpBinding" type="tns:SearchFlightsServicePortType">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="searchFlights">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="searchFlightsRequest">
<wsdlsoap:body use="literal" />
</wsdl:input>
- <wsdl:output name="searchFlightsResponse">
<wsdlsoap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
请问,如何用nusoap调用或者用php5的soap编程
我关心的问题是如何传递参数!
在使用nusoap中,可以调用http://www.webservicex.net/globalweather.asmx?WSDL 根据城市显示温度
是正常的,使用的是数组形式
<name>test</name>
<serviceClass>test.test</serviceClass>
<implementationClass>
test.test
</implementationClass>
<style>wrapped</style>
<use>literal</use>
<scope>application</scope>
然后tomcat重新部署就可以了.没有用有接口的那个类...
//有接口实现的(用ASP.NET访问时是正常能够访问并传值的.php没有成功)
$client=new soapclient('http://localhost:8080/testWebservice/services/testhelloword?wsdl','WSDL');
//没有接口实现的.(ASP.NET和php都行..不过没有找到解决中文乱码问题.我都把java和php坏境统一"utf-8"了还是不行..)
$client=new soapclient('http://localhost:8080/testWebservice/services/test?wsdl','WSDL');