5 Replies Latest reply on Aug 8, 2006 2:50 PM by Mesius

    Web Service with complextype

    pbeblo
      I am trying to access a very simple webservice which uses a "complexType" of invoke argument.
      A part of the wsdl looks like this:
      <complexType name="PongGateRequest">
      <sequence>
      <element name="version" nillable="true" type="xsd:positiveInteger"/>
      <element maxOccurs="unbounded" minOccurs="0" name="linkcode" type="xsd:string"/>
      </sequence>
      </complexType>
      <element name="pongGate">
      <complexType>
      <sequence>
      <element name="req" nillable="true" type="impl:PongGateRequest"/>
      </sequence>
      </complexType>
      </element>
      <complexType name="PongGateResponse">
      <sequence>
      <element name="date" nillable="true" type="xsd:string"/>
      <element name="time" nillable="true" type="xsd:string"/>
      </sequence>
      </complexType>


      After reviewing a number of posts and other sites it would seem that the correct way to access this service is to do the following:
      <cfscript>
      args = structNew();
      args.version = 2;
      request.service = createObject("webservice"," http://localhost:8600/ponggate/service?wsdl");
      request.response = request.service.PongGateRequest(argumentCollection = args );
      </cfscript>

      However I receive this error message:
      Web service operation "PongGateRequest" with parameters {VERSION={2},} could not be found.


      Any help with this problem would be appreciated.

      Peter
        • 1. Re: Web Service with complextype
          pbeblo Level 1
          Does any one have a suggestion on how to go about debugging this inorder to get the correct structure for this web service?

          Any suggestions are welcomed.
          Thanks

          Peter
          • 2. Re: Web Service with complextype
            ajpowellatl
            You could always consume the web service in dreamweaver to see what you should be passing it.
            • 3. Re: Web Service with complextype
              pbeblo Level 1
              Thank you for the suggestion. However, this was the first thing I tried:

              <cfset eTray = structNew()>
              <cfset eTray.version = 2>
              <cfinvoke
              webservice=" http://localhost:8600/ponggate/service?wsdl"
              method="PongGateRequest"
              returnvariable="aPongGateResponse">
              <cfinvokeargument name="req" value="#eTray#"/>
              </cfinvoke>

              The result was :
              Web service operation "PongGateRequest" with parameters {req={{VERSION={2},}},} could not be found.

              I am still working on this problem, so any other assistance would be welcomed.
              Peter


              • 4. Re: Web Service with complextype
                jimgreen920
                yes i have the same question . i am trying to access a very simple webservice :googel adwords api : https://adwords.google.com/api/adwords/v4/CampaignService?wsdl .
                want to add a new campaign ,code just bellow:

                <cfset stcCampaign = StructNew()>
                <cfset stcCampaign.Name = "Campaign5" & RandRange(1,100)>
                <cfset stcCampaign.DailyBudget = 10000 >
                <cfdump var="#stcCampaign#" >
                <cfset objCampaign = obInfo.addCampaign(stcCampaign)>


                the function addCampaign(stcCampaign) is bellow:
                <cffunction name="addCampaign" access="public" >
                <cfargument name="strCampaign" type="any" required="yes"> <cfinvoke
                webservice="#VARIABLES.ws#" method="addCampaign"
                returnvariable="VARIABLES.aReturn">
                <cfinvokeargument name="campaign" value="#ARGUMENTS.strCampaign#"/>
                </cfinvoke>
                </cffunction>
                it can add new campaign ,but when i set the campaign status ,


                code as bellow:
                <cfset stcCampaign = StructNew()>
                <cfset stcCampaign.Name = "Campaign5" & RandRange(1,100)>
                <cfset stcCampaign.DailyBudget = 10000 >
                <cfset stcCampaign.status = "Active" >
                <cfdump var="#stcCampaign#" >
                <cfset objCampaign = obInfo.addCampaign(stcCampaign)>


                it cannot run and show some error:


                Web service operation "addCampaign" with parameters
                {campaign={{NAME={Campaign591},STATUS={{ACTIVE={Active},}},DAILYBUDGET={10000},}},}
                could not be found.


                Can you tell me ?Thank you sincely. i use the v3 wsdl .the document
                is here
                : http://www.google.com/apis/adwords/developer3/CampaignService.html#ad...






                • 5. Re: Web Service with complextype
                  HELP! I'm seeing the exact same problem on Google Adwords. I've tried everything and even looked at the following site ( http://hcc.musc.edu/research/shared_resources/xml_complex_types_to_cf_structure_notes.cfm) which has some great info on how to proceed but it still doesn't seem to work. Any assistance in this would be GREATLY appreciated!