I am new to the world of SOAP and XML for that matter. Some of the jargon and what not has been a little daunting.
I am trying to write a SOAP client. I have been provided with XML Schemas of the two web services as well as WSDL schemas. While there are two services, there seems to be several different methods (?) that I can call (e.g. RetrieveOfficeData, RetrieveListingData, etc.).
I was also provided with the following SOAP Example, but am sadly having trouble discerning what is what within the example:
POST /evernetqueryservice/evernetquery.asmx HTTP/1.1
Host: evernet.nwmls.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.nwmls.com/EverNetServices/RetrieveOfficeData"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x
+mlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schema
+s.xmlsoap.org/soap/envelope/">
<soap:Body>
<RetrieveOfficeData xmlns="http://www.nwmls.com/EverNetServices">
<v_strXmlQuery>string</v_strXmlQuery>
</RetrieveOfficeData>
</soap:Body>
</soap:Envelope>
I have written the following, small perl code to try to work with this method:
#!/usr/bin/perl
use strict;
use SOAP::Lite;
my $num= shift; $num=~/^\d+$/ or die "USAGE: $0 num/n";
my ($server,$endpoint,$soapaction,$method,$method_urn);
$server='http://evernet.nwmls.com';
$endpoint="$server/evernetqueryservice/evernetquery.asmx";
$soapaction="http://www.nwmls.com/EverNetServices/RetrieveOfficeData";
$method='RetrieveOfficeData';
$method_urn='http://www.nwmls.com/EverNetServices';
my $num2words=SOAP::Lite->new(uri=>$soapaction,
proxy=>$endpoint);
my $response=$num2words ->
call(SOAP::Data->name($method)
->attr({xmlns=>$method_urn})
=>#Arguments listed next
SOAP::Data->name(v_strXmlQuery=>$num));
if ($response->fault){
printf "A fault (%s) occurred: %s\n",
$response->faultcode,$response->faultstring;
}
else
{ print "$response->result\n";
}
exit;
When I run this, I get the following error:
A fault (soap:Client) occurred: Server did not recognize the value of
HTTP Header SOAPAction:
http://www.nwmls.com/EverNetServices#RetrieveOfficeData.
So I am thinking that I am confusing things when I assign the method, urn, enpoint, etc.
Given the example provided, how would I decode the following elements:
server, endpoint (proxy), soapaction (uri), method, method_urn?
Regards
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.