+ Reply to Thread
Results 1 to 5 of 5

 

Thread: PHP and SOAP

  1. #1
    Affiliateer

    Status
    Offline
    Join Date
    Jul 2005
    Location
    The Toon
    Posts
    920
    Thanks
    4
    Thanked 1 Time in 1 Post


    Hi Guys,

    Do any of you guys have experience with PHP and SOAP? Im a PHP whizz in my former days but ive never combined it with SOAP at all! Ive just got the opportunity to write a system to check availability of flights, hotels etc and book them but I obviously don't want to say I can do it if I can't :P

    Would you say that it is hard or can it be picked up fairly easily. It seems to me as though its just like calling databases but instead you call SOAP which in turn talks to the other side of the fence on their system and returns the results.

    Any comments would be appreciated because if it will take forever I don't really want to mess with it as I can make money other ways

    Thanks guys.

  2. #2
    Registered User

    Status
    Online
    Join Date
    Mar 2004
    Location
    Stafford, UK
    Posts
    322
    Thanks
    1
    Thanked 4 Times in 2 Posts
    SOAP should be straight forward but it isn't.

    * There are inter-operability issues between various libraries regarding data type representation. There seem to be issues around how boolean values should be serialised even though the specification makes it quite clear.

    * Debugging is be a pain. You squirt some XML into the ether and nothing happens. What went wrong? Was there even a SOAP server at the specified endpoint URL? Ok, so there was a server, but did the server not understand your SOAP envelope? Ok, so it understood your envelope but perhaps the application didn't like the values you sent. 10 pages of servlet.foo.BANG error messages don't help.

    There are more niggles, but they just come out as you try and use it. I know i'm not the only developer to have ended up hard coding request envelopes because they just can't get their SOAP client implementation to get on with whatever dialect of SOAP the server is talking.

    It all just seems SO fragile. It's absolutely horrible to work with.
    Developer of the Price Tapestry Price Comparison Script now with full WordPress Plugin!

  3. #3
    Affiliateer

    Status
    Offline
    Join Date
    Jul 2005
    Location
    The Toon
    Posts
    920
    Thanks
    4
    Thanked 1 Time in 1 Post
    Yes im beginning to feel it but then again I don't know much about SOAP so it could just be me.

    Im trying to use nusoap as it seems the simplest to impliment. My only issue is I cannot even get the first function to be called. I just get a return saying that StartSessionRequest is unrecognised operation!

    Im already scratching my head and thinking erm... maybe not!

    Code:
    Fault
    Array
    (
        [faultcode] => env:Client
        [faultstring] => JAXRPCTIE01: caught exception while handling request: unrecognized operation: {http://tempuri.org}StartSessionRequest
    )
    Its just a simple function which is supposed to accept a user pass and language to get a session returned so you can start. But it aint working!

    Im rocking in my chair!

  4. #4
    Registered User

    Status
    Offline
    Join Date
    May 2005
    Location
    London
    Posts
    49
    Thanks
    0
    Thanked 4 Times in 2 Posts
    Hi

    SOAP is definitely badly named as the "Simple" protocol but IMO it is worth the effort. Once you get different systems talking to each other its great.

    Starting with sessions is jumping in at the deep end and usually sessions are best avoided in a web service context (PHP sessions rely on cookies or passing SID in the url); in a web service context the client isn't a web browser so it may or may not be able to support a session.

    Most web services rely on sending user name and pass with every request.

    The latest version of nusoap (1.5) has good support for wsdl and copes well with different sorts of data. Also the nusoap mailing list is good; you'll normally get a same day response.

    I would throughly recommend starting with a good tutorial at:
    http://www.scottnichol.com/nusoapintro.htm

    Clear with code examples you can copy and paste.

    Good luck.
    Peter Dunham
    Webgains

  5. #5
    Affiliateer

    Status
    Offline
    Join Date
    Jul 2005
    Location
    The Toon
    Posts
    920
    Thanks
    4
    Thanked 1 Time in 1 Post
    Hi mate,

    Thanks for the help. I'll take a look at that site for the tutorials and give it a whirl. Excuse me for the delay in replying but I have not been around much this week as my partner took a ceasure last Friday and things have been hectic since. So im struggling to get the time to post at present.

    Ive been given code such as this in a manual but its all new to me and going to have to find a starting point to get a foothold because at present im just getting errors.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <LoginWeb xmlns="http://www.domain.com/somewhere/">
          <strErrMessage>string</strErrMessage>
          <strLoginID>string</strLoginID>
          <strPwd>string</strPwd>
        </LoginWeb>
      </soap:Body>
    </soap:Envelope>
     
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <LoginWebResponse xmlns="http://www.domain.com/somewhere/">
          <LoginWebResult>string</LoginWebResult>
          <strErrMessage>string</strErrMessage>
        </LoginWebResponse>
      </soap:Body>
    </soap:Envelope>

+ Reply to Thread


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Amazon ECS PHP API
    By MikkyX in forum Programming
    Replies: 0
    Last Post: 11-10-04, 01:57 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2