Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to use a web service developed by another group in the com +pany using Oracle 10AS. Other VS.Net users can use the service, but w +hen I try using SOAP::LITE, I get : SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 504 Gateway Time +out This running against port 7782. The WSDL file at port 7782 mentions 77 +81. Has anyone experience of this.. <?xml version="1.0" encoding="UTF-8" ?> - <definitions name="PRSReceiveMessageInterface" targetNamespace="http +://com.nandb.pharmacy.ws/PRSReceiveMessageInterface.wsdl" xmlns="http +://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://com.nandb.pharmacy.ws +/PRSReceiveMessageInterface.wsdl" xmlns:xsd="http://www.w3.org/2001/X +MLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <documentation>WSDL for Service: PRSReceiveMessageInterface, generat +ed by Oracle WSDL toolkit (version: 1.1)</documentation> - <types> <schema targetNamespace="http://com.nandb.pharmacy.ws/PRSReceiveMess +ageInterface.xsd" xmlns:tns="http://com.nandb.pharmacy.ws/PRSReceiveM +essageInterface.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x +sd="http://www.w3.org/2001/XMLSchema" /> </types> - <message name="ReceiveMessageOutput"> <part name="output" element="xsd:any" /> </message> - <message name="ReceiveMessageInput"> <part name="param0" element="xsd:any" /> </message> - <portType name="PRSReceiveMessageInterfacePortType"> - <operation name="ReceiveMessage"> <input message="tns:ReceiveMessageInput" /> <output message="tns:ReceiveMessageOutput" /> </operation> </portType> - <binding name="PRSReceiveMessageInterfaceBinding" type="tns:PRSRecei +veMessageInterfacePortType"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style +="document" /> - <operation name="ReceiveMessage"> <soap:operation soapAction="urn:oracle:ReceiveMessage" /> - <input> <soap:body use="literal" namespace="urn:com-nandb-pharmacy-ws-PRSRec +eiveMessageInterface" /> </input> - <output> <soap:body use="literal" namespace="urn:com-nandb-pharmacy-ws-PRSRec +eiveMessageInterface" /> </output> </operation> </binding> - <service name="PRSReceiveMessageInterface"> - <port name="PRSReceiveMessageInterfacePort" binding="tns:PRSReceiveM +essageInterfaceBinding"> <soap:address location="http://psdappweb1.csa.scot.nhs.uk:7781/PRS/P +RSDataRefresh" /> </port> </service> </definitions> Here's my perl script:- use SOAP::Lite +trace; use SOAP::MIME; use Data::Dumper; my $xml = ""; open (FILE, $ARGV[0]); while ( <FILE>){ $xml .= $_; } my $data = SOAP::Data->name( 'msg ')->value($xml)->type( 'xml '); my $soap = SOAP::Lite ->outputxml(1) ->readable(1) ->proxy("http://psdappweb1.csa.scot.nhs.uk:7782/PRS/PRSRegistration") ->uri("urn:oracle:ReceiveMessage") ->on_action(sub { sprintf '"%s"', shift }); my $som = $soap->ReceiveMessage("$data"); exit 0; and here's the output in detail:- SOAP::Serializer::new: () SOAP::Deserializer::new: () SOAP::Parser::new: () SOAP::Lite::new: () SOAP::Transport::HTTP::Client::new: () SOAP::Serializer::envelope: () SOAP::Serializer::envelope: ReceiveMessage SOAP::Data=HASH(0x20fad58) SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x2104 +11c) SOAP::Transport::HTTP::Client::send_receive: POST http://psdappweb1.cs +a.scot.nhs .uk:7782/PRS/PRSRegistration HTTP/1.1 Accept: text/xml Accept: multipart/* Content-Length: 586 Content-Type: text/xml; charset=utf-8 SOAPAction: "urn:oracle:ReceiveMessage" <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:S OAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="ht +tp://schem as.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSc +hema" SOAP -ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > <SOAP-ENV:Body > <namesp1:ReceiveMessage xmlns:namesp1="urn:oracle:ReceiveMessage" > <c-gensym3 xsi:type="xsd:string" >SOAP::Data=HASH(0x20fad58)</c-gensym3></namesp1:ReceiveMessage> +</SOAP-ENV :Body></SOAP-ENV:Envelope> SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x242 +fd08) SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 504 Gateway Time +out Connection: close Date: Tue, 18 Jan 2005 15:14:33 GMT Server: NetCache appliance (NetApp/5.5R6D15) Content-Length: 283 Content-Type: text/html Client-Date: Tue, 18 Jan 2005 15:14:35 GMT Client-Peer: 164.134.80.80:3128 Client-Response-Num: 1 Title: 504 Gateway Timeout <HTML> <HEAD><TITLE>504 Gateway Timeout</TITLE></HEAD> <BODY> <H1>Gateway Timeout</H1> <H4> The following error occurred:<P> [code=GATEWAY_TIMEOUT] A gateway timeout occurred. The server is unrea +chable. Re try the request. </H4> <HR> Please contact the administrator. </BODY> </HTML> main::(sendXmlToPRS.pl:24): exit 0;

