PHP SOAP - Timeout from the target service

View: New views
1 Messages — Rating Filter:   Alert me  

PHP SOAP - Timeout from the target service

by jimmyk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am new to SOAP and working on a project to retrieve documents using a wsdl but getting a timeout from the server.

I am using WAMP 2 PHP SOAP Client.

Here is my code for retrieving the documents:

      $client = new SoapClient("http://test:9650/XDSbReg/services/DocumentRegistry_Service?wsdl",array(
        'trace'                    => 1,
        'exceptions'               => 0,
        'soap_version'             => 'SOAP_1_2',
        'style'                    => 'SOAP_RPC|SOAP_DOCUMENT',
        'use'                      => 'SOAP_ENCODED|SOAP_LITERAL',
        'encoding'                 => 'UTF-8',
        'runType'                  => 'SEQUENTIAL',
        'action'                   => 'AdhocQueryResponse',
        'compression'              => 'SOAP_COMPRESSION_ACCEPT|SOAP_COMPRESSION_GZIP|SOAP_COMPRESSION_DEFLATE',
        'timeout'                  => 6000,
        'connection_timout'        => 6000,
        'default_socket_timeout'   => 6000,
        'target_timeout'           => 6000,
        'location'                 => 'http://test:9650/XDSbReg/services/DocumentRegistry_Service',
        'uri'                      => 'http://test:9650/XDSbReg/services/DocumentRegistry_Service'));

      $client->DocumentRegistry_RegistryStoredQuery('AdhocQueryRequest',"$body");

      print "<pre>\n";
      print "Request :\n".$client->__getLastRequest() ."\n";
      print "Response:\n".$client->__getLastResponse()."\n";
      print "Headers:\n".$client->__getLastResponseHeaders()."\n";
      print "</pre>";
     
The headers are returning but the Response is getting the following error: Timeout from the target service

Here is my request:

POST http://test:9650/XDSbReg/services/DocumentRegistry_Service HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: application/soap+xml;charset=UTF-8;action="urn:ihe:iti:2007:RegistryStoredQuery"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: planck:9650
Content-Length: 836
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
 <soapenv:Body>
  <query:AdhocQueryRequest xmlns:query="urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0" xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
   <query:ResponseOption returnComposedObjects="true" returnType="LeafClass" />
   <rim:AdhocQuery id="urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d">
    <rim:Slot name="$XDSDocumentEntryPatientId">
     <rim:ValueList>
      <rim:Value>'300000^^^&2.22.111.1.111111.1.111.1.1.1000.1&ISO'</rim:Value>
     </rim:ValueList>
    </rim:Slot>
    <rim:Slot name="$XDSDocumentEntryStatus">
     <rim:ValueList>
      <rim:Value>('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved')</rim:Value>
     </rim:ValueList>
    </rim:Slot>
  </query:AdhocQueryRequest>
 </soapenv:Body>
</soapenv:Envelope>

This request works in SOAPUI (Third Party Tool) but I really want to get it to work in PHP so I can run queries etc etc.

I have tried every possible combination of new SoapClient but nothing has worked so far.  Like I mentioned, I am new to SOAP and would really appreciate any help at all.

Thanks in advance.