Topic
3 replies Latest Post - ‏2010-09-21T08:53:48Z by JonathanPLawrence
geobotsios
geobotsios
1 Post
ACCEPTED ANSWER

Pinned topic how can i consume a cics web service via php

‏2010-09-20T13:07:42Z |
i've created a web service in cics (v3.2) using DFHLS2WS utility.

the test with Web Services Explorer in RDz works fine, but

when i'm trying to consume that web service via php i get the following error
====Uncaught SoapFault exception: WSDL SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://10.72.100.121:3013/CSYCICNLProvider ........====
the error in cics's log is ===Internal Server Error===

the php code is ==$client = new SoapClient("http://10.72.100.121:3013/CSYCICNLProvider");== and that script runs via wamp server in xp win.

when trying to test this webservice thru firefox i'm getting as a response the same error
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Internal Server Error</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

any ideas ?
Updated on 2010-09-21T08:53:48Z at 2010-09-21T08:53:48Z by JonathanPLawrence
  • JonathanPLawrence
    JonathanPLawrence
    30 Posts
    ACCEPTED ANSWER

    Re: how can i consume a cics web service via php

    ‏2010-09-20T16:44:07Z  in response to geobotsios
    I think you may be using the PHP SoapClient incorrectly. The SoapClient constructor takes the URI of the WSDL describing the Web Service you wish to access, rather than the Web address of the Web Service itself. Once you have constructed a SoapClient PHP object from the WSDL, you can then use methods on that object to invoke the actual target Web Service. There is more documentation and examples available on the internet.

    The WSDL may be available from a server or in a local file, however by using the target web service as the argument to the SoapClient constructor you will send an HTTP GET request with no SOAP body to the CICS web service, hence the error.

    To use SoapClient, you will need to use the WSDL for the WebService that you set up using DFHLS2WS.

    It seems that your question is really posted on the wrong forum as this forum is intended for users of the CICS SupportPac CA1S (PHP support in CICS), which doesn't support the PHP Soap extension.
  • gscreen
    gscreen
    1 Post
    ACCEPTED ANSWER

    Re: how can i consume a cics web service via php

    ‏2010-09-21T05:46:35Z  in response to geobotsios
    thanks for your help.
    you are right about my posting in that forum.
    • JonathanPLawrence
      JonathanPLawrence
      30 Posts
      ACCEPTED ANSWER

      Re: how can i consume a cics web service via php

      ‏2010-09-21T08:53:48Z  in response to gscreen
      No problem. Of course, if you wished, you could use the PHP SupportPac CA1S to connect to your target program and create a RESTful Web Service front end to your program instead of using conventional SOAP Web Services.

      You could then consume the RESTful Web Service from PHP on another platform, or use PHP in CICS. If you are running CICS TS v4.1, then the CICS Dynamic Scripting Feature Pack is a viable alternative.

      Good luck with your chosen approach.