|
 47.8 Кб |
|
| Только начал разбираться с технологией, два дня уже голову ломаю - не могу найти источник ошибки.
файл client.php
<?php
$client = new SoapClient("http://sunfire.deimand.local:2281/wcfReception.svc?wsdl", array(
"trace" => 1,
"exceptions" => 0));
$client->getNowTime();
//var_dump($client);
print "<pre>\n";
print "Запрос :\n".htmlspecialchars($client->__getLastRequest()) ."\n";
print "Ответ:\n".htmlspecialchars($client->__getLastResponse())."\n";
print "</pre>";
?>
|
в брузере показывает следующее:
Запрос :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
<SOAP-ENV:Body>
<ns1:GetNowTime/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Ответ:
|
запрос поступает, а ответа нет. где у меня ошибка?
wsdl в прикреплении
Спасибо. | |
|
|
|
|
|
|
|
для: deimand
(16.08.2010 в 10:44)
| | Дело в том, что эта служба еще ни разу ни кому не отдавала ответа.
Возможно, что она не корректно настроена и я зря себе голову ломаю.
Скажите кто разбирается в этом, я правильно запрашиваю данные или нет.
Вот обработчик сервера, написан на шарпе.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Data;
using Dalc=Deimand.Sanatorium.DataLayer;
using BO=Deimand.Sanatorium.BusinessObjects;
using System.Collections;
using Deimand.Sanatorium.BusinessObjects;
namespace wcfReseption
{
[ServiceContract]
public interface IReseption
{
[OperationContract]
void DoWork();
[OperationContract]
DateTime GetNowTime();
[OperationContract]
DataTable GetRoomPricePeriods();
[OperationContract]
BO.RoomPrice GetPriceGetPrice(int RoomTypeID, int BuildingID, DateTime DateStart, DateTime DateEnd, bool isChildren, int settlementType);
[OperationContract]
DataTable GetRoomPriceByPeriod(DateTime DateStart, DateTime DateEnd);
[OperationContract]
ArrayList GetBuilding();
[OperationContract]
ArrayList GetRoomType(DateTime DateStart, DateTime DateEnd, int BuildingID);
[OperationContract]
ArrayList GetPlaceType();
[OperationContract]
ArrayList GetFoodType();
[OperationContract]
ArrayList SettlementTypePrice();
[OperationContract]
List<BO.Country> GetCountry();
[OperationContract]
List<BO.Area> GetArea(int CountryID);
[OperationContract]
List<BO.City> GetCity(int AreaID);
}
}
|
var_dump($client->GetNowTime()); возвращает:
object(SoapFault)[2]
protected 'message' => string 'Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'.' (length=142)
private 'string' => string '' (length=0)
protected 'code' => int 0
protected 'file' => string 'Z:\home\mytest.loc\www\test2\client.php' (length=39)
protected 'line' => int 7
private 'trace' =>
array
0 =>
array
'function' => string '__doRequest' (length=11)
'class' => string 'SoapClient' (length=10)
'type' => string '->' (length=2)
'args' =>
array
...
1 =>
array
'function' => string '__call' (length=6)
'class' => string 'SoapClient' (length=10)
'type' => string '->' (length=2)
'args' =>
array
...
2 =>
array
'file' => string 'Z:\home\mytest.loc\www\test2\client.php' (length=39)
'line' => int 7
'function' => string 'getNowTime' (length=10)
'class' => string 'SoapClient' (length=10)
'type' => string '->' (length=2)
'args' =>
array
...
public 'faultstring' => string 'Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'.' (length=142)
public 'faultcode' => string 'HTTP' (length=4)
|
| |
|
|
|