Loading ...
Sorry, an error occurred while loading the content.

500 Internal Server Error

Expand Messages
  • Milan
    I am developing Internet oriented application to communicate with SOAP
    Message 1 of 2 , Oct 11, 2010
    View Source
    • 0 Attachment
      I am developing Internet oriented application to communicate with SOAP
      > Application developed by Efile Team IRD New Zealand.
      > I am very new on SOAP.
      >
      > In Developers Guide from EFile Team they give following for access:
      >
      >
      > 1.1.1 Connecting to IFEP
      >
      > Unlike the FEP system, there is no requirement for Tax Applications to
      > physically log-on to Inland Revenue E-File Servers using a user id and
      > password. The Client Authentication will be performed as described in the
      > following section.
      >
      >
      >
      > To connect to the IFEP, the Tax Application systems will need to use a URL
      > (Universal Resource Locator) and an Action URI (Universal Resource
      > Identifier), as shown in the examples below:
      >
      >
      >
      >
      >
      > URL for IFEP Compliance/Client Test System:
      >
      > https://efile.ird.govt.nz/ifep-test/servlet/messagerouter
      >
      >
      >
      > Action URI for IFEP:
      >
      > ifep-main
      >
      > I developed following Code:
      >
      >
      > use Data::Dumper;
      >
      > use SOAP::Lite +trace => [qw/ debug method fault /];
      >
      > #require SOAP::Lite;
      >
      > #SOAP::Lite::import(+trace => 'debug');
      >
      > #use SOAP::Lite on_action => sub {sprintf '%s/%s', @_}, 'trace', 'debug';
      >
      > #use SOAP::Lite +trace => all;
      >
      > #use SOAP::Lite on_action => sub {sprintf '%s/%s', @_}, 'trace', 'debug';
      >
      > my $namespace = 'ifep-main';
      >
      > my $namespace1 = 'http://schemas.xmlsoap.org/soap/envelope/';
      >
      > my $namespace2 = 'http://www.soaplite.com/Demo';
      >
      > my $namespace3 =
      > 'https://efile.ird.govt.nz/ifep-test/servlet/messagerouter';
      >
      > my $namespace4 = 'http://services.soaplite.com/hibye.cgi';
      >
      > my $soap = new SOAP::Lite
      >
      > uri => $namespace,
      >
      > proxy => [ $namespace3
      >
      > ,
      >
      > credentials => [
      >
      > 'efile.ird.govt.nz/ifep-test:443',
      >
      > 'api'
      >
      > ]
      >
      > ];
      >
      > $soap->serializer(SOAP::Serializer->new());
      >
      > $soap->autotype(0);
      >
      > $soap->readable(1);
      >
      > $soap->uri($namespace);
      >
      > $soap->default_ns($namespace); ;
      >
      > #$soap->soapversion('1.2');
      >
      > #$SOAP::Constants::DEFAULT_HTTP_CONTENT_TYPE= 'text/xml';
      >
      > #$SOAP::Constants::DEFAULT_HTTP_CONTENT_TYPE= 'text/xml';
      >
      > #- Setting Content-Type myself
      >
      > my $http_request = $soap
      >
      > ->{'_transport'}
      >
      > ->{'_proxy'}
      >
      > ->{'_http_request'};
      >
      > $http_request->content_type('text/xml');
      >
      > my $xml = qq{
      >
      > <SOAP-ENV:Envelope
      >
      > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      >
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      >
      > <SOAP-ENV:Header>
      >
      > </SOAP-ENV:Header>
      >
      > <SOAP-ENV:Body>
      >
      > <accept xmlns="ifep">
      >
      > <transaction>
      >
      > <authentication>
      >
      > <irdNumber
      >
      > value="103226902"/>
      >
      > <locationNumber
      >
      > value="001"/>
      >
      > <package name="BMSO"
      >
      > version="1.00"/>
      >
      > </authentication>
      >
      > <get/>
      >
      > </transaction>
      >
      > </accept>
      >
      > </SOAP-ENV:Body>
      >
      > </SOAP-ENV:Envelope>
      >
      > };
      >
      > my $soap_data = new SOAP::Data->type('xml')
      > ->name('myxmlstring')->value($xml);
      >
      > #my $soap_data = new SOAP::Data->type('xml' => $xml);
      >
      > #my $soap_data = new SOAP::Data
      >
      > # ->name('listRecordsRequest')
      >
      > # ->attr({
      >
      > # 'xmlns' => $soap->default_ns,
      >
      > # });
      >
      > my $response = $soap->call($soap_data);
      >
      > (Sorry there is so many different variations!)
      >
      > I get the following:
      >
      > ############### BEGIN OUT ##############
      >
      > $VAR1 = bless( { '_content' => [ 'SOAP-ENV:Envelope', { 'xmlns:xsi' =>
      > 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:SOAP-ENV' =>
      > 'http://schemas.xmlsoap.org/soap/envelope/', 'xmlns:xsd' =>
      > 'http://www.w3.org/2001/XMLSchema' }, [ [ 'SOAP-ENV:Body', {}, [ [
      > 'SOAP-ENV:Fault', {}, [ [ 'faultcode', {}, 'SOAP-ENV:Server.Exception:',
      > undef, 'SOAP-ENV:Server.Exception:', 'faultcode', {} ], [ 'faultstring', {},
      > '0 >= 0', undef, '0 >= 0', 'faultstring', {} ], [ 'faultactor', {},
      > '/ifep-test/servlet/messagerouter', undef,
      > '/ifep-test/servlet/messagerouter', 'faultactor', {} ] ], undef, {
      > 'faultactor' => '/ifep-test/servlet/messagerouter', 'faultcode' =>
      > 'SOAP-ENV:Server.Exception:', 'faultstring' => '0 >= 0' },
      > '{http://schemas.xmlsoap.org/soap/envelope/}Fault', {} ] ], undef, { 'Fault'
      > => $VAR1->{'_content'}[2][0][2][0][4] },
      > '{http://schemas.xmlsoap.org/soap/envelope/}Body', {} ] ], undef, { 'Body'
      > => $VAR1->{'_content'}[2][0][4] },
      > '{http://schemas.xmlsoap.org/soap/envelope/}Envelope', {} ], '_context' =>
      > bless( { '_on_nonserialized' => sub { "DUMMY" }, '_deserializer' => bless( {
      > '_ids' => $VAR1->{'_content'}, '_xmlschemas' => {
      > 'http://www.w3.org/2003/05/soap-encoding' =>
      > 'SOAP::Lite::Deserializer::XMLSchemaSOAP1_2',
      > 'http://xml.apache.org/xml-soap' =>
      > 'SOAP::XMLSchemaApacheSOAP::Deserializer',
      > 'http://www.w3.org/2001/XMLSchema' =>
      > 'SOAP::Lite::Deserializer::XMLSchema2001',
      > 'http://www.w3.org/1999/XMLSchema' =>
      > 'SOAP::Lite::Deserializer::XMLSchema1999',
      > 'http://schemas.xmlsoap.org/soap/encoding/' =>
      > 'SOAP::Lite::Deserializer::XMLSchemaSOAP1_1' }, '_context' =>
      > $VAR1->{'_context'}, '_hrefs' => {}, '_parser' => bless( { '_done' =>
      > $VAR1->{'_content'}, '_values' => undef, '_parser' => bless( {
      > 'Non_Expat_Options' => { 'NoLWP' => 1, 'Non_Expat_Options' => 1,
      > '_HNDL_TYPES' => 1, 'Handlers' => 1, 'Style' => 1 }, 'Pkg' =>
      > 'SOAP::Parser', 'Handlers' => { 'End' => undef, 'Final' => undef, 'Char' =>
      > undef, 'Start' => undef, 'ExternEnt' => undef }, '_HNDL_TYPES' => {
      > 'CdataEnd' => sub { "DUMMY" }, 'Start' => sub { "DUMMY" }, 'Entity' => sub {
      > "DUMMY" }, 'ExternEntFin' => sub { "DUMMY" }, 'End' => sub { "DUMMY" },
      > 'Final' => 1, 'Doctype' => sub { "DUMMY" }, 'Char' => sub { "DUMMY" },
      > 'Init' => 1, 'XMLDecl' => sub { "DUMMY" }, 'Default' => sub { "DUMMY" },
      > 'CdataStart' => sub { "DUMMY" }, 'Comment' => sub { "DUMMY" }, 'Unparsed' =>
      > sub { "DUMMY" }, 'ExternEnt' => sub { "DUMMY" }, 'Element' => sub { "DUMMY"
      > }, 'Attlist' => sub { "DUMMY" }, 'DoctypeFin' => sub { "DUMMY" }, 'Notation'
      > => sub { "DUMMY" }, 'Proc' => sub { "DUMMY" } } }, 'XML::Parser' ) },
      > 'SOAP::Parser' ) }, 'SOAP::Deserializer' ), '_autoresult' => 0, '_transport'
      > => bless( { '_proxy' => bless( { '_status' => '500 Internal Server Error',
      > '_message' => 'Internal Server Error', 'requests_redirectable' => [ 'GET',
      > 'HEAD' ], 'from' => undef, 'timeout' => 180, '_is_success' => '',
      > 'parse_head' => 1, 'basic_authentication' => {
      > 'efile.ird.govt.nz/ifep-test:443' => { 'api' => [ undef, undef ] } },
      > 'max_redirect' => 7, '_http_response' => bless( { '_protocol' => 'HTTP/1.1',
      > '_content' => ' SOAP-ENV:Server.Exception: 0 >= 0
      > /ifep-test/servlet/messagerouter ', '_rc' => 500, '_headers' => bless( {
      > 'connection' => 'close', 'client-response-num' => 1, 'set-cookie' =>
      > 'JSESSIONID=35F76842814E876A299DD4837B9869F0; Path=/ifep-test; Secure',
      > 'date' => 'Mon, 11 Oct 2010 21:34:20 GMT', 'client-ssl-cert-issuer' =>
      > '/O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International
      > Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY
      > LTD.(c)97 VeriSign', 'client-ssl-cipher' => 'AES256-SHA', 'client-peer' =>
      > '138.235.41.8:443', 'content-length' => '450', 'client-date' => 'Mon, 11 Oct
      > 2010 21:34:01 GMT', 'client-ssl-warning' => 'Peer certificate not verified',
      > 'content-type' => 'text/xml;charset=utf-8', 'client-ssl-cert-subject' =>
      > '/C=NZ/ST=Wellington/L=Wellington/O=Inland Revenue
      > Department/CN=EFILE.IRD.GOVT.NZ', 'server' => 'Apache' }, 'HTTP::Headers' ),
      > '_msg' => 'Internal Server Error', '_request' => bless( { '_protocol' =>
      > 'HTTP/1.1', '_content' => ' ', '_uri' => bless( do{\(my $o =
      > 'https://efile.ird.govt.nz/ifep-test/servlet/messagerouter')}, 'URI::https'
      > ), '_headers' => bless( { 'user-agent' => 'SOAP::Lite/Perl/0.710.08',
      > 'soapaction' => '"#myxmlstring"', 'content-type' => 'text/xml;
      > charset=utf-8', 'accept' => [ 'text/xml', 'multipart/*', 'application/soap'
      > ], 'content-length' => 402 }, 'HTTP::Headers' ), '_method' => 'POST' },
      > 'HTTP::Request' ) }, 'HTTP::Response' ), '_endpoint' =>
      > 'https://efile.ird.govt.nz/ifep-test/servlet/messagerouter',
      > 'protocols_forbidden' => undef, 'no_proxy' => [], '_options' => {
      > 'is_compress' => '' }, 'protocols_allowed' => undef, 'use_eval' => 1,
      > '_code' => '500', 'agent' => 'SOAP::Lite/Perl/0.710.08', '_http_request' =>
      > bless( { '_content' => '', '_uri' => undef, '_headers' => bless( {
      > 'content-type' => 'text/xml' }, 'HTTP::Headers' ), '_method' => undef },
      > 'HTTP::Request' ), 'def_headers' => undef, 'proxy' => {}, 'max_size' =>
      > undef }, 'SOAP::Transport::HTTP::Client' ) }, 'SOAP::Transport' ),
      > '_serializer' => bless( { '_typelookup' => { 'int' => [ 20, sub { "DUMMY" },
      > 'as_int' ], 'time' => [ 70, sub { "DUMMY" }, 'as_time' ], 'date' => [ 60,
      > sub { "DUMMY" }, 'as_date' ], 'gYear' => [ 45, sub { "DUMMY" }, 'as_gYear'
      > ], 'string' => [ 100, sub { "DUMMY" }, 'as_string' ], 'dateTime' => [ 75,
      > sub { "DUMMY" }, 'as_dateTime' ], 'boolean' => [ 90, sub { "DUMMY" },
      > 'as_boolean' ], 'float' => [ 30, sub { "DUMMY" }, 'as_float' ], 'anyURI' =>
      > [ 95, sub { "DUMMY" }, 'as_anyURI' ], 'long' => [ 25, sub { "DUMMY" },
      > 'as_long' ], 'gDay' => [ 40, sub { "DUMMY" }, 'as_gDay' ], 'gMonthDay' => [
      > 50, sub { "DUMMY" }, 'as_gMonthDay' ], 'gYearMonth' => [ 55, sub { "DUMMY"
      > }, 'as_gYearMonth' ], 'duration' => [ 80, sub { "DUMMY" }, 'as_duration' ],
      > 'base64Binary' => [ 10, sub { "DUMMY" }, 'as_base64Binary' ], 'zerostring'
      > => [ 12, sub { "DUMMY" }, 'as_string' ], 'gMonth' => [ 35, sub { "DUMMY" },
      > 'as_gMonth' ] }, '_encodingStyle' =>
      > 'http://schemas.xmlsoap.org/soap/encoding/', '_objectstack' => {}, '_level'
      > => 0, '_context' => $VAR1->{'_context'}, '_signature' => [], '_soapversion'
      > => '1.1', '_maptype' => {}, '_use_default_ns' => 1, '_namespaces' => {
      > 'http://www.w3.org/2001/XMLSchema' => 'xsd',
      > 'http://schemas.xmlsoap.org/soap/encoding/' => 'soapenc',
      > 'http://www.w3.org/2001/XMLSchema-instance' => 'xsi',
      > 'http://schemas.xmlsoap.org/soap/envelope/' => 'soap' }, '_seen' => {
      > '47710124' => { 'recursive' => 0, 'count' => 1, 'value' => bless( { '_name'
      > => 'Body', '_signature' => [ 'soap:Body ' ], '_value' => [ \bless( { '_name'
      > => 'myxmlstring', '_type' => 'xml', '_signature' => [ 'myxmlstring ' ],
      > '_value' => [ undef ], '_attr' => {} }, 'SOAP::Data' ) ], '_prefix' =>
      > 'soap', '_attr' => {} }, 'SOAP::Data' ), 'multiref' => '' }, '47709704' => {
      > 'recursive' => 0, 'count' => 1, 'value' =>
      > ${$VAR1->{'_context'}{'_serializer'}{'_seen'}{'47710124'}{'value'}{'_value'}[0]},
      > 'multiref' => '' }, '47708888' => { 'recursive' => 0, 'count' => 1, 'value'
      > => bless( { '_name' => 'Envelope', '_signature' => [ 'soap:Envelope ' ],
      > '_value' => [ \bless( { '_name' => undef, '_signature' => [ 'soap:Body ' ],
      > '_value' => [
      > $VAR1->{'_context'}{'_serializer'}{'_seen'}{'47710124'}{'value'} ], '_attr'
      > => {} }, 'SOAP::Data' ) ], '_prefix' => 'soap', '_attr' => {
      > '{http://schemas.xmlsoap.org/soap/envelope/}encodingStyle' =>
      > 'http://schemas.xmlsoap.org/soap/encoding/' } }, 'SOAP::Data' ), 'multiref'
      > => '' }, '47709464' => { 'recursive' => 0, 'count' => 1, 'value' =>
      > $VAR1->{'_context'}{'_serializer'}{'_seen'}{'47708888'}{'value'}{'_value'}[0],
      > 'multiref' => '' }, '44074308' => { 'recursive' => 0, 'count' => 1, 'value'
      > =>
      > $VAR1->{'_context'}{'_serializer'}{'_seen'}{'47710124'}{'value'}{'_value'}[0],
      > 'multiref' => '' }, '47709740' => { 'recursive' => 0, 'count' => 1, 'value'
      > =>
      > ${$VAR1->{'_context'}{'_serializer'}{'_seen'}{'47708888'}{'value'}{'_value'}[0]},
      > 'multiref' => '' } }, '_attr' =>
      > $VAR1->{'_context'}{'_serializer'}{'_seen'}{'47708888'}{'value'}{'_attr'},
      > '_multirefinplace' => 0, '_on_nonserialized' =>
      > $VAR1->{'_context'}{'_on_nonserialized'}, '_xmlschema' =>
      > 'http://www.w3.org/2001/XMLSchema', '_ns_prefix' => '', '_readable' => 1,
      > '_ns_uri' => 'ifep-main', '_encoding' => 'UTF-8', '_autotype' => 0 },
      > 'SOAP::Serializer' ), '_schema' => undef, '_packager' => bless( {
      > '_env_location' => '/main_envelope', '_content_encoding' => '8bit',
      > '_env_id' => '', '_parts' => [], '_persist_parts' => 0, '_parser' => undef
      > }, 'SOAP::Packager::MIME' ), '_on_action' => sub { "DUMMY" }, '_on_fault' =>
      > sub { "DUMMY" } }, 'SOAP::Lite' ), '_current' => [ $VAR1->{'_content'} ] },
      > 'SOAP::SOM' );
      >
      > ############### END OUT ##############
      >
      > I was asking about exact URI what I need to use, but EFile Team did not like
      > to respond.
      >
      > Email what I got from EFile Team:
      >
      > Below is an example of what the initial connection is supposed to look like.
      >
      >
      > <?xml version='1.0' encoding='UTF-8'?>
      >
      > <SOAP-ENV:Envelope
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      >
      > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      >
      > xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      >
      > <SOAP-ENV:Header></SOAP-ENV:Header>
      >
      > <SOAP-ENV:Body>
      >
      > <accept xmlns="ifep">
      >
      > <transaction>
      >
      > <authentication>
      >
      > <irdNumber value="103226902"/>
      >
      > <locationNumber value="001"/>
      >
      > <package name="BMSO" version="1.00"/>
      >
      > </authentication>
      >
      > <get/>
      >
      > </transaction>
      >
      > </accept>
      >
      > </SOAP-ENV:Body>
      >
      > </SOAP-ENV:Envelope>
      >
      >
      > To which you should receive a JSessionID in the headers to store a cookie,
      > and a challenge value
      >
      > The session is now created and will timeout within approx 30 seconds, so
      > if you do not respond with the same JSessionID within that time with the
      > challenge response, you would receive a http 500 error which would indicate
      > the session had expired .
      >
      >
      >
      > I do not know What I need to do.
      >
      > My Company depends on this SOAP Access.
      >
      >
      >
      > PLEASE HELP
      >
      > Regards
      >
      > Milan Belobaba,
      >
      > EMail:
      >
      > sales@...
      >
    • Martin Busik
      Hi Milan, use : use SOAP::Lite (+trace = [qw(transport debug parameters)]); instead of use SOAP::Lite that way you get dumped the xml-contents of the request
      Message 2 of 2 , Oct 13, 2010
      View Source
      • 0 Attachment
        Hi Milan,

        "use":

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

        instead of

        use SOAP::Lite

        that way you get dumped the xml-contents of the request and the response. If
        you have
        a working example of a request, you might figure out, what is different,
        what might
        cause the problem.

        The working example you've given, contains the following main element:

        <accept xmlns="ifep">

        "ifep" is the URI. Normally it looks a bit different, but it might be
        correct.

        you call should look like:

        $soap->default_ns("ifep")
        $soap->call("accept",$parameters)

        where $parameters are some instances of SOAP::Data, e.g.

        SOAP::Data->name("transaction")->value(
        \SOAP::Data->value(
        SOAP::Data->name("authentication")->value(
        \SOAP::Data->value(
        SOAP::Data->name("irdNumber")->attr( { value =>
        "103226902" } )
        )
        )
        )
        )

        > > I am very new on SOAP.

        I encourage you to google for SOAP and learn more about it. If you are
        serious to
        implement any SOAP-based-webservice you'll need some basic knowledge.

        Cheers,
        Martin
      Your message has been successfully submitted and would be delivered to recipients shortly.