Ben Web Hizmetleri ile deli başlangıç kapalı gidiyorum. Ben PHP kullanarak aşağıdaki WSDL aramak ve hiçbir yerde elde tutmaya çalışıyorum:
http://webservices.sabre.com/wsdl/sabreXML1.0.00/usg/SessionCreateRQ.wsdl
I found the following piece of code on the net, from someone with similar problems, but I could not get it to work either:
$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 "Yanıt:\n".
$soap->_getLastResponseHeaders()."\n";
print "Yanıt:\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'
));
}
I keep getting the following error:
Yanıt: HTTP/1.1 500 Internal Server Error SOAPAction: "" Content-Type: text/xml;charset=utf-8 Date: Sun, 19 Apr 2009 22:21:34 GMT Connection: close Server: SWS
Yanıt:
soap-env:Client.InvalidEbXmlMessageUnable to internalize messagejavax.xml.soap.SOAPException: Unable to internalize message at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImpl.java:135) at com.sun.xml.messaging.saaj.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:32) at com.sabre.universalservices.gateway.control.SoapProcessor.getRequest(SoapProcessor.java:263) at com.sabre.universalservices.gateway.control.WSGateway.handleRequest(WSGateway.java:380) at com.sabre.universalservices.gateway.control.WSGateway.doPost(WSGateway.java:306) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508) at java.lang.Thread.run(Thread.java:595) Caused by: 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 more
SoapFault Object ( [message:protected] => Unable to internalize message [string:private] => .....
Bu hizmet, sistemde beni doğrulayarak ve daha sonraki aramalarda kullanılmak üzere bir güvenlik nesnesi döndüren olmalı - bir dize ben sonra aşağıdaki aramalar için bir oturum değişkeni saklayabilirsiniz (?).
Herhangi bir yardım büyük takdir!