Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

soaplite · SOAP::Lite for Perl (soaplite.com)

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 1205
  • Category: Protocols
  • Founded: Jan 28, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 6555 - 6584 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#6555 From: "Martin Busik" <martin.busik@...>
Date: Tue Jan 4, 2011 2:09 pm
Subject: AW: Second Call of WebService fails: Died. at C:/Perl/site/lib/SOAP/Lite.pm line 1412
mbusik70
Send Email Send Email
 
Hi Andres,
well, SOAP is an acronym for "is not simple, is not object, is not
application, is not protocol" :-)

> But why is it a methode? according the WSDL it is the first
> element called "CustomerAccount".

In the early days of webservices, the xml element inside a "soap:Body" was
refered to as "method name",
therefore, I suppose, people started to implement webservices in a
proxy.methodName() ($soap->CustomerAccount)
way. It is just a naming convention, not more.

> In my different trials I also tried a version without
> serializer. I allways tried to build the whole request inside
> one SOAP::DATA....

unfortunately, the default implementation of Serializer::envelope() does not
support this.

> So why do I have to do that with two
> SOAP::DATA ($method and $request)?
> I never found that in the Soap cookbook.

May be some of the cookbook maintainers are reading this list and could
clarify the specs.
(I'd volunteer to submit some examples, if needed)

Cheers,
Martin

#6556 From: "Scott" <scott.hall1128@...>
Date: Wed Jan 12, 2011 11:12 pm
Subject: help with SOAP::Lite client connecting to ASP.NET Windows Service App
scott.hall1128
Send Email Send Email
 
I'm having troubles getting my client to send values to function.  I need a perl
client to send this structure:

POST /VSMapi/VSMapi.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://g3w0877.americas.hpqcorp.net/VSMapi/Test"

<?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>
     <Test xmlns="http://g3w0877.americas.hpqcorp.net/VSMapi/">
       <x1>string</x1>
       <x2>string</x2>
     </Test>
   </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?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>
     <TestResponse xmlns="http://g3w0877.americas.hpqcorp.net/VSMapi/">
       <TestResult />
     </TestResponse>
   </soap:Body>
</soap:Envelope>

Here is my client :
use SOAP::Lite +trace => 'debug';

my $function = 'test';
my $soap = SOAP::Lite
     -> uri('http://myserver/VSMapi/VSMapi.asmx')
     -> on_action( sub { join '/', 'http://myserver/VSMapi', $_[1] } )
     -> proxy('http://myserver/VSMapi/VSMapi.asmx');

$function = 'Test';
$result = $soap->$function
							 (\SOAP::Data->value(
							 (SOAP::Data->name('x1')->type(string => ' what the '),
                SOAP::Data->name('x2')->type(string => 'heck')
)))->result;
print $result;

Here is the debugging results.  I can't figure out why the service isn't
accepting the parameters.

SOAP::Transport::HTTP::Client::send_receive: POST
http://myserver/VSMapi/VSMapi.asmx HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 542
Content-Type: text/xml; charset=utf-8
SOAPAction: http://myserver/VSMapi/Test

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><Test
xmlns="http://myserver/VSMapi/VSMapi.asmx"><c-gensym3><x1 xsi:type="xsd:string">
what the </x1><x2
xsi:type="xsd:string">heck</x2></c-gensym3></Test></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Date: Wed, 12 Jan 2011 23:08:15 GMT
Server: Microsoft-IIS/6.0
Content-Length: 382
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 12 Jan 2011 23:08:15 GMT
Client-Peer: 16.233.58.154:80
Client-Response-Num: 1
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><TestResponse
xmlns="http://myserver/VSMapi/"><TestResult
xsi:type="xsd:string">accepted</TestResult></TestResponse></soap:Body></soap:Env\
elope>

#6557 From: warren@...
Date: Mon Jan 10, 2011 4:15 pm
Subject: Anybody have an Exchange 2007 server to test EWS [SOAP] access?
warren_m_smith
Send Email Send Email
 
This is probably an odd request, but I have been asked to update
Email::Folder::Exchange to support Exchange 2007. Exchange 2007 no longer does
WebDAV by default, and uses SOAP for it's EWS service. I've been developing and
testing with a free account from microsoftonline.com and have the module working
with that specific implementation.

Does anyone have an Exchange 2007 server that could provide me with a temporary
account to confirm that the EWS on the hosted platform [microsoftonline.com] is
the same as the EWS on deployed platform?

-Warren

#6558 From: "Martin Busik" <martin.busik@...>
Date: Thu Jan 13, 2011 11:30 am
Subject: AW: help with SOAP::Lite client connecting to ASP.NET Windows Service App
mbusik70
Send Email Send Email
 
Hi,

> I need a perl client to send this structure:
>
> SOAPAction: "http://g3w0877.americas.hpqcorp.net/VSMapi/Test"
> ...
> Here is the debugging results.  I can't figure out why the
> service isn't accepting the parameters.
>
> SOAPAction: http://myserver/VSMapi/Test

The header "SOAPAction" is the Problem, you should write something like:

$soap = SOAP::Lite->...
$soap->on_action( sub{ "http://g3w0877.americas.hpcorp.net/".$_[1] } );

or - as a starting point:

$soap->on_action( qub { "http://g3w0877.americas.hpqcorp.net/VSMapi/Test" }
);

Cheers,
Martin

#6559 From: "gtbaddy" <patrickh@...>
Date: Thu Jan 13, 2011 9:48 pm
Subject: Problems using SOAP::Data as method parameters
gtbaddy
Send Email Send Email
 
Hi, I have been banging my head against the wall for a few days attempting to
get SOAP requests working with this WSDL. I am trying to send a request to a
method using SOAP::Data and SOAP::Header objects, but I keep getting a response
of

"String value expected instead of SOAP::Data reference"

Below is my code -- any ideas what I am doing wrong? I am new to SOAP, so excuse
me if I am missing something fundamental.




#!/usr/bin/perl -w
use strict;
use SOAP::Lite;

# location of the wsdl & namespace
my $wsdl =
'https://s7sps1apissl.scene7.com/scene7/webservice/IpsApi-2010-01-31.wsdl';
my $apins = 'http://www.scene7.com/IpsApi/xsd/2010-01-31';

# authentication request headers
my @headers = (
     SOAP::Header->name('user')->value('myuser')->uri($apins),
     SOAP::Header->name('password')->value('mypass')->uri($apins),
     SOAP::Header->name('appName')->value('myapp')->uri($apins),
     SOAP::Header->name('appVersion')->value('0.01')->uri($apins)
);

# make proxy for the service
my $soap = SOAP::Lite->service($wsdl);

# add fault hanlder
$soap->on_fault(

     sub { # SOAP fault handler
         my $soap = shift;
         my $res = shift;

         # Map faults to exceptions
         if(ref($res) eq '') {
             die($res);
         }
         else {
             die($res->faultstring);
         }

         return new SOAP::SOM;
     }

);

# request method
print $soap->checkLogin( SOAP::Data->name(email => 'testuser'),
SOAP::Data->name(password => 'testpassword'), @headers );




Thanks,
Patrick

#6560 From: "Martin Busik" <martin.busik@...>
Date: Fri Jan 14, 2011 2:40 pm
Subject: AW: Problems using SOAP::Data as method parameters
mbusik70
Send Email Send Email
 
Hi,

> Hi, I have been banging my head against the wall for a few
> days attempting to get SOAP requests working with this WSDL.
> I am trying to send a request to a method using SOAP::Data
> and SOAP::Header objects, but I keep getting a response of
>
> "String value expected instead of SOAP::Data reference"
>
> Below is my code -- any ideas what I am doing wrong? I am new
> to SOAP, so excuse me if I am missing something fundamental.

> # location of the wsdl & namespace
> my $wsdl =
> 'https://s7sps1apissl.scene7.com/scene7/webservice/IpsApi-2010
> -01-31.wsdl';
> my $apins = 'http://www.scene7.com/IpsApi/xsd/2010-01-31';
>
> # authentication request headers
> my @headers = (
>     SOAP::Header->name('user')->value('myuser')->uri($apins),
>     SOAP::Header->name('password')->value('mypass')->uri($apins),
>     SOAP::Header->name('appName')->value('myapp')->uri($apins),
>     SOAP::Header->name('appVersion')->value('0.01')->uri($apins)
> );
>
> # make proxy for the service
> my $soap = SOAP::Lite->service($wsdl);
>
> # request method
> print $soap->checkLogin( SOAP::Data->name(email =>
> 'testuser'), SOAP::Data->name(password => 'testpassword'), @headers );

In this case, SOAP::Lite tries to construct the request itself.

use $soap->call('checkLogin',$SOAP::Data,@headers) instead

eventually you have to completely ignore the wsdl and configure the $soap
object
manually, e.g.

$soap = SOAP::Lite->uri(...)->proxy(...)

Cheers,
Martin

#6561 From: "Martin Busik" <martin.busik@...>
Date: Fri Jan 14, 2011 3:56 pm
Subject: AW: Problems using SOAP::Data as method parameters
mbusik70
Send Email Send Email
 
Hi,

> I tried using the call method previously but it would always
> warn me that no proxy was defined. I was unsure what value to
> use as a proxy -- is that something that is defined anywhere
> in the WSDL file? I was looking at the CPAN documentation and


with proxy($url) you set the endpoint url, i.e. the url you will find in the
wsdl under:

<wsdlsoap:address location="$url"

(typically, near the end of the wsdl)



> Also, is there a way for me to view the XML I am producing
> with my SOAP::Data / SOAP::Header objects to debug what I am
> generating?

yep.

use SOAP::Lite (+trace => [qw(transport debug parameters)]);

Cheers,
Martin

#6562 From: "gtbaddy" <patrickh@...>
Date: Fri Jan 14, 2011 5:25 pm
Subject: Adding attributes to envelope tag / changing name of a body tag
gtbaddy
Send Email Send Email
 
Hi, thanks to the help Martin gave me in my previous post I am getting much
closer to having things working. I am successfully sending calls to the service
using SOAP::Lite now, but I am still having trouble getting it to build the XML
exactly as I need it.

I have been using the tool soapUI to test some calls to this web service, so it
has been a good help since it gives me some examples of what XML works with this
web service. I have been comparing it with the XML that SOAP::Lite is generating
and I have identified the two parts that are wrong causing my calls not to work.

1. My call from SOAP::Lite uses the following envelope tag:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

I need to get the envelop tag to have these attributes instead:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsd="http://www.scene7.com/IpsApi/xsd"
xmlns:ns="http://www.scene7.com/IpsApi/xsd/2010-01-31">


Is there a way for me to have precise control over the those namespace
attributes on the envelope (specifically xmlns:xsd & xmlns:ns)?

2. I am using the following code to pass paramaters to the method checkLogin:

my $params = SOAP::Data->name("ns:checkLoginParam" =>
\SOAP::Header->value(
     SOAP::Header->name('ns:email')->value($s7user)->type(''),
     SOAP::Header->name('ns:password')->value($s7pass)->type(''),
));

# request method
$soap->call('checkLogin', $params, $authHeader);


.. this produces the following xml ...

<soap:Body>
<checkLogin xmlns="http://www.scene7.com/IpsApi/xsd/2010-01-31">
<ns:checkLoginParam>
<ns:email>myemail/ns:email>
<ns:password>mypass</ns:password>
</ns:checkLoginParam>
</checkLogin>
</soap:Body>

Is there a way for me to remove the checkLogin tag from being wrapped around
checkLoginParam? The working code that I have from soapUI that I am attempting
to reproduce is this:

<soap:Body>
<ns:checkLoginParam>
<ns:email>myemail</ns:email>
<ns:password>mypass</ns:password>
</ns:checkLoginParam>
</soap:Body>

Thanks for your time all,
Patrick

#6563 From: Blaine Everingham <blaine.w.everingham@...>
Date: Fri Jan 14, 2011 8:00 pm
Subject: SOAP::Lite element order issue.
blaine.w.everingham@...
Send Email Send Email
 
Hi,

I'm trying to use SOAP::Lite to contact a web service. However, I can not get the parameters under the request element.


Below is my sample code:


my $soap = SOAP::Lite
    -> service($wsdl);
$soap->readable(true);

my @params = ();
push (@params, SOAP::Data->name( "locale" )->value( 'en_US' ) );
push (@params, SOAP::Data->name( "hotelId" )->value( 134168 )->type('long'));
push (@params, SOAP::Data->name( "wsMinorRev" )->value( 4 ));
push (@params, SOAP::Data->name( "cid" )->value( 1 )->type('long'));

$soap->getPropertyInformation(  @params  );


Which produces:
  <soap:Body>
    <info:getPropertyInformation>
      <request xsi:nil="true" xsi:type="info:PropertyInformationRequest" />
      <hotelId xsi:type="xsd:long">134168</hotelId>
      <wsMinorRev xsi:type="xsd:int">4</wsMinorRev>
      <cid xsi:type="xsd:long">1</cid>
    </info:getPropertyInformation>
  </soap:Body>


Note that the above code the request property is closed and the other elements are appended under the getPropertyInformation instead of under the request.



Below is what I would like it to look like:
   <soap:Body>
      <info:getPropertyInformation soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <request xsi:type="info:PropertyInformationRequest">
            <wsMinorRev xsi:type="com:WsMinorRevType" xmlns:com="http://common.xml.travelnow.com">4</wsMinorRev>
            <cid xsi:type="xsd:long">1</cid>
            <locale xsi:type="xsd:string">fr_FR</locale>
            <hotelId xsi:type="xsd:long">161793</hotelId>
         </request>
      </info:getPropertyInformation>
   </soapenv:Body>


All tips are welcome!


#6564 From: "peterafriend" <pafriend@...>
Date: Thu Jan 20, 2011 12:45 am
Subject: bad interaction between SOAP:Lite and retry mechanism in Crypt-SSLeay
peterafriend
Send Email Send Email
 
Within the Crypt-SSLeay code there is a retry mechanism that gets triggered if
there is a connection failure before the SSL handshake completes. By default,
the SSLv23 compatibility mode is used first and when that fails, SSLv3 is tried,
followed by SSLv2. The problem I have seen is that if the initial connection
attempt gets a RST and the SSL module retries with V3, the code hangs forever or
the connection is timed out and reset. The reason is that the SOAP request is
never sent when the retry is done within Crypt-SSLeay. From my testing this
appears to be a bad interaction between SOAP:Lite and Crypt-SSLeay, as other
modules using Crypt-SSLeay don't run into this problem. If you have two machines
handy, you can test this yourself:

Cheesy test program:

#!/usr/local/bin/perl -w

use SOAP::Lite;
my $soap = SOAP::Lite->new( proxy => 'https://localhost/');
$soap->default_ns('urn:HelloWorld');
my $som = $soap->call('sayHello', SOAP::Data->name('name')->value('Foo'),
SOAP::Data->name('givenName')->value('Bar'));
die $som->faultstring if ($som->fault);
print $som->result, "\n";

Run openssl on server:

sudo openssl
% sudo /usr/bin/openssl
OpenSSL> s_server -accept 443 -no_ssl2 -no_tls1 -ssl3 -key key.pem -cert crt.pem
-www
Using default temp DH parameters
ACCEPT

The -no_ssl2 is used to try to trigger the failure of the initial connection
attempt. It generates a FIN instead of a RST, but still works.

Now run the test script. If you trace this in tcpdump you will see the initial
connection attempt which will get closed because the SSL ClientHello is version
2. The connection is re-established, an SSLv3 ClientHello is sent and the SSL
handshake is completed. At this point things should just hang, since the SOAP
request is never sent.

#6565 From: "Scott" <scott.hall1128@...>
Date: Wed Jan 26, 2011 6:50 pm
Subject: soap client aborts during transport
scott.hall1128
Send Email Send Email
 
While testing our asp.net web app service we noticed that the client aborts if
the service id down.  For example if port 80 is unavailable the client aborts
with a 500 internal server error.  I have worked around this issue by placing an
eval block but my question is why would it do that.  This doesn't seem to be
practical or normal behavior to exit the script on an error.  Is this a possible
client coding issue where i am not handling this properly?

CLIENT CODE:
use SOAP::Lite +trace => 'debug';
use VSM::VSMWindows;

my $serviceNs = 'http://g5w2502g.atlanta.hp.com/VSMapi';
my $serviceProxy = 'http://g5w2502g.atlanta.hp.com/VSMapi/VSMapi.asmx';

my ($soap_depot_stat,$soap_msg) =
VSM::VSMWindows::CheckStatus('serviceNS'=>$serviceNs, 'proxy'=>$serviceProxy);

print "$soap_depot_stat,$soap_msg\n";

CLIENT FUNCTION:
sub CheckStatus {
	 my $function = 'CheckStatus';
	 my $SUB = $MODULE . '::' . $function;
	 my %args = @_;
	 my $serviceNs = $args{'serviceNS'};
	 my $serviceProxy = $args{'proxy'};
	 my $stat = '';
	 my $retmsg = '';

	 my $soap = SOAP::Lite
			 -> uri($serviceNs . '/')
			 -> on_action( sub { join '/', $serviceNs, $_[1] } )
			 -> proxy($serviceProxy);

	 if ($soap) {
		 $retmsg = $soap
		 -> CheckStatus()
		 -> result;

		 if (!defined($retmsg)) {
			 $stat = $FALSE;
			 $retmsg = "SOAP FAULT ERROR";
		 } else {
			 $stat = $TRUE;
		 }
	 } else {
		 $retmsg = "SOAP connection Failure";
		 $stat = $FALSE;
	 }
	 return $stat,$retmsg;
}

CLIENT OUTPUT:
schall/soap $ ./client.pl
SOAP::Transport::HTTP::Client::send_receive: POST http://.../VSMapi/VSMapi.asmx
HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 444
Content-Type: text/xml; charset=utf-8
SOAPAction: http://..../VSMapi/CheckStatus

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><CheckStatus
xmlns="http://..../VSMapi/" xsi:nil="true" /></soap:Body></soap:Envelope>
SOAP::Transport::HTTP::Client::send_receive: 500 Can't connect to ....:80
(connect: Invalid argument)
Content-Type: text/plain
Client-Date: Wed, 26 Jan 2011 18:13:07 GMT
Client-Warning: Internal response

500 Can't connect to ....:80 (connect: Invalid argument)
500 Can't connect to ....:80 (connect: Invalid argument)

#6566 From: "Martin Busik" <martin.busik@...>
Date: Thu Jan 27, 2011 8:50 am
Subject: AW: soap client aborts during transport
mbusik70
Send Email Send Email
 
Hi Scott,
using

eval {
...
}
if($@) {
...
}

is a common try/catch pattern. I do not see anything suspect/wrong with
that.

cheers,
Martin


> -----Ursprüngliche Nachricht-----
> Von: soaplite@yahoogroups.com
> [mailto:soaplite@yahoogroups.com] Im Auftrag von Scott
> Gesendet: Mittwoch, 26. Januar 2011 19:50
> An: soaplite@yahoogroups.com
> Betreff: [soaplite] soap client aborts during transport
>
> While testing our asp.net web app service we noticed that the
> client aborts if the service id down.  For example if port 80
> is unavailable the client aborts with a 500 internal server
> error.  I have worked around this issue by placing an eval
> block but my question is why would it do that.  This doesn't
> seem to be practical or normal behavior to exit the script on
> an error.  Is this a possible client coding issue where i am
> not handling this properly?
>
> CLIENT CODE:
> use SOAP::Lite +trace => 'debug';
> use VSM::VSMWindows;
>
> my $serviceNs = 'http://g5w2502g.atlanta.hp.com/VSMapi';
> my $serviceProxy =
> 'http://g5w2502g.atlanta.hp.com/VSMapi/VSMapi.asmx';
>
> my ($soap_depot_stat,$soap_msg) =
> VSM::VSMWindows::CheckStatus('serviceNS'=>$serviceNs,
> 'proxy'=>$serviceProxy);
>
> print "$soap_depot_stat,$soap_msg\n";
>
> CLIENT FUNCTION:
> sub CheckStatus {
>  my $function = 'CheckStatus';
>  my $SUB = $MODULE . '::' . $function;
>  my %args = @_;
>  my $serviceNs = $args{'serviceNS'};
>  my $serviceProxy = $args{'proxy'};
>  my $stat = '';
>  my $retmsg = '';
>
>  my $soap = SOAP::Lite
> 		 -> uri($serviceNs . '/')
> 		 -> on_action( sub { join '/',
> $serviceNs, $_[1] } )
> 		 -> proxy($serviceProxy);
>
>  if ($soap) {
> 	 $retmsg = $soap
> 	 -> CheckStatus()
> 	 -> result;
>
> 	 if (!defined($retmsg)) {
> 		 $stat = $FALSE;
> 		 $retmsg = "SOAP FAULT ERROR";
> 	 } else {
> 		 $stat = $TRUE;
> 	 }
>  } else {
> 	 $retmsg = "SOAP connection Failure";
> 	 $stat = $FALSE;
>  }
>  return $stat,$retmsg;
> }
>
> CLIENT OUTPUT:
> schall/soap $ ./client.pl
> SOAP::Transport::HTTP::Client::send_receive: POST
> http://.../VSMapi/VSMapi.asmx HTTP/1.1
> Accept: text/xml
> Accept: multipart/*
> Accept: application/soap
> Content-Length: 444
> Content-Type: text/xml; charset=utf-8
> SOAPAction: http://..../VSMapi/CheckStatus
>
> <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:B
> ody><CheckStatus xmlns="http://..../VSMapi/" xsi:nil="true"
> /></soap:Body></soap:Envelope>
> SOAP::Transport::HTTP::Client::send_receive: 500 Can't
> connect to ....:80 (connect: Invalid argument)
> Content-Type: text/plain
> Client-Date: Wed, 26 Jan 2011 18:13:07 GMT
> Client-Warning: Internal response
>
> 500 Can't connect to ....:80 (connect: Invalid argument)
> 500 Can't connect to ....:80 (connect: Invalid argument)
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>

#6567 From: Daniel Kasak <daniel.kasak@...>
Date: Wed Feb 2, 2011 6:52 am
Subject: Issue with SOAP::Data->type( xml => $xml_content )
daniel.kasak
Send Email Send Email
 
Greetings.

We are trying to work around an issue with SOAP::Lite adding stuff to a
request that an upstream SOAP library doesn't like. But now we've hit
another bug :(

Using the code:

my $xml_content = qq{<getAllCampaignRequest
xmlns="https://api.baidu.com/sem/sms/v2"/>};

my $elem = SOAP::Data->type('xml' => $xml_content);
$call = $self->getService($svc_name)->call( $elem ,  @{$self->headers});

  ... and a quite old version of SOAP::Lite ( 0.60 ), we get the correct
SOAP request being sent ( and parsed correctly upstream ).

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><namesp1:Aut\
hHeader xmlns:namesp1="http://api.baidu.com/sem/common/v2"><namesp2:password
xsi:type="xsd:string"
xmlns:namesp2="http://api.baidu.com/sem/common/v2">xxxxxx</namesp2:password><nam\
esp3:token xmlns:namesp3="http://api.baidu.com/sem/common/v2"
xsi:type="xsd:string">xxxxxxxxxxxxxxxxx</namesp3:token><namesp4:username
xsi:type="xsd:string"
xmlns:namesp4="http://api.baidu.com/sem/common/v2">baidu-xxxxxxxxx</namesp4:user\
name></namesp1:AuthHeader></soap:Header><soap:Body><getAllCampaignRequest
xmlns="https://api.baidu.com/sem/sms/v2"/></soap:Body></soap:Envelope>

Sorry about the formatting :)

With SOAP::Lite version 0.710.07 ... which we're now migrating to ...
the same code generates this:

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><namesp1:Aut\
hHeader xmlns:namesp1="http://api.baidu.com/sem/common/v2"><namesp2:password
xsi:type="xsd:string"
xmlns:namesp2="http://api.baidu.com/sem/common/v2">xxxxxxx</namesp2:password><na\
mesp3:token xmlns:namesp3="http://api.baidu.com/sem/common/v2"
xsi:type="xsd:string">xxxxxxxxxx</namesp3:token><namesp4:username
xsi:type="xsd:string"
xmlns:namesp4="http://api.baidu.com/sem/common/v2">baidu-xxxxxxx</namesp4:userna\
me></namesp1:AuthHeader></soap:Header><soap:Body /></soap:Envelope>

  ... ie it is MISSING the:

<getAllCampaignRequest xmlns="https://api.baidu.com/sem/sms/v2>

  ... which was in the raw XML that we passed in.

Why is this being stripped?

Thanks :)

Dan

#6568 From: "stephenc01_01" <stephen@...>
Date: Wed Feb 2, 2011 9:55 pm
Subject: Looking for some direction with this
stephenc01_01
Send Email Send Email
 
I am talking to a soap API.

This is the desired output
$xml = ' <metadata xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns4:kt_metadata_fieldset[1]" SOAP-ENC:offset="[0]">
<fieldset xsi:type="ns4:kt_metadata_fieldset">
<fieldset xsi:type="xsd:string">General Information</fieldset>
<fields xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="ns4:kt_metadata_field[5]"
SOAP-ENC:offset="[0]">
<field xsi:type="ns4:kt_metadata_field">
<name xsi:type="xsd:string">Document Author</name><value
xsi:type="xsd:string">N/A</value>
</field>
<field xsi:type="ns4:kt_metadata_field">
<name xsi:type="xsd:string">Date On Document</name><value
xsi:type="xsd:string">2010-08-12</value>
</field>
<field xsi:type="ns4:kt_metadata_field">
<name xsi:type="xsd:string">Notes</name><value xsi:type="xsd:string">some
notes</value>
</field>
</fields>
</fieldset>
</metadata>';

I would like to create this using SOAP::Data right now i am building the XML by
hand and sending it with SOAP::Data->type('xml' => $xml)

#6569 From: Joseph Werner <telcodev@...>
Date: Thu Feb 3, 2011 6:23 am
Subject: Re: Looking for some direction with this
telcodev@...
Send Email Send Email
 
This should get you started:

my $value = 'some notes';
my $name = 'Notes';
my $fieldset = 'General Information';
my $soapdata = SOAP::Data->name(
    'metadata' => \SOAP::Data->value(
    SOAP::Data->name(
        'fieldset' => \SOAP::Data->value(
        SOAP::Data->name(
            'fields' => \SOAP::Data->value(
            SOAP::Data->name(
                'field' => \SOAP::Data->value(
                SOAP::Data->name('value')->value($value)
                ->type(q{}),
                SOAP::Data->name('name')->value($name)
                ->type(q{}),
                )
            ),
            )
        ),
        SOAP::Data->name('fieldset')->value($fieldset)
        ->type(q{}),
        )
    ),
    )
    );

On Wed, Feb 2, 2011 at 1:55 PM, stephenc01_01 <stephen@...> wrote:
 

I am talking to a soap API.

This is the desired output
$xml = ' <metadata xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="ns4:kt_metadata_fieldset[1]" SOAP-ENC:offset="[0]">
<fieldset xsi:type="ns4:kt_metadata_fieldset">
<fieldset xsi:type="xsd:string">General Information</fieldset>
<fields xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="ns4:kt_metadata_field[5]" SOAP-ENC:offset="[0]">
<field xsi:type="ns4:kt_metadata_field">
<name xsi:type="xsd:string">Document Author</name><value xsi:type="xsd:string">N/A</value>
</field>
<field xsi:type="ns4:kt_metadata_field">
<name xsi:type="xsd:string">Date On Document</name><value xsi:type="xsd:string">2010-08-12</value>
</field>
<field xsi:type="ns4:kt_metadata_field">
<name xsi:type="xsd:string">Notes</name><value xsi:type="xsd:string">some notes</value>
</field>
</fields>
</fieldset>
</metadata>';

I would like to create this using SOAP::Data right now i am building the XML by hand and sending it with SOAP::Data->type('xml' => $xml)




--
I require any third parties to obtain my permission to submit my information to any other party for each such submission. I further require any third party to follow up on any submittal of my information by sending detailed information regarding each such submission to telcodev@...
Joseph Werner

#6570 From: "Martin Busik" <martin.busik@...>
Date: Sat Feb 12, 2011 8:25 pm
Subject: AW: Adding attributes to envelope tag / changing name of a body tag
mbusik70
Send Email Send Email
 
Hi,

> 1. My call from SOAP::Lite uses the following envelope tag:
>
> <soap:Envelope
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>
> I need to get the envelop tag to have these attributes instead:
>
> <soap:Envelope
> xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
> xmlns:xsd="http://www.scene7.com/IpsApi/xsd"
> xmlns:ns="http://www.scene7.com/IpsApi/xsd/2010-01-31">

the prefixes (e.g. "soap" is refered to as prefix when defined by
"xmlns:soap", wich means you write "soap:Envelope")
do not really care, you can name them as you want.

I see a difference in the Envelope uri:

xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

vs.

xmlns:soap="http://www.w3.org/2003/05/soap-envelope"

I'haven't checked the differences yet, but there may some differences
occur...



> my $params = SOAP::Data->name("ns:checkLoginParam" =>
> \SOAP::Header->value(
>     SOAP::Header->name('ns:email')->value($s7user)->type(''),
>     SOAP::Header->name('ns:password')->value($s7pass)->type(''),
> ));
>
> # request method
> $soap->call('checkLogin', $params, $authHeader);
>
>
> .. this produces the following xml ...
>
> <soap:Body>
> <checkLogin xmlns="http://www.scene7.com/IpsApi/xsd/2010-01-31">
> <ns:checkLoginParam>
> <ns:email>myemail/ns:email>
> <ns:password>mypass</ns:password>
> </ns:checkLoginParam>
> </checkLogin>
> </soap:Body>
>
> Is there a way for me to remove the checkLogin tag from being
> wrapped around checkLoginParam? The working code that I have
> from soapUI that I am attempting to reproduce is this:
>
> <soap:Body>
> <ns:checkLoginParam>
> <ns:email>myemail</ns:email>
> <ns:password>mypass</ns:password>
> </ns:checkLoginParam>
> </soap:Body>

"checkLogin" is the main body element, it is refered to as "method name".

This is, because your code uses: $soap->call('checkLogin',

The example you have given seems to expect a method "checkLoginParam", which
would be
coded as: $soap->call('checkLoginParam',...

If your email an password elements shall come inside the Body element, you
should create them
with SOAP::Data and not SOAP::Header. SOAP::Header is intended to "tell"
SOAP::Lite to put its
contents into the Envelope element (instead of into Body)

HTH,
Martin

#6571 From: "josephykwang" <josephw@...>
Date: Sat Feb 19, 2011 1:42 am
Subject: how to pass array of int using perl SOAP::Lite
josephykwang
Send Email Send Email
 
One of the methods requires that we pass it an array of int.

I tried
a) my @list = ();
    push( @list, 367288 );
    push( @list, 328375 );

    my @results = $service->GetData(@list);

2) my $list = (367288, 328375);
    my @results = $service->GetData($list);

3) my $list = SOAP::Data->type('array' => (367288, 32875));
    my @results = $service->GetData($list);

4) using Soapify example in
http://www.soaplite.com/2004/01/building_an_arr.html

None of them is working. Any suggestion?

#6572 From: Jo Rhett <jrhett@...>
Date: Fri Feb 25, 2011 12:08 am
Subject: Re: how to pass array of int using perl SOAP::Lite
jorhett
Send Email Send Email
 
The message below is basically "I tried this and it didn't work"

You're going to have to include what you send them and what they send back for us to help ;-)  Also, compare what you send them against an example they provide of what the input should look like.

On Feb 18, 2011, at 5:42 PM, josephykwang wrote:
 

One of the methods requires that we pass it an array of int.

I tried
a) my @list = ();
push( @list, 367288 );
push( @list, 328375 );

my @results = $service->GetData(@list);

2) my $list = (367288, 328375);
my @results = $service->GetData($list);

3) my $list = SOAP::Data->type('array' => (367288, 32875));
my @results = $service->GetData($list);

4) using Soapify example in
http://www.soaplite.com/2004/01/building_an_arr.html

None of them is working. Any suggestion?


-- 
Jo Rhett
Net Consonance : consonant endings by net philanthropy, open source and other randomness


#6573 From: "krishnapriya" <krishh_july@...>
Date: Wed Mar 16, 2011 8:31 am
Subject: How to pass attr[] parameter in calling a web method from perl scripts?
krishh_july
Send Email Send Email
 
My web method in .NET web service has a parameter attr[] attributes. how to pass
this parameter in  perl scripts?
  its xml format is:

attributes>
         <attr>
           <attrName>string</attrName>
           <attrValue>
             <string>string</string>
             <string>string</string>
           </attrValue>
         </attr>
         <attr>
           <attrName>string</attrName>
           <attrValue>
             <string>string</string>
             <string>string</string>
           </attrValue>
         </attr>
       </attributes>
How to pass this using SOAP::Data?

#6574 From: Joseph Werner <telcodev@...>
Date: Fri Feb 25, 2011 12:37 am
Subject: Re: how to pass array of int using perl SOAP::Lite
telcodev@...
Send Email Send Email
 
Gee, I'm not certain this is not just a Perl problem...

Have you considered trying a list reference instead of a scalar?

Just what do you think the line "my $list = (367288, 328375);" does?
[this is a test]

perhaps: my @results = $service->GetData(\@list);

Just a thought...


On Thu, Feb 24, 2011 at 4:08 PM, Jo Rhett <jrhett@...> wrote:
>
>
>
> The message below is basically "I tried this and it didn't work"
>
> You're going to have to include what you send them and what they send back for
us to help ;-)  Also, compare what you send them against an example they provide
of what the input should look like.
> On Feb 18, 2011, at 5:42 PM, josephykwang wrote:
>
>
>
> One of the methods requires that we pass it an array of int.
>
> I tried
> a) my @list = ();
> push( @list, 367288 );
> push( @list, 328375 );
>
>



>
> 2) my $list = (367288, 328375);
> my @results = $service->GetData($list);
>
> 3) my $list = SOAP::Data->type('array' => (367288, 32875));
> my @results = $service->GetData($list);
>
> 4) using Soapify example in
> http://www.soaplite.com/2004/01/building_an_arr.html
>
> None of them is working. Any suggestion?
>
>
> --
> Jo Rhett
> Net Consonance : consonant endings by net philanthropy, open source and other
randomness
>

#6575 From: "tnjeditor" <dan@...>
Date: Thu Mar 17, 2011 9:37 pm
Subject: How would you use PKI certs with Soap::Lite?
tnjeditor
Send Email Send Email
 
I've been asked to "PKI Enable" one of my SOAP client tools and looking for
pointers on where to start with this.

Normally I call a "login" method with a username/password to get a SOAP session
key.  In this case I'd be sending over the PKI certificate to get the session
key.  One thing I need to figure out is, what is the right way to do this in a
generic, multi-platform way?

Any tips or pointers would be very much appreciated.

Dan

#6576 From: "Alceu R" <glasswalk3r@...>
Date: Wed Apr 27, 2011 4:02 pm
Subject: SOAP Faults and HTTP 1.1 error codes
glasswalk3r
Send Email Send Email
 
Hello there,

My name is Alceu and I'm a newbie with SOAP::Lite.

I was adding some parameter validation in server side and follow the
explanations on http://cookbook.soaplite.com/#soap%20faults about how to setup
error codes to give better explanations about the invalid parameters.

Everything looks fine, but I'm alway getting an HTTP 500 error in the HTTP
header:

SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x136a3fc)
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
Connection: close
Date: Wed, 27 Apr 2011 15:48:08 GMT
Server: Apache/2.2.17 (Win32)
Content-Length: 637
Content-Type: text/xml; charset=utf-8
Client-Date: Wed, 27 Apr 2011 15:48:09 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1
SOAPServer: SOAP::Lite/Perl/0.712

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope
xmlns:namesp1="http://namespaces.soaplite.com/perl"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/so
ap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><f\
a
ultcode>soap:Server.Custom</faultcode><faultstring>Invalid state string:
'ef'</faultstring><detail><BadState xsi:type="namesp1:BadState"><code
xsi:type="xsd:int">1</code></BadState></detail></soap:Fault>
</soap:Body></soap:Envelope>

While the SOAP fault code looks ok, I'm wondering if the HTTP header is the
correct one. Of course, Since I'm using die function in the CGI built to run in
my Apache webserver, it seems more resonable that the HTTP error should be "400
Bad Request" since the server was able to process the request, but the
parameter(s) is(are) invalid.

So my first question is: should I worry about that?
Question 2: if I should, how should I change that?

I'm using SOAP::Transport::HTTP::CGI in the server side to process the requests.

Thanks,
Alceu

#6577 From: "Alceu R" <glasswalk3r@...>
Date: Wed May 11, 2011 8:20 pm
Subject: strange generated request when consuming WSDL file
glasswalk3r
Send Email Send Email
 
Greetings,

I have an doubt about the request being automatically generated by SOAP::Lite.

Here is (part) of the WSDL file content. Please note that are two complex types
defined, one being the request and the other the response.

<types>
     <xsd:schema
targetNamespace="http://saomc11024412/SiebelPhysician/SiebelPhysician.xsd">
       <xsd:complexType name="FindByRCNRequest">
         <xsd:sequence>
           <xsd:element name="federativeUnity" type="xsd:string"/>
           <xsd:element name="regionalConcilNumber" type="xsd:int"/>
         </xsd:sequence>
       </xsd:complexType>
       <xsd:complexType name="FindByRCNResponse">
         <xsd:sequence>
           <xsd:element name="firstName" type="xsd:string"/>
           <xsd:element name="lastName" type="xsd:string"/>
           <xsd:element name="type" type="xsd:string"/>
           <xsd:element name="status" type="xsd:string"/>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:schema>
   </types>

When consuming that with the minimum code below:

print
SOAP::Lite->service('http://localhost/SiebelSOAP/SiebelPhysician.xsd')->FindByRC\
N('PR', 11778);

I got the following SOAP request:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:tns="SiebelPhysician"
               
xmlns:xsdl="http://saomc11024412/SiebelPhysician/SiebelPhysician.xsd"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
     <tns:FindByRCN>
       <c-gensym3 xsi:type="xsd:string">PR</c-gensym3>
       <c-gensym5 xsi:type="xsd:int">11778</c-gensym5>
     </tns:FindByRCN>
   </soap:Body>
</soap:Envelope>

I was expecting to have inside the soap:Body the element FindByRCNRequest and
not the method name. Trying to use SOAP::Data to generate the request as defined
in the WSDL file does not help:

my $val1 = SOAP::Data->type('string')->name('federativeUnity')->value('PR');
my $val2 =
   SOAP::Data->type('integer')->name('regionalConcilNumber')->value(11778);

my $request_data =
   SOAP::Data->type('complex')->name('FindByRCNRequest')->value( $val1, $val2 );

print SOAP::Lite->service('http://localhost/SiebelSOAP/SiebelPhysician.xsd')
   ->FindByRCN($request_data);


<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:tns="SiebelPhysician"
               
xmlns:xsdl="http://saomc11024412/SiebelPhysician/SiebelPhysician.xsd"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
     <tns:FindByRCN>
       <federativeUnity xsi:type="xsd:string">PR</federativeUnity>
       <regionalConcilNumber xsi:type="xsd:integer">11778</regionalConcilNumber>
     </tns:FindByRCN>
   </soap:Body>
</soap:Envelope>

In the other hand, the response of the server is being exactly as defined in the
WSDL file:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <FindByRCNResponse xmlns="SiebelPhysician">
       <firstName xsi:type="xsd:string">CARLOS</firstName>
       <lastName xsi:type="xsd:string">ALBERTO DE CASTRO</lastName>
       <type xsi:type="xsd:string">MEDICO</type>
       <status xsi:type="xsd:string">ATIVO</status>
     </FindByRCNResponse>
   </soap:Body>
</soap:Envelope>


Here is the code of the server:

     return SOAP::Data->name('physicianData')->type('complex')->value(
         SOAP::Data->name('firstName')->type('string')
           ->value( $phy->fst_name() ),
         SOAP::Data->name('lastName')->type('string')
           ->value( $phy->last_name() ),
         SOAP::Data->name('type')->type('string')->value( $phy->type() ),
         SOAP::Data->name('status')->type('string')->value(
$phy->status()->value() ),
     )->uri($uri);

Am I doing something wrong? Or this behaviour is expected?

Thanks,
Alceu

Ps: below is the complete WSDL for reference

<?xml version="1.0"?>
<definitions name="SiebelPhysicians"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="SiebelPhysician" xmlns:tns="SiebelPhysician"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsdl="http://saomc11024412/SiebelPhysician/SiebelPhysician.xsd">
   <types>
     <xsd:schema
targetNamespace="http://saomc11024412/SiebelPhysician/SiebelPhysician.xsd">
       <xsd:complexType name="FindByRCNRequest">
         <xsd:sequence>
           <xsd:element name="federativeUnity" type="xsd:string"/>
           <xsd:element name="regionalConcilNumber" type="xsd:int"/>
         </xsd:sequence>
       </xsd:complexType>
       <xsd:complexType name="FindByRCNResponse">
         <xsd:sequence>
           <xsd:element name="firstName" type="xsd:string"/>
           <xsd:element name="lastName" type="xsd:string"/>
           <xsd:element name="type" type="xsd:string"/>
           <xsd:element name="status" type="xsd:string"/>
         </xsd:sequence>
       </xsd:complexType>
     </xsd:schema>
   </types>
   <message name="FindByRCNRequest">
     <part name="FindByRCNRequestSoapMsg" element="xsdl:FindByRCNRequest"/>
   </message>
   <message name="FindByRCNResponse">
     <part name="FindByRCNResponseSoapMsg" element="xsdl:FindByRCNResponse"/>
   </message>
   <portType name="SiebelPhysician_PortType">
     <operation name="FindByRCN">
       <input message="tns:FindByRCNRequest" />
       <output message="tns:FindByRCNResponse" />
     </operation>
   </portType>
   <binding name="SiebelPhysicianBinding" type="tns:SiebelPhysician_PortType">
     <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
     <operation name="FindByRCN">
       <soap:operation style="document" soapAction=""/>
       <input>
         <soap:body use="literal"/>
       </input>
       <output>
         <soap:body use="literal"/>
       </output>
     </operation>
   </binding>
   <service name="SiebelPhysician">
     <documentation>SOAP service to query physicians in Siebel
database</documentation>
     <port name="SiebelPhysician_PortType" binding="tns:SiebelPhysicianBinding">
       <soap:address location="http://saomc11024412/cgi-bin/siebel-soap.pl"/>
     </port>
   </service>
</definitions>

#6578 From: "Alceu R" <glasswalk3r@...>
Date: Fri May 13, 2011 7:07 pm
Subject: dispatch_with not working to map SOAPHeader with Perl method
glasswalk3r
Send Email Send Email
 
Greetings,

I trying to use SOAPHeader with a document type webservice but I'm not being
able to make the server to reply the request.

I have the following (partial) WSDL being consumed by my SOAP::Lite client:

<wsdl:binding name="SiebelPhysicianBinding" type="tns:SiebelPhysician_PortType">
     <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
     <wsdl:operation name="FindByRCN">
       <soap:operation soapAction="urn:SiebelPhysician#FindByRCN"/>
       <wsdl:input>
         <soap:body use="literal"/>
       </wsdl:input>
       <wsdl:output>
         <soap:body use="literal"/>
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="SiebelPhysician">
     <wsdl:port name="SiebelPhysician_PortType"
binding="tns:SiebelPhysicianBinding">
       <wsdl:documentation>SOAP service to query physicians in Siebel
database</wsdl:documentation>
       <soap:address location="http://saomc11024412/cgi-bin/siebel-soap.pl"/>
     </wsdl:port>
   </wsdl:service>

The code of my client:

my $val1 = SOAP::Data->type('string')->name('federativeUnity')->value('PR');
my $val2 =
   SOAP::Data->type('integer')->name('regionalConcilNumber')->value(11778);

my $request_data =
   SOAP::Data->type('complex')->name('request')->value( $val1, $val2 );

print
SOAP::Lite->service('http://localhost/SiebelSOAP/SiebelPhysician.xsd')->FindByRC\
N($request_data);

This is the request of the client:

SOAPAction: "urn:SiebelPhysician#FindByRCN"

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Bod\
y><FindByRCN xmlns=""><federativeUnity xsi:typ
e="xsd:string">PR</federativeUnity><regionalConcilNumber
xsi:type="xsd:integer">11778</regionalConcilNumber></FindByRCN></SOAP-ENV:Body><\
/SOAP-ENV:Envelope>

The client is fetching the SOAPAction header value from the WSDL. But I cannot
use call() method with it because the SOAP::Lite complaing about the definition
of proxy, which in fact is specified by the WSDL. BUT if I use the method
(FindByRCN), SOAP::Lite does not complain but generates an XML entity that is
incompatible with the definitions on the WSDL. >:-(

This is not the big issue. The problem is the server answer:

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas
.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Bod\
y><SOAP-ENV:Fault><faultcode xsi:type="xsd:str
ing">SOAP-ENV:Client</faultcode><faultstring xsi:type="xsd:string">SOAPAction
shall match 'uri#method' if present (got 'urn:SiebelPhysician#FindByRCN',
expected '#FindByRCN'
</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

Here is the (partial) code of the server:

use SOAP::Transport::HTTP;
use Regexp::Common qw(number);

use warnings;
use strict;
our $uri = 'urn:SiebelPhysician';
our %RE;

my $server = SOAP::Transport::HTTP::CGI->new();

$server->dispatch_with({'uri:SiebelPhysician#FindByRCN' => 'SiebelPhysician'});

$server->handle();

package SiebelPhysician;

I tested the same thing from SOAPUi (by consuming the same WSDL) and the output
is a bit different:

<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body>
       <SOAP-ENV:Fault>
          <faultcode xsi:type="xsd:string">SOAP-ENV:Client</faultcode>
          <faultstring xsi:type="xsd:string">SOAPAction shall match 'uri#method'
if present (got 'urn:SiebelPhysician#FindByRCN', expected
'urn:SiebelPhysician#request'</faultstring>
          <faultactor
xsi:type="xsd:string">urn:SiebelPhysician#request</faultactor>
       </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

What am I doing wrong?

Thanks,
Alceu

#6579 From: "jywu0812" <jywu0812@...>
Date: Thu Jun 2, 2011 11:24 pm
Subject: What version for both Perl 5.8.2 and 5.10.1?
jywu0812
Send Email Send Email
 
Hi. I have a Perl program using SOAP Lite (Version 0.60?) that has been working
fine with Perl 5.8.2 but fails with 5.10.1.

My test code looks like this:

sub soapcall()
{
     my $remoteVersion = SOAP::Lite
         -> proxy('http://full_hostname:8080/axis2/...')
         -> uri('http://....org')
         -> getVersion( ... )
         -> result;

     chomp( $remoteVersion );
     print "getVersion() - remoteVersion = $remoteVersion\n" ;
}
soapcall();
soapcall();

With Perl 5.10.1 the first call succeeds but the second one fails at the SOAP
Lite call, with this message:

   Unresolved prefix 'soapenv' for attribute 'soapenv:Envelope'

After this message:

   Odd number of elements in anonymous hash

At this SOAP/Lite.pm line:

   sub start { push @{shift->{_values}}, [shift, {@_}] }

If I print out @_ for the start function I get:

   SOAP::Parser=HASH(0x2038cba8) soapenv:Envelope soapenv:Envelope
HASH(0x2038fc58) ARRAY(0x20748b18)  HASH(0x207b48a8)
{http://schemas.xmlsoap.org/soap/envelope/}Envelope HASH(0x2038d058)
xmlns:soapenv http://schemas.xmlsoap.org/soap/envelope/

for the second call, and:

   SOAP::Parser=HASH(0x20280ed8) soapenv:Envelope xmlns:soapenv
http://schemas.xmlsoap.org/soap/envelope/

for the first call.

What's going on? How to best resolve the issue? Is there a version that works
for both versions of Perl?

Thanks for any help.

Jason

#6580 From: "Rob Callahan" <RobTCallahan@...>
Date: Tue Jun 14, 2011 1:21 am
Subject: certificate verify failed
robtcallahan
Send Email Send Email
 
Hi,

I've been trying all day to get SOAP::Lite to connect to a server that has a
self-signed cert with no luck. Nor can I find any help on the web via Google
searches. Here's my code and the error returned:

use SOAP::Lite +trace;

my $username = "rcallaha";
my $password = "pwd";
my $url = "https://somehost.somedomain.com:8443/service";
my $wsdl = $url . "/wsdl";


my $service = SOAP::Lite
     ->service($wsdl)
     ->readable(1)
     ->proxy($url);

my @headers = (
	 SOAP::Header->name("username" => $username),
	 SOAP::Header->name("password" => $password),
	 );

my $request = SOAP::Data->name("request" =>
	 {
	 });

my $response = $service->call('listUsers' => $request, @headers);

print("CSV: ", $response->result()->{"csv"});


rcal2-macsl.local> ~/bin/ws_test.pl
SOAP::Transport::new: ()
SOAP::Serializer::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Lite::new: ()
SOAP::Deserializer::new: ()
SOAP::Parser::new: ()
SOAP::Schema::new: ()
Service description 'https://somehost.hostdomain.com:8443/service/wsdl' can't be
loaded: 500 Can't connect to somehost.somedomain.com:8443 (certificate verify
failed)
SOAP::Lite::DESTROY: ()
SOAP::Serializer::DESTROY: ()
SOAP::Transport::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()
SOAP::Schema::DESTROY: ()
SOAP::Deserializer::DESTROY: ()
SOAP::Parser::DESTROY: ()

Any help would be greatly appreciated.

Thanks,
Rob

#6581 From: "denis.simonet@..." <denis.simonet@...>
Date: Thu Jun 30, 2011 3:29 pm
Subject: Call on SOAP::Transport::HTTP::Apache->handler() causes XML Parser error
denis.simone...
Send Email Send Email
 
Hi all

Since an update of Apache, mod_perl and SOAP::Lite (on Debian) a mod_perl module
which uses SOAP::Lite doesn't work anymore. It causes an error in the XML
parser. The SOAP request and the answer are:

REQUEST:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://url/name" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Bod\
y><ns1:getCustomerReservationList><refP
xsi:type="xsd:string">00123456</refP><lang
xsi:type="xsd:string">fr</lang></ns1:getCustomerReservationList></SOAP-ENV:Body>\
</SOAP-ENV:Envelope>

RESPONSE:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
     xmlns:ns1="http://url/name"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
     soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
     <soap:Fault>
       <faultcode>soap:Client</faultcode>
       <faultstring>Application failed during request deserialization:
no element found at line 1, column 0, byte -1 at /usr/lib/perl5/XML/Parser.pm
line 187
</faultstring>
     </soap:Fault>
   </soap:Body>
</soap:Envelope>

The important perl part:
---
use strict;
use Apache2::Const qw(:common :http);
use base qw(Tcs::View::Interface);
use HTML::Entities qw(encode_entities_numeric);
use SOAP::Transport::HTTP;

my $namespace = 'http://url/name';
my $server = SOAP::Transport::HTTP::Apache
         ->options({ns => $namespace})
         ->dispatch_to('N::View::Interface::Modulename::Responder')
         ->dispatch_with({'' => 'N::View::Interface::Modulename::Responder',
                         $namespace =>
'N::View::Interface::Modulename::Responder'});

$server->serializer->register_ns($namespace => 'ns1');
$server->serializer->readable(1);
$server->serializer->default_ns($namespace);


sub handle
{
         my ($self, $schema, $args, $r) = @_;
         my $ret;

         $N::View::Interface::Modulename::Responder::req = $r;
         $N::View::Interface::Modulename::Responder::schema = $schema;

         eval {
                 $ret = $server->handler($r);
         };


         if ($@)
         {
                 $req->warn($@);
                 return (HTTP_BAD_REQUEST, $@);
         }

         return ($ret, '');
}
---

$r->args() contains the correct SOAP request (valid XML etc). The handler
functions are in the same .pm file but in another package:
N::View::Interface::Modulename::Responder::req

The call $server->handler($r) causes the error message. Again extracted:
Application failed during request deserialization:
no element found at line 1, column 0, byte -1 at /usr/lib/perl5/XML/Parser.pm
line 187

Does anyone know why this happens? The same script works under an older version!
The version installed now:
ii  libsoap-lite-perl                                             0.710.08-1

Unfortunately i didn't find any useful hints with google and I was seeking for
hours.

Thank you in advance!

Kind regards
Denis

#6582 From: Rich T_ <rtomasso@...>
Date: Fri Jul 1, 2011 3:48 pm
Subject: Generating SOAP::Fault detail elements
rtomasso
Send Email Send Email
 
I'm running into a wall on generating child elements within SOAP::Fault <detail>
response. I can generate one child element just fine, but nothing I try will
create multiple child elements. I've found examples online of this sort of
output but no code to do it. Passing in a hashref or arrayref isn't doing it.

I'm using the SOAP::Lite package and Perl 5.8. I'm generating the fault by
calling die with a SOAP::Fault constructor. What I want is an output that looks
like this:

<soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
       <soap:Fault>
          <faultcode>soap:Client</faultcode>
          <faultstring>Must pass start_time</faultstring>
          <detail>
             <result_code>116<result_code>
             <error_string>Missing start_time argument</error_string>
             <time>Fri Jul  1 15:45:06 UTC 2011</time>
          </detail>
       </soap:Fault>
    </soap:Body>
</soap:Envelope>

Any help would be appreciated.
Thanks.

#6583 From: Mithun Bhattacharya <inzoik@...>
Date: Fri Jul 1, 2011 4:50 pm
Subject: Re: Generating SOAP::Fault detail elements
inzoik
Send Email Send Email
 


From: Rich T_ <rtomasso@...>

I'm running into a wall on generating child elements within SOAP::Fault <detail> response. I can generate one child element just fine, but nothing I try will create multiple child elements. I've found examples online of this sort of output but no code to do it. Passing in a hashref or arrayref isn't doing it.

perldoc seems to imply this type of construct should work for you - what error did you get for that ?

->
faultdetail(bless {code => 1} => 'BadError')



- Mithun

#6584 From: Rich T_ <rtomasso@...>
Date: Fri Jul 1, 2011 6:51 pm
Subject: Re: Generating SOAP::Fault detail elements
rtomasso
Send Email Send Email
 
--- On Fri, 7/1/11, Mithun Bhattacharya <inzoik@...> wrote:
>  perldoc seems to imply this type of construct should work for you -
>  what error did you get for that ?
>
>  ->faultdetail(bless {code => 1} => 'BadError')


That produces something like this:

<detail>
     <BadError>
         <code>1</code>
     <BadError>
<detail>

Which is not what I want. I can get something like

<detail>
     <code>1</code>
<detail>

Easily enough, but I want to have multiple child elements of <detail>

Messages 6555 - 6584 of 6629   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help