Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 7 of 7

Thread: Basic WS in SM7.10

  1. #1
    Senior Member
    Join Date
    Sep 2008
    Posts
    115

    Default Basic WS in SM7.10

    Has anyone got SM7.10 WS's working via something other than Connect-IT? I'm having issues getting the OOB examples working, as well as a basic PHP attempt. The error I get both times is a 307 Redirect Error.

    My PHP error is below:
    HTTP Error: Unsupported HTTP response status 307 Temporary Redirect (soapclient->response has contents of the response)

    I'm using the nusoap library, which I downloaded and then a quick bit of PHP to test.

    Code:
    <?
       require_once('lib/nusoap.php');
       $client = new nusoap_client('http://<servername>:13080/SM/7/IncidentManagement.wsdl');
       $result = $client->call('RetrieveIncidentRequest', array('IncidentId' => 'IM000010394'));
       $err =$client->getError();
       print $err;
       print_r($result);
    ?>
    Anyone able to get this simple scenario working on their SM7.10 environment?

    Regards

  2. #2
    Junior Member
    Join Date
    Feb 2008
    Location
    Toronto, Canada
    Posts
    11

    Default

    I tried for weeks to get the nusoap library to work with SC 6.2 and was completely frustrated by PHP's implementation of WSDL support. I was never able to get the user auth to work.

    Do post if you are able to get this to work.

    /.d

  3. #3
    Junior Member
    Join Date
    Oct 2007
    Location
    Chicago
    Posts
    12

    Default

    Quote Originally Posted by leonv View Post
    Has anyone got SM7.10 WS's working via something other than Connect-IT? I'm having issues getting the OOB examples working, as well as a basic PHP attempt. The error I get both times is a 307 Redirect Error.

    My PHP error is below:
    HTTP Error: Unsupported HTTP response status 307 Temporary Redirect (soapclient->response has contents of the response)

    I'm using the nusoap library, which I downloaded and then a quick bit of PHP to test.

    Code:
    <?
       require_once('lib/nusoap.php');
       $client = new nusoap_client('http://<servername>:13080/SM/7/IncidentManagement.wsdl');
       $result = $client->call('RetrieveIncidentRequest', array('IncidentId' => 'IM000010394'));
       $err =$client->getError();
       print $err;
       print_r($result);
    ?>
    Anyone able to get this simple scenario working on their SM7.10 environment?

    Regards
    Due in part to the customizations to our system, I've never gotten the OOB examples to work without heavy modification. I have however successfully built fresh Java client libraries using Axis and WSDL2Java.

    One of the challenging aspects of utilizing SM7's web services is the complex nature of the request objects that must be built, and constructing a SOAP envelope while fully accounting for all of the fields expected by the service can be a bit of a challenge.

    I've not used NuSOAP personally, but based on the example you pasted, and on some brief skimming over NuSOAP's documentation, I suspect that the envelope being generated is not adequate to make the call. The server generally expects a fully built request object (as defined in the WSDL) which will include a model, instance, instance header, keys, and possibly a few other structures. If the request isn't "perfect", things usually go south with very little feedback from the server.

    I'd strongly recommend giving a tool like soapUI a try, as it will introspect the WSDLs and generate full request envelopes for testing. Even if you eventually implement your solution in PHP, the feedback from soapUI can be invaluable when determining how you must construct your requests, a process that appears to be somewhat manual with NuSOAP.

    Josh

  4. #4
    Senior Member
    Join Date
    Sep 2008
    Posts
    115

    Default

    Well, a long time on and after many frustrating hours with SM7 WS, I've finally gotten this to work using PHP, including extracting the attachments and displaying them (which to be honest was my main goal, as I'm using SQL queries to display the data).

    The code is a bit rough at the moment, but if anyone is interested, I'm more than happy to post a rough 'how-to'. I'm using the nusoap library and once some slight modifications are made, it's easy to get working.

  5. #5
    Administrator tommy's Avatar
    Join Date
    Nov 2001
    Location
    Copenhagen
    Posts
    4,271

    Default

    Quote Originally Posted by leonv View Post
    Well, a long time on and after many frustrating hours with SM7 WS, I've finally gotten this to work using PHP, including extracting the attachments and displaying them (which to be honest was my main goal, as I'm using SQL queries to display the data).

    The code is a bit rough at the moment, but if anyone is interested, I'm more than happy to post a rough 'how-to'. I'm using the nusoap library and once some slight modifications are made, it's easy to get working.
    I am interested :-)
    Best regards Tommy
    Blog - - ITIL certified - Accredited Integration Specialist – HP OpenView Service Management

    Want to keep this site alive? Consider making a donation. Click here.

  6. #6
    Junior Member
    Join Date
    Mar 2010
    Posts
    12

    Default

    Quote Originally Posted by leonv View Post
    The code is a bit rough at the moment, but if anyone is interested, I'm more than happy to post a rough 'how-to'. I'm using the nusoap library and once some slight modifications are made, it's easy to get working.
    I'm interested, would like to see the code. I guess, it'll give the users a jumpstart on WSDL.

  7. #7
    Senior Member
    Join Date
    Sep 2008
    Posts
    115

    Default

    Quote Originally Posted by youngster View Post
    I'm interested, would like to see the code. I guess, it'll give the users a jumpstart on WSDL.
    I've posted it here http://www.sc-resources.net/threads/6062-PHP-and-Attachments-How-To

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Bookmarks

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