Using XML API Interface through ASP3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mostafa2008
    New Member
    • Nov 2007
    • 1

    Using XML API Interface through ASP3

    I have a test account on hotelbeds.com to use XML Integration service. and the sent me all the xml files and XSDs files PLUS pdf spacification file contains the following example :-
    SOAP message request example
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope
    soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
    <hb:getHotelCategoryList xmlns:hb="http://axis.frontend.hydra.hotelbeds.com" xsi:type="xsd:string">
    <HotelCategoryListRQ echoToken="DummyEchoToken" xmlns="http://www.hotelbeds.com/schemas/2005/06/messages"
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
    xsi:schemaLocation="http://www.hotelbeds.com/schemas/2005/06/messages HotelCategoryListRQ.xsd">
    <Language>ENG</Language>
    <Credentials>
    <User>TEST</User>
    <Password>TEST</Password>
    </Credentials>
    </HotelCategoryListRQ>
    </hb:getHotelCategoryList>
    </soapenv:Body>
    </soapenv:Envelope>
    >>>>>>> my Question is how to implement this request to there server on the fly because they don't have any sample codes to use in ASP , ASP.net or even PHP
    
    bye the wayI tried to use this sample 
    <%
    
    'sforceSoapServer = "Link: "
    sforceSoapServer = "http://212.170.239.71/appservices/http/FrontendService"
    
    'sforceSoapServer = "Link: "
    
    mySoap = "<?xml version=""1.0"" encoding=""UTF-8""?>" 
    mySoap=mySoap& "<soapenv:Envelope soapenv:encodingStyle=""http://schemas.xmlsoap.org/soap/encoding/""" 
    mySoap=mySoap& " xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">"
    mySoap=mySoap& "<soapenv:Body>"
    mySoap=mySoap& "<hb:getHotelCategoryList xmlns:hb=""http://axis.frontend.hydra.hotelbeds.com"" xsi:type=""xsd:string"">"
    mySoap=mySoap& "<HotelCategoryListRQ echoToken=""DummyEchoToken"" xmlns=""http://www.hotelbeds.com/schemas/2005/06/messages"""
    mySoap=mySoap& "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"""
    mySoap=mySoap& "xsi:schemaLocation=""http://www.hotelbeds.com/schemas/2005/06/messages HotelCategoryListRQ.xsd"">"
    mySoap=mySoap& "<Language>ENG</Language>"
    mySoap=mySoap& "<Credentials>"
    mySoap=mySoap& "<User>******</User>"
    mySoap=mySoap& "<Password>*****</Password>"
    mySoap=mySoap& "</Credentials>"
    mySoap=mySoap& "</HotelCategoryListRQ>"
    mySoap=mySoap& "</hb:getHotelCategoryList>"
    mySoap=mySoap& "</soapenv:Body>"
    mySoap=mySoap& "</soapenv:Envelope>"
    
    strSoapRequest = mySoap
       
    'Build the SOAP header
    Set xmlhttp = CreateObject("Msxml2.ServerXMLHTTP")
    xmlhttp.open "POST", sforceSoapServer, False   'False = do not respond immediately
    xmlhttp.setRequestHeader "Man", POST & " " & sforceSoapServer & " HTTP/1.1"
    xmlhttp.setRequestHeader "Content-Type", "text/xml"
       
    'Send the SOAP request
    xmlhttp.send (strSoapRequest)
    response.write (xmlhttp.responseText)
    
    %>
    but it gets this error
    500 Servlet Exception

    Code:
    java.lang.RuntimeException: FATAL ERROR. Message: 'You are not allowed
    to access the system.'
    	at com.hotelbeds.hydra.frontend.http.HTTPFrontendServlet.doPost(HTTPFrontendServlet.java:1034)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:165)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
    	at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
    	at com.caucho.server.http.Invocation.service(Invocation.java:315)
    	at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
    	at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:253)
    	at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:170)
    	at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
    	at java.lang.Thread.run(Thread.java:534)
    Caused by: com.hotelbeds.hydra.resources.util.user.GrantException
    Code: C01-01-001-TS
    Message: You are not allowed to access the system.
    Detailed message: null
    
    	at com.hotelbeds.hydra.resources.util.user.UserValidation.validateIPAddress(UserValidation.java:590)
    	at com.hotelbeds.hydra.frontend.http.HTTPFro
    >> any help or adive will be appreciated
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Have a look here see if this does anything:


    If that does not work, try the other included through that site:


    Please stay tuned if you need more help.

    In a bit!

    Comment

    • axmuha
      New Member
      • Dec 2007
      • 1

      #3
      you need ask HotelBeds to resolve you IP-address (send message to xml@hotelbeds.c om )

      Originally posted by Mostafa2008
      I have a test account on hotelbeds.com to use XML Integration service. and the sent me all the xml files and XSDs files PLUS pdf spacification file contains the following example :-
      SOAP message request example
      <?xml version="1.0" encoding="UTF-8"?>
      <soapenv:Envelo pe
      soapenv:encodin gStyle="http://schemas.xmlsoap .org/soap/encoding/"
      xmlns:soapenv=" http://schemas.xmlsoap .org/soap/envelope/" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
      <soapenv:Body >
      <hb:getHotelCat egoryList xmlns:hb="http://axis.frontend.h ydra.hotelbeds. com" xsi:type="xsd:s tring">
      <HotelCategoryL istRQ echoToken="Dumm yEchoToken" xmlns="http://www.hotelbeds.c om/schemas/2005/06/messages"
      xmlns:xsi=”http ://www.w3.org/2001/XMLSchema-instance”
      xsi:schemaLocat ion="http://www.hotelbeds.c om/schemas/2005/06/messages HotelCategoryLi stRQ.xsd">
      <Language>ENG </Language>
      <Credentials>
      <User>TEST</User>
      <Password>TES T</Password>
      </Credentials>
      </HotelCategoryLi stRQ>
      </hb:getHotelCate goryList>
      </soapenv:Body>
      </soapenv:Envelop e>
      >>>>>>> my Question is how to implement this request to there server on the fly because they don't have any sample codes to use in ASP , ASP.net or even PHP

      bye the wayI tried to use this sample
      <%

      'sforceSoapServ er = "Link: "
      sforceSoapServe r = "http://212.170.239.71/appservices/http/FrontendService "

      'sforceSoapServ er = "Link: "

      mySoap = "<?xml version=""1.0"" encoding=""UTF-8""?>"
      mySoap=mySoap& "<soapenv:Envel ope soapenv:encodin gStyle=""http://schemas.xmlsoap .org/soap/encoding/"""
      mySoap=mySoap& " xmlns:soapenv=" "http://schemas.xmlsoap .org/soap/envelope/"" xmlns:xsi=""htt p://www.w3.org/2001/XMLSchema-instance"">"
      mySoap=mySoap& "<soapenv:Body> "
      mySoap=mySoap& "<hb:getHotelCa tegoryList xmlns:hb=""http ://axis.frontend.h ydra.hotelbeds. com"" xsi:type=""xsd: string"">"
      mySoap=mySoap& "<HotelCategory ListRQ echoToken=""Dum myEchoToken"" xmlns=""http://www.hotelbeds.c om/schemas/2005/06/messages"""
      mySoap=mySoap& "xmlns:xsi=""ht tp://www.w3.org/2001/XMLSchema-instance"""
      mySoap=mySoap& "xsi:schemaLoca tion=""http://www.hotelbeds.c om/schemas/2005/06/messages HotelCategoryLi stRQ.xsd"">"
      mySoap=mySoap& "<Language> ENG</Language>"
      mySoap=mySoap& "<Credentia ls>"
      mySoap=mySoap& "<User>**** **</User>"
      mySoap=mySoap& "<Password>**** *</Password>"
      mySoap=mySoap& "</Credentials>"
      mySoap=mySoap& "</HotelCategoryLi stRQ>"
      mySoap=mySoap& "</hb:getHotelCate goryList>"
      mySoap=mySoap& "</soapenv:Body>"
      mySoap=mySoap& "</soapenv:Envelop e>"

      strSoapRequest = mySoap

      'Build the SOAP header
      Set xmlhttp = CreateObject("M sxml2.ServerXML HTTP")
      xmlhttp.open "POST", sforceSoapServe r, False 'False = do not respond immediately
      xmlhttp.setRequ estHeader "Man", POST & " " & sforceSoapServe r & " HTTP/1.1"
      xmlhttp.setRequ estHeader "Content-Type", "text/xml"

      'Send the SOAP request
      xmlhttp.send (strSoapRequest )
      response.write (xmlhttp.respon seText)

      %>
      but it gets this error
      500 Servlet Exception

      java.lang.Runti meException: FATAL ERROR. Message: 'You are not allowed
      to access the system.'
      at com.hotelbeds.h ydra.frontend.h ttp.HTTPFronten dServlet.doPost (HTTPFrontendSe rvlet.java:1034 )
      at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:165)
      at javax.servlet.h ttp.HttpServlet .service(HttpSe rvlet.java:103)
      at com.caucho.serv er.http.FilterC hainServlet.doF ilter(FilterCha inServlet.java: 96)
      at com.caucho.serv er.http.Invocat ion.service(Inv ocation.java:31 5)
      at com.caucho.serv er.http.CacheIn vocation.servic e(CacheInvocati on.java:135)
      at com.caucho.serv er.http.HttpReq uest.handleRequ est(HttpRequest .java:253)
      at com.caucho.serv er.http.HttpReq uest.handleConn ection(HttpRequ est.java:170)
      at com.caucho.serv er.TcpConnectio n.run(TcpConnec tion.java:139)
      at java.lang.Threa d.run(Thread.ja va:534)
      Caused by: com.hotelbeds.h ydra.resources. util.user.Grant Exception
      Code: C01-01-001-TS
      Message: You are not allowed to access the system.
      Detailed message: null

      at com.hotelbeds.h ydra.resources. util.user.UserV alidation.valid ateIPAddress(Us erValidation.ja va:590)
      at com.hotelbeds.h ydra.frontend.h ttp.HTTPFro

      >> any help or adive will be appreciated

      Comment

      Working...