http://webservices.sabre.com/wsdl/sabre ... ateRQ.wsdl
Я нашел в сети следующий фрагмент кода от кого-то с похожими проблемами, но мне тоже не удалось заставить его работать:
Код: Выделить всё
$soap = new SoapClient('http://webservices.sabre.com/wsdl/sabreXML1.0.00/usg/SessionCreateRQ.wsdl',
array(
'trace' => true,
'soap_version' => SOAP_1_2,
"exceptions" => 0));
$eb = new EbXmlMessage();
$sec = new Security();
$scrq = new SessionCreateRQ();
try {
$omg = $soap->SessionCreateRQ($scrq, $sec,$eb);
}
catch (Exception $e)
{
print_r($e);
}
//debug
print "Request: \n".
htmlspecialchars($soap->__getLastRequestHeaders()) ."\n";
print "Request: \n".
htmlspecialchars($soap->__getLastRequest()) ."\n";
print "Response: \n".
$soap->__getLastResponseHeaders()."\n";
print "Response: \n".
$soap->__getLastResponse()."\n";
print_r($omg);
//the first envelope headers
class EbXmlMessage
{
public $From = array('PartyId' => 'mysite.com');
public $To = array('PartyId' => 'myprovider.com');
public $CPAId = 'ZZZZ';
public $ConversationId = 'myconv@id.com';
public $Service = 'Session';// or SessionCreate?
public $Action = 'SessionCreateRQ';
public $MessageData = array(
'MessageId' => 'messageid',
'Timestamp' => '2009-04-18T15:15:00Z');
}
//the security token
class Security {
public $Username = "xxxxx";
public $Password = "yyyyy";
public $Organization = "ZZZZ";
public $Domain = "DEFAULT";
}
//this is suppoused to be the payload, or the xml i need to send at the end
class SessionCreateRQ
{
public $POS = array(
'Source' => array(
'_'=>"",
'PseudoCityCode'=>'ZZZZ'
));
}
Ответ:
HTTP/1.1 500 Внутренняя ошибка сервера
SOAPAction: ""
Content-Type: text/xml;charset=utf-8
Дата: воскресенье, 19 апреля 2009 г., 22:21:34 GMT
Соединение: закрыть
Сервер: SWS
Ответ:
soap-env:Client.InvalidEbXmlMessageUnable для интернализации
messagejavax.xml.soap.SOAPException: невозможно интернализировать сообщение в
com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImpl.java:135)
в
com.sun.xml.messaging.saaj.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:32)
в
com.sabre.universalservices.gateway.control.SoapProcessor.getRequest(SoapProcessor.java:263)
в
com.sabre.universalservices.gateway.control.WSGateway.handleRequest(WSGateway.java:380)
в
com.sabre.universalservices.gateway.control.WSGateway.doPost(WSGateway.java:306)
на javax.servlet.http.HttpServlet.service(HttpServlet.java:710) на
javax.servlet.http.HttpServlet.service(HttpServlet.java:803) на
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
в
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
в
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
в
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
в
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
в
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
в
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
в
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
в
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
в
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
в
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
в
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
в java.lang.Thread.run(Thread.java:595) Вызвано:
javax.xml.soap.SOAPException: Invalid
Content-Type:application/soap+xml at
com.sun.xml.messaging.saaj.soap.MessageImpl.verify(MessageImpl.java:159)
at
com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImpl.java:91)
... еще 19
Объект SoapFault (
[message:protected] => Невозможно интернализировать сообщение
[string:private] => .....
Эта служба должна проверять меня в системе и возвращать объект безопасности, который будет использоваться в последующих вызовах — строку(?), которую я затем могу сохранить в переменной сеанса для следующих вызовов.
Любая помощь ОЧЕНЬ признательна!!!>
Подробнее здесь: https://stackoverflow.com/questions/766 ... ent-how-to
Мобильная версия