2005-01-19 Edited by Arunbear: Changed title from 'SOAP::LITE', as per Monastery guidelines

Replies are listed 'Best First'.
Re: SOAP::LITE Gateway Timeout
by gellyfish (Monsignor) on Jan 18, 2005 at 16:11 UTC

    Firstly, the response you are getting from the server is coming from a caching proxy and not from the SOAP server - this is possibly because you are using an incorrect URL or there is some other network issue: are you able to contact the URL http://psdappweb1.csa.scot.nhs.uk:7782/PRS/PRSRegistration from a web browser from the same machine as you are running the SOAP client on? Secondly it appears from the WSDL port definition that you should actually be using the URI  http://psdappweb1.csa.scot.nhs.uk:7781/PRS/PRSDataRefresh.

    On closer inspection it would appear that there is something wrong with the WSDL file anyway - using the MS WSDL tool I get:

    Error: Unable to import binding 'PRSReceiveMessageInterfaceBinding' fr +om namespace 'http://com.nandb.pharmacy.ws/PRSReceiveMessageInterface +.wsdl'. - Unable to import operation 'ReceiveMessage'. - The element 'http://www.w3.org/2001/XMLSchema:any' is missing.
    This does not preclude the web service from working but does make it difficult to verify it and/or autogenerate client proxy code.

    /J\

      Thanks for that. When I try port 7781 I get: <PRSAcknowledgeEnv xmlns="http://www.eps.nds.scot.nhs.uk" xmlns:xsi="h +ttp://www. w3.org/2001/XMLSchema-instance" SchemaVersion="1.3"><TransactionHeader + SchemaVer sion="1.1"><MsgPriority>immediate</MsgPriority><MsgStatus>test</MsgSta +tus><Sende rDetails><OrganisationType>PRS</OrganisationType><OrganisationID>1100< +/Organisat ionID><OrganisationName>PSD Operations</OrganisationName></SenderDetai +ls><Softwa re><ProductName ProductVersion="1.0">PRS</ProductName><ProductAuthor>N +ewell and Budge LTD</ProductAuthor></Software><AppServiceName ServiceVersion="1. +0">PRS</Ap pServiceName><AppSTTL>3600</AppSTTL><AppTransID>00000000-0000-0000-000 +0-00000000 0000</AppTransID><AppTransStepRef>1</AppTransStepRef><AppTransDateTime +>2005-01-1 8T16:56:00-00:00</AppTransDateTime><MsgCategory>single</MsgCategory><A +ppBodyType Qty>1</AppBodyTypeQty><BodyDefinitions><BodyDefinition><Name>PRSAcknow +ledge</Nam e><Position>1</Position><Count>1</Count><Signing>false</Signing></Body +Definition ></BodyDefinitions></TransactionHeader><AppBodies><PRSAcknowledge Sche +maVersion= "1.3"><Code>10103
      <Description>PRS system not currently available</Descrip tion>
      PRS System not currently available: null
      </PRSAcknowledge ></AppBodies></PRSAcknowledgeEnv> ..even though I know the service is working and has just successfully processed the same message via dotnet and java. </code>

        Note from the trace output of the script what you are sending as the SOAP body:

        <SOAP-ENV:Body> <namesp1:ReceiveMessage xmlns:namesp1="urn:oracle:ReceiveMessage"> <c-gensym3 xsi:type="xsd:string">SOAP::Data=HASH(0x20fad58)</c-ge +nsym3> </namesp1:ReceiveMessage> </SOAP-ENV:Body>
        I guess that you were actually intending to sending the contents of $xml rather than the stringified SOAP::Data object in $data. Of course without knowing the precise document you are supposed to be sending it's difficult to say more.

        /J\