Solved

What is the best way to resolve a web service call issue between two programmers?

Posted on 2011-09-06
3
333 Views
Last Modified: 2012-05-12
I have written code in both Java and C# to call a web services method on a third party web site.  I receive an "Invalid Request" response.  I told the programmer for the web service that I thought I did everything right and got this response.  He said to "Please send [him] the full request you are sending, header, body & timestamp and we’ll check the server log."  How would you generally communicate this with somebody? I created the message in Java and C#, and he doesn't want my code snippet.  Should I capture with wireshark, or is there a generally accepted method or some other convenient often use tool(s) that people use for this?  Is this a reasonable request, or since nobody is using their web service but me yet, isn't it reasonable for me to just ask them to look at their logs?
0
Comment
Question by:mvhughes
3 Comments
 
LVL 23

Accepted Solution

by:
Siva Prasanna Kumar earned 300 total points
ID: 36496914
He is requesting for the SOAP Request you have used for invoking the webservice.

Nothing wrong in providing the auto generated SOAP Request which you sent if there is a  issue in your request he will be able to pin point and assist you better.

Use fiddler or wireshark if you are not logging your SOAP Request and send it to him (I believe no harm in it).

It is a reasonable request considering that you are writing the client in some other language and also at the end of the day every thing will be in terms of SOAP msgs so it doesn't really matter what code you wrote all it matters is weather the request which arrived at the server is in acceptable format.

0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 200 total points
ID: 36497012
Here is my idea.  Get rid of SOAP entirely.  Instead choose a RESTful interface.  This will tell you more than you want or need to know about REST.
http://en.wikipedia.org/wiki/Representational_state_transfer

To sum up, in a REST environment, every request is atomic and complete, and every response is complete and usually instantaneous.  The protocol is stateless, just like the World-Wide Web.  You would make a GET request to the web service providing your arguments and the service would write "browser output" providing the answers.  This code snippet is in PHP, but I am sure you can get the idea.  REST services are amazingly easy to test because the URL contains the GET arguments, and the information that comes back is in clear text.

Test a simple example on my server here:
http://www.laprbass.com/RAY_REST_get_last_name.php?key=ABC&name=Ray

An example of a reasonably well-documented RESTful interface is here:
http://www.carpool2camp.org/v2api/apidocs.php
<?php // RAY_REST_get_last_name.php
error_reporting(E_ALL);



// DEMONSTRATE HOW A RESTFUL WEB SERVICE WORKS
// INPUT FIRST NAME, OUTPUT FAMILY NAME
// CALLING EXAMPLE:
// file_get_contents('http://laprbass.com/RAY_REST_get_last_name.php?key=ABC&resp=XML&name=Ray');



// OUR DATA MODEL CONTAINS ALL THE ANSWERS - THIS COULD BE A DATA BASE - AS SIMPLE OR COMPLEX AS NEEDED
$dataModel
= array
( 'Brian'   => 'Portlock'
, 'Ray'     => 'Paseur'
, 'Richard' => 'Quadling'
, 'Dave'    => 'Baldwin'
)
;


// RESPONSE CAN BE PLAIN TEXT OR XML FORMAT
$alpha = NULL;
$omega = NULL;
if ( (isset($_GET["resp"])) && ($_GET["resp"] == 'XML') )
{
    // PREPARE THE XML WRAPPER
    $alpha = '<response>';
    $omega = '</response>';
}



// TEST THE 'API KEY' - THIS COULD BE A DATA BASE - AS SIMPLE OR COMPLEX AS NEEDED
$key = (!empty($_GET["key"])) ? $_GET["key"] : FALSE;
if ($key !== 'ABC')
{
    echo $alpha . 'BOGUS API KEY' . $omega;
    die();
}



// LOOK UP THE FAMILY NAME
$name = (!empty($_GET["name"])) ? $_GET["name"] : FALSE;

// IF THE NAME FROM THE URL IS FOUND IN THE DATA MODEL
if (array_key_exists($name, $dataModel))
{
    // RETURNS THE APPROPRIATE FAMILY NAME FROM THE DATA MODEL
    echo $alpha . $dataModel[$name] . $omega;
    die();
}

// RETURNS THE UNKNOWN NAME INDICATOR
else
{
    echo $alpha . 'UNKNOWN' . $omega;
    die();
}

Open in new window

0
 

Author Closing Comment

by:mvhughes
ID: 36497463
I gave more points to the one solution because it was more of a direct answer to my question, but I really appreciate the other information.  Good to know, thank you.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

When coding a Webservice to provide data, the normal way is to create a method that returns a Dataset object.   But a Dataset cannot be used easily from another platform, such as PHP,  FLAS (FLEX) , etc. Solution : Return a XML Document instea…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now