Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SOAP::Lite SSL Segmentation Fault

Status
Not open for further replies.

bustell

Programmer
Mar 22, 2002
159
0
0
US
Hello all,

Please forgive my ignorance of PERL. I am a .Net developer trying to create some PERL sample code for connecting to a .Net Web service (we have developed) using SOAP::Lite.

I have everything working with a regular http request. However when I change the proxy address to SSL by changing the http to https i get a "segmentation fault." If I change it back, it works again. When set for SSL, it doesn't appear to be hitting the Web server. There are no entries in the Web server logs.

Below is my code. As I am not a PERL developer, any and all suggestions would be greatly appreciated. Thank you in advance.

Code:
#!/usr/bin/perl

use SOAP::Lite +trace => debug;

print "\n\nZIPFOURce Web Service PERL Example *************************\n\n";
print "INPUT ADDRESS:\nBCC Software, Inc\n75 josons dr\n14623\n\n";

my $methodsURI = '[URL unfurl="true"]http://ws.bccsoftware.com/ZIPFOURce';[/URL]
my $methodProxy = '[URL unfurl="true"]https://testingserver/WebServices/ZIPFOURceWebService/ZIPFOURceWS.asmx';[/URL]
my $methodAction = $methodsURI . "/EncodeAddress";

my $service = SOAP::Lite
        -> uri( $methodsURI )
        -> proxy( $methodProxy )
        -> on_action(sub{$methodAction; });

my $serviceMethod = SOAP::Data
        -> name('EncodeAddress')
        -> attr( {xmlns => $methodsURI } );

my $result = $service -> call(
        $serviceMethod =>
            SOAP::Data -> name(LicenseKey => 'TestLicense')
          , SOAP::Data -> name(UserDefinedId => 'udf')
          , SOAP::Data -> name(Firm => 'BCC Software, Inc')
          , SOAP::Data -> name(Address1 => '')
          , SOAP::Data -> name(Address2 => '75 josons dr')
          , SOAP::Data -> name(Address3 => '')
          , SOAP::Data -> name(SecondaryAddressInfo => '')
          , SOAP::Data -> name(Urbanization => '')
          , SOAP::Data -> name(City => '')
          , SOAP::Data -> name(State => '')
          , SOAP::Data -> name(Zipcode => '14623')
          , SOAP::Data -> name(ResellerCustId => '')
        );

#my $result = $soap -> call($method => $query);

print "SAMPLING OF RESULTS \n";
print "Firm:        " . $result -> valueof('//Firm') . "\n";
print "Address2:    " . $result -> valueof('//Address2') . "\n";
print "Address1:    " . $result -> valueof('//Address1') . "\n";
print "City:        " . $result -> valueof('//City') . "\n";
print "State:       " . $result -> valueof('//State') . "\n";
print "ZIP Code     " . $result -> valueof('//Zipcode') . "\n";
print "County       " . $result -> valueof('//County') . "\n";
print "Record Type  " . $result -> valueof('//RecordType') . "\n";

Here is the output with the error:

ZIPFOURce Web Service PERL Example *************************

INPUT ADDRESS:
BCC Software, Inc
75 josons dr
14623

SOAP::Transport::HTTP::Client::send_receive: POST HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 973
Content-Type: text/xml; charset=utf-8
SOAPAction:
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi=" xmlns:soapenc=" xmlns:xsd=" soap:encodingStyle=" xmlns:soap=" xmlns=" xsi:type="xsd:string">TestLicense</LicenseKey><UserDefinedId xsi:type="xsd:string">udf</UserDefinedId><Firm xsi:type="xsd:string">BCC Software, Inc</Firm><Address1 xsi:type="xsd:string" /><Address2 xsi:type="xsd:string">75 josons dr</Address2><Address3 xsi:type="xsd:string" /><SecondaryAddressInfo xsi:type="xsd:string" /><Urbanization xsi:type="xsd:string" /><City xsi:type="xsd:string" /><State xsi:type="xsd:string" /><Zipcode xsi:type="xsd:int">14623</Zipcode><ResellerCustId xsi:type="xsd:string" /></EncodeAddress></soap:Body></soap:Envelope>
Segmentation fault




Pat B
 
the only thing I could find was this bit:

Apache is crashing with segfaults (it may looks like "500 unexpected EOF before status line seen" on client side)

If using SOAP::Lite (or XML::parser::Expat) in combination with mod_perl causes random segmentation faults in httpd processes try to configure Apache with:

RULE_EXPAT=no

-- OR (for Apache 1.3.20 and later) --

./configure --disable-rule=EXPAT

See for more details and lot of thanks to Robert Barta <rho@bigpond.net.au> for explaining this weird behavior.

If it doesn't help, you may also try -Uusemymalloc (or something like that) to get perl to use the system's own malloc. Thanks to Tim Bunce <Tim.Bunce@pobox.com>.

- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top