Skip to main content
Inspiring
January 20, 2011
Answered

Problems connecting to php web service

  • January 20, 2011
  • 1 reply
  • 2197 views

Hello

I am pretty raw when it comes to using web services. I am facing a bit of a problem.

I have been given a url to a web service. http://41.208.61.35/legacyfallback/ws/legacyLifeWS.php?wsdl

I am trying to connect using cfinvoke:

<cfinvoke webservice="http://41.208.61.35/legacyfallback/ws/legacyLifeWS.php?wsdl" method="test"  returnVariable="result"> </cfinvoke>

<cfoutput>#result.test#</cfoutput>

I keep getting the following error:

Cannot generate stub objects for web service invocation.

Name: http://41.208.61.35/legacyfallback/ws/legacyLifeWS.php?wsdl. WSDL: http://41.208.61.35/legacyfallback/ws/legacyLifeWS.php?wsdl. java.io.IOException: Type {http://www.w3.org/2001/XMLSchema}char is referenced but not defined. It is recommended that you use a web browser to retrieve and examine the requested WSDL document to ensure it is correct. If the requested WSDL document cannot be retrieved or is dynamically generated, it is likely that the target web service has programming errors.

Please can someone assist me in getting around this.

Have a look at the service url if you need to.


Ive been at it all day and im ready to pull my hair out!

Thanks in advance

    This topic has been closed for replies.
    Correct answer Owainnorth

    As far as I can tell, your webservice requires a string to be passed to it called "teststring". This works:

    <cfinvoke webservice="http://41.208.61.35/legacyfallback/ws/legacyLifeWS.php?wsdl" method="test" returnVariable="returnstring">
        <cfinvokeargument name="teststring" value="x" />
    </cfinvoke>

    Give that a go.

    1 reply

    Owainnorth
    Inspiring
    January 20, 2011

    <part name="gender" type="xsd:char"/>

    I wasn't aware there was such a type as "char" in XML docs, I'd guess it's invalid XML.

    Inspiring
    January 20, 2011

    Hi

    Thanks for the reply.

    Ok we changed that and we are now experiencing a new error...

    Im using the method "test" and i am receiving this:

    Web service operation test with parameters {} cannot be found.

    My code is quite basic:

    <cfinvoke webservice="http://41.208.61.35/legacyfallback/ws/legacyLifeWS.php?wsdl" method="test"  returnVariable="returnstring"> </cfinvoke>


    I really appreciate your help!

    Owainnorth
    OwainnorthCorrect answer
    Inspiring
    January 20, 2011

    As far as I can tell, your webservice requires a string to be passed to it called "teststring". This works:

    <cfinvoke webservice="http://41.208.61.35/legacyfallback/ws/legacyLifeWS.php?wsdl" method="test" returnVariable="returnstring">
        <cfinvokeargument name="teststring" value="x" />
    </cfinvoke>

    Give that a go.