CFINVOKE webservice parameters

Hi, I am trying to consume a web service and having some
problems passing the parameters to it. I have used a web service
successfully before where the wsdl looked like this:
<GetUserDetails xmlns="
http://zesty.com/webservices">
<username>string</username>
<password>string</password>
<guidString>string</guidString>
</GetUserDetails>
and the coldfusion code to access it looked like this:
<cfinvoke
webservice="https://mobiledatacapture.zesty.com/alphatest.asmx?wsdl"
method="GetUserDetails"
returnvariable="zuser">
<cfinvokeargument name="username" value="#username#">
<cfinvokeargument name="password" value="#password#">
<cfinvokeargument name="guidString"
value="#zestyGUID#">
</cfinvoke>
where username, password and zestyGUID were just strings and
this worked fine.
Now they have added another method to the service that has a
WSDL that looks like this:
<SubmitResidueTests xmlns="
http://zesty.com/webservices">
<ResidueTests>
<ResidueTest>
<Label>string</Label>
<KPIN>int</KPIN>
<ResidueTypeCode>R or O or X or C or G or
L</ResidueTypeCode>
<CollectionDate>dateTime</CollectionDate>
<DispatchDate>dateTime</DispatchDate>
</ResidueTest>
<ResidueTest>
<Label>string</Label>
<KPIN>int</KPIN>
<ResidueTypeCode>R or O or X or C or G or
L</ResidueTypeCode>
<CollectionDate>dateTime</CollectionDate>
<DispatchDate>dateTime</DispatchDate>
</ResidueTest>
</ResidueTests>
</SubmitResidueTests>
So i thought that i would create an xml variable using cfxml
and invoke it like this:
<cfinvoke
webservice="https://mobiledatacapture.zesty.com/alphatest.asmx?wsdl"
method="SubmitResidueTests" returnvariable="retVar">
<cfinvokeargument name="ResidueTests"
value="#local.xmlRet#">
</cfinvoke>
where #local.xmlRet# is an xml variable (<cfxml
variable="local.xmlRet"...)
but this gives me an error message:
(Web service operation SubmitResidueTests with parameters
{ResidueTests={ 3813 O 18-06-2008 22-12-2008 5369 O 23-04-2008
22-12-2008 }} cannot be found.)
Can anyone tell me how to access a web service like this, or
what I am doing wrong? Thanks very much, and appreciate any help
anyone can offer
What is confusing me is how the parameters in this
wsdl are encapsulated within the <ResidueTests> and how to
pass multiple types of this object to the web service.

Ok... the first method was passing just strings, but I'm not
sure how to format it for the second method, because of the
<ResidueTests></ResidueTests> tag that the arguments
for the second method are encapsulated in. I have spoke to the .NET
developer who wrote it and he said the way in .NET was to send an
array ResidueTests [ ], but wasn't sure what the analogous method
in coldfusion would be. Sorry if I am misunderstanding something
obvious here. Thanks for your reply.

Similar Messages

  • Inheritance for webservice parameters

    Folks,
    please pardon if this topic has been covered before, but my search has not found much on this specifically.
    I am working on webservices using weblogic 9.1. Starting with an annotated Java bean, using jwsc/jws tasks to generate EJB, etc. All this is being done using ant scripts outside of the workbench.
    I am running into a problem when I try to expose complex types with inheritance as web method parameters. If I have a base class A and classes B and C extend A, when I define webservice method to take A as an argument schema in WSDL does not include declarations for B and C.
    If I create 2 separate methods for B and C, then I get correct WSDL.
    I get the same behaviour if subclassing is involved with member variables of complex types.
    Has anyone solved this problem before?
    Thanks in advance for any tips.

    Hi,
    following link could be helpful for webservice ( OCI) Parameters and configuration..
    SAP Supplier Relationship Management - SAP SRM Open Catalog Interface (B2B-OCI) [original link is broken]
    Thanks
    siva prasad.s

  • WebService parameters

    Hi anyone out there,
    I am writing a web service and have a proxy inside it. I am trying to pass in SAPTables from outside the webservice. I realised two things:
    1. If I am connecting the asmx file with another client with sap.net connector i can pass the actual SAPTable object in. when i do this, and declare the item in the parameters, the xml tag generated by the webservice has two instances of the table structure. for example:
          <PtblPoItems>
            <BAPIEKPOC>
              <PO_5fNUMBER>string</PO_5fNUMBER>
            </BAPIEKPOC>
            <BAPIEKPOC>
              <PO_5fNUMBER>string</PO_5fNUMBER>
            </BAPIEKPOC>
          </PtblPoItems>
    Logically since this is a table, each of this instance (am not sure, not a VB.Net guru) will represent a line item (correct me if i am wrong), does this mean that the current table during run time has two empty lines in it?
    What is the best way to pass in parameters into a web service?

    So in other words, for 4.6 installs, if i want to use a web service i still need to generate a proxy as i have done? Three questons are tied to this response:
    1. I want to use a web service to access let's say BAPI_SALESORDER_GETSTATUS. Do i create a proxy in a aSP.net web service project, where i will be having both a .sapwsdl and .asmx file?
    2. Do i just add web reference to .sapwsdl file? from the responses i am getting from you, it might not be possible right? if not then i will be calling the proxy locally in the asp.net web service and treat the web service as a wrapper.
    3. In creating a wrapper I have some problems referencing the BAPIXXTable from the sapwsdl file into the calling application. For example, I have created a scenario as in number (2), and I need to pass a table into the RFC/BAPI. therefore i managed to :
    public function xxx(byref table1 as <proj>.<webref>.BAPIXXXTable)
    however, when i call from the other application (which i referenced this web service to), i need to populate the table entries, i can't seem to do this, as intellisense only shows the structures but not the table. What's wrong with my declarations?

  • QueryViewData webservice parameters

    Hi all,
    I've created the QueryViewData webservice in my BW system and i'm trying to test it.
    When I execute a query which has no parameters everything is ok. But, when I am trying to execute a query that demands parameters I get an error message.
    I am not sure on how to pass the parameters to the query.
    The syntax is as follows -
    Infoprovider <myInfoProviderName>
    Parameter
    Item
      Name FILTER_IOBJNM_1
      Value 0MATERIAL
    Item
      Name FILTER_VALUE_LOW_1
      Value 500101
    Item
      Name FILTER_VALUE_HIGH_1
      Value 5000190
    Item
      Name FILTER_IOBJNM_2
      Value 0CALMONTH
    Item
      Name FILTER_VALUE_LOW_2
      Value 082005
    Item
      Name FILTER_VALUE_HIGH_1
      Value 122005
    Query <MyQueryName>
    ViewId <null>
    In this query the 0CALMONTH is mandatory, and the error I get is 'Invalid input' (Specify a value for variable Calendar Year/Month)

    http://help.sap.com/saphelp_nw04/helpdata/en/71/6c013a53271a05e10000000a11402f/frameset.htm. 
    Look for Commands for webTemplates >> Calling para...
    >> Default var......
    Good luck.

  • Consuming a webservice - 2

    Ok - so through the whole thread of the original post out the
    window.
    As it turns out Crystaltech does not allow you to call the
    cfc directly
    from their server. It MUST be invoked from another file.
    Which is why
    the error when browsing
    http://www.femsa.org/cfc/getMembers.cfc.
    Ok so that is odd - maybe secure -dunno.
    So now I have mad the cfc as simple as possible and I have
    confirmed
    that you can invoke it from the same server, another server
    in their
    network, and in fact a server outside their network.
    Now to the troubles at hand..........
    The cfc contains the following code - EXACTLY
    <cfcomponent hint="Returns minimal member data for
    consumption">
    <cffunction name="members" access="remote"
    returntype="string">
    <cfreturn "DevNet is great!">
    </cffunction>
    <cffunction name="firstws" access="remote"
    returntype="string">
    <cfreturn "DevNet is great!">
    </cffunction>
    </cfcomponent>
    If I call the cfc using the firstws function - the results
    are expected
    - yahoo it works..
    <cfinvoke webservice="
    http://www.femsa.org/cfc/getMembers.cfc?wsdl"
    method="firstws"
    returnvariable="returnedText">
    <cfoutput>
    #variables.returnedText#
    </cfoutput>
    HOWEVER - If I call the members function - it spits up at me.
    <cfinvoke webservice="
    http://www.femsa.org/cfc/getMembers.cfc?wsdl"
    method="members"
    returnvariable="returnedText">
    <cfoutput>
    #variables.returnedText#
    </cfoutput>
    Spit up =
    Web service operation "members" with parameters {} could not
    be found.
    The error occurred in
    C:\Domains\echowebs.com\wwwroot\gac\consumefemsa.cfm: line 2
    1 : <cfinvoke webservice="
    http://www.femsa.org/cfc/getMembers.cfc?wsdl"
    2 : method="members"
    3 : returnvariable="returnedText">
    4 :
    Any idea why the EXACT same function - differing only in name
    - would
    work one way but not the other? In order to rule out an
    application
    issue, there is a new application.cfm file in the cfc folder
    with the
    simple contents of <cfset mebe=""> - nothing else.
    HELP!
    Chris Luksha
    Echo Web Services
    Making Your Website Resound
    603-831-0099
    http://www.echowebservices.com/
    CAN-SPAM Compliant Email Newsletters - only $.05 per
    Subscriber
    http://www.echowebservices.com/email

    Hi,
    As reply to his blog DuraiRaj Athavan Raja has provided the following information.Thank you Raja.
    http_client->receive - Communication failure obtained
    2006-07-18 22:29:04 Durairaj Athavan Raja [Reply]
    do you connect to internet via proxy? if yes you have to either code proxy authentication or simply maintain it in transaction SICF.
    go to
    SICF->client->proxy settings
    go to http_log tab
    host name: proxyhost.domain.com
    port: <portno>
    user - > proxy user id
    pwd -> proxy pwd and save it .
    and this setting is per client , so you have to do that for all clients.
    Regards
    Raja
    I am working on getting the proxy settings completed and will update the post when i am through with all the findings.

  • Coldfusion webservice?

    I have two webservices with the same code but with different names
    <cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">
    <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
    <cfreturn return>
    </cffunction>
    <cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">
    <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
    <cfreturn return>
    </cffunction>
    But when I invoke the first one return a check box.
    For the second service displays an error as such? Can any one explain me a reason behind it?
    Her is the invocation code and the error
    <html>
    <body><cfcomponent>
    <cfinvoke 
    webservice="http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
    method="getUserNameFormFieldn"  
    returnvariable="saleshistory">
    <!--- <cfinvokeargument name="requestedEvent" value="recipientForm"/>--->
    </cfinvoke>
    <cfoutput>  
    #saleshistory#</cfoutput></cfcomponent>
    </body>
    </html>
    The web site you are accessing has experienced an unexpected error.
    Please contact the website administrator.
    The following information is meant for the website developer for debugging purposes.
    Error Occurred While Processing Request
    Web service operation getUserNameFormFieldn with parameters {} cannot be found.
    The error occurred in C:\ColdFusion8\wwwroot\selfprojects\webservice3.cfm: line 6
    4 : <cfinvoke webservice="http://172.16.172.41:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
    5 :            method="getUserNameFormFieldn"
    6 :              returnvariable="saleshistory">
    7 :           <!---     <cfinvokeargument name="requestedEvent" value="recipientForm"/>--->
    8 : </cfinvoke>
    Resources:
    Check the ColdFusion documentation to verify that you are using the correct syntax.
    Search the Knowledge Base to find a solution to your problem.
    Browser 
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    Remote Address 
    127.0.0.1
    Referrer 
    Date/Time 
    09-Apr-09 04:05 PM
    Stack Trace (click to expand)
    at cfwebservice32ecfm989209474.runPage(C:\ColdFusion8\wwwroot\selfprojects\webservice3.cfm:6 )
    coldfusion.xml.rpc.ServiceProxy$ServiceMethodNotFoundException: Web service operation getUserNameFormFieldn with parameters {} cannot be found.
         at coldfusion.xml.rpc.ServiceProxy.invoke(ServiceProxy.java:147)
         at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2222)
         at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:417)
         at cfwebservice32ecfm989209474.runPage(C:\ColdFusion8\wwwroot\selfprojects\webservice3.cfm:6)
         at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:196)
         at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:370)
         at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
         at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
         at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
         at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
         at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
         at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
         at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
         at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
         at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
         at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
         at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
         at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
         at coldfusion.CfmServlet.service(CfmServlet.java:175)
         at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
         at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
         at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
         at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
         at jrun.servlet.FilterChain.service(FilterChain.java:101)
         at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
         at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
         at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
         at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
         at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
         at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
         at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
         at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
         at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

    There are two methods, but it is one web service, not two. The code you should have saved as the file BaseConsole.cfc is
    <cfcomponent>
    </cfcomponent>
    There is no need for HTML or component tags in the caller. The calling page, say, wsCaller.cfm, should be something like
    <cfinvoke
    webservice= "http://localhost:8080/CTiWebServicesAPI/console/library/BaseConsole.cfc?wsdl"
    method="getUserNameFormFieldn"
    returnvariable="saleshistory">
    </cfinvoke>
    <cfoutput>#saleshistory#</cfoutput>
    <cffunction name="getUserNameFormField" access="remote" output="false" returntype="string" displayname="getUserNameFormField">
    <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
    <cfreturn return>
    </cffunction>
    <cffunction name="getUserNameFormFieldn" access="remote" output="false" returntype="string" displayname="getUserNameFormFieldn">
    <cfset var return = '<input name="userName" type="text" size="40" maxlength="40">'>
    <cfreturn return>
    </cffunction>

  • Complex datatypes - WebServices/APIs

    I'm attempting to learn how to manage Web Services/APIs. I'm using ColdFusion 8 and the webservice is open (no key or password required). With my createobject I don't see where to include the operation or method (see list below) like was done with the <cfinvoke>. With <cfinvoke> I had save the document as wscfc.cfm is it the same with createobject? Thanks for the suggestions TheRealAgentK.
    At the bottom of this page is a “Second Attempt” using the Put and <cfinvoke>. This modified code that was sent to me by BKBK (Thanks!). The error message follows the code.
    I'm getting an error message (see below). Any help with this API or sample connections would be greatly appreciated.
    ?WSDL link below:
    http://www.spraci.com/services/soap/index.php?wsdl
    My script below (operation/method = area_list):
    <cfscript>
    stUser = structNew();
    stUser.appkey = "";
    stUser.username = "";
    stUser.password = "";
    stUser.area = "x0usa";
    stUser.name = "";
    ws = createObject("webservice", "http://www.spraci.com/services/soap/index.php?wsdl");
    myReturnVar = ws.echoStruct(stUser);
    </cfscript>
    <cfoutput>#myReturnVar#</cfoutput>
    Link to API notes:
    C:\Users\djones\Documents\Affiliates\spraci\Webmaster Services SPRACI API SOAP area_list.mht
    Operations /Methods below?
    http://www.xmethods.net/ve2/WSDLAnalyzer.po;jsessionid=GuNmIhBRDeHT2vRN_L4c7nK8
    area_list
    area_getinfo
    event_list
    event_getinfo
    event_show
    event_add
    event_update
    user_getinfo
    user_getarea
    Error Message Below:
    Web service operation echoStruct with parameters {{USERNAME={},PASSWORD={},AREA={x0usa},APPKEY={},NAME={}}} cannot be found.
    The error occurred in C:\ColdFusion8\wwwroot\ybah8r\CMS\Progs\eraseme3.cfm: line 17
    15 : stUser.name = "";
    16 : ws = createObject("webservice", "http://www.spraci.com/services/soap/index.php?wsdl");
    17 : myReturnVar = ws.echoStruct(stUser);
    18 : </cfscript>
    19 :
    Second attempt:
    <cfset AreaFetch = createobject("java","java.util.Hashtable")>
    <cfscript>
    AreaFetch.put("appkey", "");
    AreaFetch.put("username", "");
    AreaFetch.put("password", "");
    AreaFetch.put("area", "x0usa");
    AreaFetch.put("name", "");
    </cfscript>
    <cfinvoke
    webservice = "http://www.spraci.com/services/soap/index.php?wsdl"
    method="area_list"
    inputStructArray ="#AreaFetch#"
    returnvariable="foo"
    >
    <cfdump var="#foo#">
    Error message:
    Web service parameter name data cannot be found in the provided parameters {INPUTSTRUCTARRAY}.
    The error occurred in C:\ColdFusion8\wwwroot\ybah8r\wscfc.cfm: line 41
    39 : webservice = "http://www.spraci.com/services/soap/index.php?wsdl"
    40 : method="area_list"
    41 : inputStructArray ="#AreaFetch#"                       
    42 : returnvariable="foo"
    43 : >

    Hi,
    Did you solve this one?
    I'm having the exact same problem, trying to communicate with Oracle Wireless webservices from htmldb,
    which kind of made me dissapointed because they are both Oracle products! Basically what wireless wants is an array input and htmldb complains about this!
    Any solutions?
    Magnus

  • Consuming Exigo Webservices

    I am working with a company named Exigo. They have posted their webservices API publicly at http://api.exigo.com/3.0/ since you need proper  credentials (which I have, of course) in order to actually use it.
    If you go there, let's say to the GetCustomers area (http://api.exigo.com/3.0/ExigoApi.asmx?op=GetCustomers) you will see that they give multiple methods for using their web services.  I know that my credentials and test works because I can manually do their CSV method.
    I cannot get ColdFusion to work with a CFINVOKE command, however:
    <CFINVOKE webservice="http://api.exigo.com/3.0/ExigoApi.asmx?WSDL" username="yourLoginName" password="yourPassword"
    company="yourCompany" method="GetCustomers" CustomerID="123" returnvariable="adzCustInfo" />
    I get the message "Web service operation GetCustomers with parameters  {COMPANY={yourCompany},CUSTOMERID={123}} cannot be found." even though I have tested and know that it does exist (of course I am using real values, not the example ones shown here).
    Now, the main IT guy told me that I need to reference this:
    //Create Main API Context Object
        ExigoApi api = new ExigoApi();
        //Create Authentication Header
        ApiAuthentication auth = new ApiAuthentication();
        auth.setLoginName("yourLoginName");
        auth.setPassword("yourPassword");
        auth.setCompany("yourCompany");
        api.setApiAuthenticationValue(auth);
    every time I call their service.
    How do I do this?  How do I get the credentials so that I can call the service?  It seems to me the "new ExigoApi()" is going to be looking for a local reference, but this system is located on a remote server, so I'm not sure how to do that.
    Any help would be most appreciated.
    Thank youi!
    RLS
    Message was edited by: RLS

    One of the solutions we've encountered is to use XML/XMLParse to fake the authorization header entity and adding it to the web service call using the addSOAPRequestHeader() method:
    Say, for instance, you were trying to parse a web service that required an authorization header.  Assume that the documentation for the method you are ineterested in looks something like this:
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <AuthenticationHeader xmlns="http://www.some_namespace.com/">
          <UserName>string</UserName>
          <Password>string</Password>
        </AuthenticationHeader>
      </soap:Header>
      <soap:Body>
        <HelloWorld xmlns="http://www.some_namespace.com/">
          <Foo>string</Foo>
        </HelloWorld>
      </soap:Body>
    </soap:Envelope>
    You can consume this web service by doing the following:
    1) Build the AuthenticationHeader XML string:
    <cfsavecontent variable="sAuthHeaderXML">
       <AuthenticationHeader xmlns=http://www.some_namespace.com/>
            <UserName>my_username</UserName>
            <Password>my_password</Password>
          </AuthenticationHeader>
      </cfsavecontent>
    2) Parse the XML into a CF object:
    <cfset objAuthHeader = xmlParse(sAuthHeaderXML)>
    3) Instantiate your web service object:
       // Create web service object
       objWS = CreateObject("webservice", "http://www,some_namespace.com/wsTest.asmx?WSDL");
    4) Add your authentication object to your web service request header
       // Add authentication header to web service call
       addSOAPRequestHeader(objWS, "http://www,some_namespace.com", "AuthenticationHeader", objAuthHeader);
    5) Call your remote web service method:
    sResponse = objWS.HelloWorld("test");
    Be sure to use the correct namespace when generating web service content (especially when dealing with web services built in .NET)
    Anyway, it sounds like you've already come up with a good solution for this.  I just thought I would add this into the thread in case someone else comes across it later on.

  • Web Services and Parameters - Problem

    I have 2 web services I set up. One takes no parameters and
    works fine. The
    other takes arguments and it tells me the method cannot be
    found. What am I
    missing? What is the magic bullet to invoke a web service
    that takes
    arguments and have it work? I have all the web service's
    arguments set to
    'required="yes"' and I set up another 'no argument function'
    in the
    SearchProperty.cfc to make sure it also works and it did
    fine, so I know the
    web service exists and is accessible.
    I tried both createObject in my contoller and cfinvoke. Both
    work fine for
    the web service that takes no arguments and neither work for
    the one that
    does.
    Here is my controller blocks (please excuse the Model-Glue)
    This works fine
    <!---Get All Cities For Search Engine--->
    <cffunction name="getCities" access="public"
    returntype="void"
    output="false" hint="I displays all the cities for the front
    page">
    <cfargument name="event" type="ModelGlue.Core.Event"
    required="yes">
    <cfset Cities = createObject("webservice",
    http://74.86.90.210/realitorToolBox/model/webservices/CityGateway.cfc?wsdl")/>
    <cfset allCities = Cities.getCities() />
    <cfset arguments.event.setValue("getAllCities",
    allCities)/>
    </cffunction>
    This cannot be found:
    <!---Search Residentual Properties--->
    <cffunction name="SearchProperties" access="public"
    returntype="void"
    output="false" hint="I displays all the cities for the front
    page">
    <cfargument name="event" type="ModelGlue.Core.Event"
    required="yes">
    <cfset userID = 555555>
    <cfset bedrooms =
    arguments.event.getValue("bedrooms")/>
    <cfset bathrooms =
    arguments.event.getValue("bathrooms")/>
    <cfset footage = arguments.event.getValue("footage")/>
    <cfset minprice =
    arguments.event.getValue("minprice")/>
    <cfset maxprice =
    arguments.event.getValue("maxprice")/>
    <cfset basement =
    arguments.event.getValue("basement")/>
    <cfset garage = arguments.event.getValue("garage")/>
    <cfset CITIES = arguments.event.getValue("CITIES")/>
    <cfset Search = createObject("webservice",
    http://74.86.90.210/realitorToolBox/model/webservices/SearchProperty.cfc?wsdl")/>
    <cfset searchAll = Search.SearchProperty(#userID#,
    #bedrooms#,
    #bathrooms#, #footage#, #minprice#, #maxprice#, #basement#,
    #garage#,
    #CITIES#) />
    <cfset arguments.event.setValue("Results",
    searchAll)/>
    </cffunction>
    Any ideas? My client is getting anxious and I hope to offer
    this service to
    other developers to use for their client's site.

    Ok, I will make this simplier. Couple questions.
    Is it possible to use cfargument in a web service?
    I looked at the samples out there and they all just have
    queries that take a
    form variable (#form.name#) since it was being passed by a
    form.
    Is it possible to have one web service function invoke
    another function in
    the same cfc?
    If you have one function that calls another to first validate
    the user and
    then invoke another to get the search results, do all have to
    be remote or
    can you have the search be private since you dont want it
    invoked remotely.
    I.E.
    <cffunction name="search" access="remote"
    returntype="query">
    <cfset authenticate = authenticateUser(#username#)>
    <cfif authenticate EQ 'yes'>
    <cfset myResults = searchProperty(#mlsnumber#)>
    </cfif>
    <cfreturn my Results>
    </cffunction>
    I tried a simple city search and tried to pass a variable
    argument.
    <cfinvoke
    webservice="
    http://74.86.90.210/realitorToolBox/model/webservices/CityGateway.cfc?wsdl"
    method="findCity" city = "clinton" returnvariable="aQuery"/>to:
    <cffunction name="findCity" access="remote"
    returntype="query"> <cfquery name="getCities"
    datasource="MLSListings"> Select city FROM residential WHERE
    city = '#city#' </cfquery> <cfreturn getCities>
    </cffunction>And I still get a function cannot be found, even
    though I used the cfcexplorer to verify that it does exist on the
    remote server.Any ideas?

  • Consuming webservices using CF8

    I recently upgraded to CF8 and I’m not able to consume webservices from my dev edition on my personal PC.
    I have tried making my own simple test webservice, but I’m not able to consume them using CF. (I’m able to consume the ws using .Net or Java, but not from CF itself).
    I always get the following error:
    org.apache.axis.ConfigurationException: org.xml.sax.SAXException: Fatal Error: URI=null Line=40: The string "--" is not permitted within comments.
    This is the code I’m using:
    <cfscript>
    wsargs = structnew();
    wsargs.proxyServer = "proxy";
    wsargs.proxyPort = "8080";
    ws = createObject("webservice","http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl",wsargs);
    </cfscript>
    I know that the WSDL is ok since the WS works in .Net and Java. I also know that I can retrieve the wsdl using
    <cfhttp method="get" url="http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl" result="myRes" proxyserver="proxy" proxyport="8080"/>
    So why do I get the “The string "--" is not permitted within comments.” error?
    I know that
    I get the same error for all ws I try to consume from CF, even simple test ws made using CF.
    The ws work, because I can consume them using .Net and Java.
    CFINVOKE gives me the same error
    Thanks,
    Olav, Oslo, Norway

    Have you tried the other methods of connecting to a webservice?
    For instance by tag
    <cfinvoke
                  webservice="http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl"
                  method="post"
                  returnvariable="httpResponse">
                    <cfinvokeargument name="parameters" value="<xmlToSend>"/>
    </cfinvoke>
    Or by building up the CFHTTP call directly
    <cfhttp
                url="http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl"
                method="post"
                result="httpResponse">
                <cfhttpparam
                     type="header"
                     name="accept-encoding"
                    value="no-compression"
                 />
                <cfhttpparam
                type="header"
                name="SOAPAction"
                value="http://ws.fraudlabs.com/zipcodeworldUS_webservice"
                />
                 <!---
                        When posting the SOAP body, use the CFHTTPParam type of
                        XML. This does two things: it posts the XML as a the BODY
                        and sets the mime-type to be XML.
                        NOTE: Be sure to Trim() your XML since XML data cannot be
                        parsed with leading whitespace.
                    --->
                <cfhttpparam
                    type="xml"
                    value="#trim( orderXML )#"
                    />
            </cfhttp>
    I found fiddling around with all three methods of creating a webservice usually results in one that works
    Regards
    Joanne

  • Using WebService served by SAP

    Greetings,
    I have been stuck trying to get CF 8 to talk to SAP serviced Web
    Service. Here is code I am using:
    <cfscript>
       ws = CreateObject("webservice", "http://xxx.xxxxx.com:8002/sap/bc/
    srt/rfc/sap/Z_ZRFC_TEST?sap-client=235&wsdl=1.1");
       xlatstring = ws.ZZrfcTest(Rfcin = "Hello");
    </cfscript>
    Here is WSDL file
    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions targetNamespace="urn:sap-
    com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://
    schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/
    XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://
    schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-
    com:document:sap:soap:functions:mc-style" xmlns:n1="urn:sap-
    com:document:sap:rfc:functions">
    - <wsdl:documentation>
    <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" />
    </wsdl:documentation>
    - <wsdl:types>
    - <xsd:schema attributeFormDefault="qualified"
    targetNamespace="urn:sap-com:document:sap:rfc:functions">
    - <xsd:simpleType name="char10">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="10" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    - <xsd:schema attributeFormDefault="qualified"
    targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style"
    xmlns:n0="urn:sap-com:document:sap:rfc:functions">
    <xsd:import namespace="urn:sap-com:document:sap:rfc:functions" />
    - <xsd:element name="ZZrfcTest">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element name="Rfcin" type="n0:char10" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="ZZrfcTestResponse">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element name="Rfcout" type="n0:char10" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </wsdl:types>
    - <wsdl:message name="ZZrfcTest">
    <wsdl:part name="parameters" element="tns:ZZrfcTest" />
    </wsdl:message>
    - <wsdl:message name="ZZrfcTestResponse">
    <wsdl:part name="parameter" element="tns:ZZrfcTestResponse" />
    </wsdl:message>
    - <wsdl:portType name="Z_ZRFC_TEST">
    - <wsdl:operation name="ZZrfcTest">
    <wsdl:input message="tns:ZZrfcTest" />
    <wsdl:output message="tns:ZZrfcTestResponse" />
    </wsdl:operation>
    </wsdl:portType>
    </wsdl:definitions>
    here is error message I am getting
    The web site you are accessing has experienced an unexpected error.
    Please contact the website administrator.
    Unable to read WSDL from URL:
    http://xxxx.xxxxxxx.com:8002/sap/bc/srt/rfc/sap/Z_ZRFC_TEST?sap-client=235&wsdl=1.1
    Please advice what to check...
    Regards,
    Egils

    I am still strugling even with parsed XML attribute however I am not ready investigating WSDL2Java yet...
    Here is how parameters are described in WSDL
    - <xsd:element name="BAPI_PO_GETDETAIL1">
         <xsd:complexType>
    -           <xsd:sequence>
               <xsd:element name="ACCOUNT_ASSIGNMENT" minOccurs="0" type="tns:char1" />
               <xsd:element name="DELIVERY_ADDRESS" minOccurs="0" type="tns:char1" />
               <xsd:element name="HEADER_TEXT" minOccurs="0" type="tns:char1" />
               <xsd:element name="ITEM_TEXT" minOccurs="0" type="tns:char1" />
               <xsd:element name="PURCHASEORDER" type="tns:char10" />
               <xsd:element name="SERVICES" minOccurs="0" type="tns:char1" />
                    <xsd:element name="VERSION" minOccurs="0" type="tns:char1" />
              </xsd:sequence>
         </xsd:complexType>
    </xsd:element>
    Here is how char1 is described
    - <xsd:simpleType name="char1">
        -<xsd:restriction base="xsd:string">
               <xsd:maxLength value="1" />
         </xsd:restriction>
    </xsd:simpleType>
    Here is how Char10 is defined
    <xsd:simpleType name="char10">
        -<xsd:restriction base="xsd:string">
               <xsd:maxLength value="10" />
         </xsd:restriction>
    </xsd:simpleType>
    This is one of the versions of the code I tried
    <cfsavecontent variable="sXML">
        <BAPI_PO_GETDETAIL1>
          <ACCOUNT_ASSIGNMENT/>
          <DELIVERY_ADDRESS/>
          <HEADER_TEXT/>
          <ITEM_TEXT/>
          <PURCHASEORDER>4500000059</PURCHASEORDER>
          <SERVICES/>
          <VERSION/>
        </BAPI_PO_GETDETAIL1>
    /cfsavecontent>
    <cfset xmlObj = XMLParse(sXML)>
    <cfdump var="#sXML#">
    <cfinvoke
          webservice="http://xxxx.xxxxxxxx.com:8006/sap/bc/srt/rfc/sap/Z_PO_GETDETAIL1?sap-client=330&wsdl=1.1"
          method="BAPI_PO_GETDETAIL1"
          refreshWSDL="yes"
          username="web_service"
          password="Seneca09"
         <!--- argumentcollection="#xmlObj#" --->
          returnvariable="aReturn"
    >
          <cfinvokeargument name="BAPI_PO_GETDETAIL1" value="#xmlObj#">
    </cfinvoke>
    Any ideas what I am doing wrong? Any suggestiong or tips?

  • CFinvoke returned error...anyone know why?

    I am trying to connect to SAP using cfinvoke and I get the error msg below. Anyone know what is the error in my code or setting?
    Cannot locate an API in the generated service class that returned the right interface for web service invocation.
    Name: http://xxx.xx.com.my:8000/sap/bc/srt/rfc/sap/z_voucher_upload/400/z_voucher_upload?sap-cli ent=400&wsdl=1.1. WSDL: http://xxx.xx.com.my:8000/sap/bc/srt/rfc/sap/z_voucher_upload/400/z_voucher_upload?sap-cli ent=400&wsdl=1.1. It is recommended that you use a web browser to retrieve and examine the requested WSDL document for correctness, including a missing service element.
    below is my code : -
    <cfinvoke
      webservice="http://xxx.xx.com.my:8000/sap/bc/srt/rfc/sap/z_voucher_upload/400/z_voucher_upload?sap-cli ent=400&wsdl=1.1"
      method="Z_VOUCHER_UPLOAD"
      refreshWSDL="yes"
      returnvariable="aString"
      username = "xxxx"
      password = "xxxxx"
      Lifnr = "30086"
      Sort1 = "A106"
      Bldat = "23082010"
      Budat = "23082010"
      Bktxt = "T03"
      Xblnr = "T04"
      Dmbtr = "55.55"
      Kostl = "8033"
      Hkont = "1234567"
      Zuonr = "45333"
      Xref3 = "CHASSIS99999"
      Xref2 = "ABC1234"
      Xref1 = "850412122121">
    </cfinvoke>
    <cfoutput>
    #aString#
    </cfoutput>

    below is the WSDL file : - I still facing the same problem without knowing the reason. Thanks for helping.
    <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:n1="urn:sap-com:document:sap:rfc:functions">
    - <wsdl:documentation>
    <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" />
    </wsdl:documentation>
    <wsp:UsingPolicy wsdl:required="true" />
    - <wsp:Policy wsu:Id="IF_Z_VOUCHER_UPLOAD">
    - <sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/">
    <sapsession:enableSession>false</sapsession:enableSession>
    </sapsession:Session>
    </wsp:Policy>
    - <wsp:Policy wsu:Id="OP_ZVoucherUpload">
    <sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking>
    <sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit>
    <saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required>
    <saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM>
    </wsp:Policy>
    - <wsdl:types>
    - <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions">
    - <xsd:simpleType name="char1">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="1" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char10">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="10" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char12">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="12" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char16">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="16" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char18">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="18" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char20">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="20" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char220">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="220" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char25">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="25" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char30">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="30" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char32">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="32" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="char50">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="50" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="curr13.2">
    - <xsd:restriction base="xsd:decimal">
    <xsd:totalDigits value="13" />
    <xsd:fractionDigits value="2" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="date">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="10" />
    <xsd:pattern value="\d\d\d\d-\d\d-\d\d" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="numeric3">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="3" />
    <xsd:pattern value="\d*" />
    </xsd:restriction>
    </xsd:simpleType>
    - <xsd:simpleType name="numeric6">
    - <xsd:restriction base="xsd:string">
    <xsd:maxLength value="6" />
    <xsd:pattern value="\d*" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    - <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:n0="urn:sap-com:document:sap:rfc:functions">
    <xsd:import namespace="urn:sap-com:document:sap:rfc:functions" />
    - <xsd:complexType name="Zvoucher">
    - <xsd:sequence>
    <xsd:element name="Lifnr" type="n0:char10" />
    <xsd:element name="Sort1" type="n0:char20" />
    <xsd:element name="Bldat" type="n0:date" />
    <xsd:element name="Budat" type="n0:date" />
    <xsd:element name="Bktxt" type="n0:char25" />
    <xsd:element name="Xblnr" type="n0:char16" />
    <xsd:element name="Dmbtr" type="n0:curr13.2" />
    <xsd:element name="Kostl" type="n0:char10" />
    <xsd:element name="Hkont" type="n0:char10" />
    <xsd:element name="Zuonr" type="n0:char18" />
    <xsd:element name="Xref3" type="n0:char20" />
    <xsd:element name="Xref2" type="n0:char12" />
    <xsd:element name="Xref1" type="n0:char12" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:complexType name="Bapiret2">
    - <xsd:sequence>
    <xsd:element name="Type" type="n0:char1" />
    <xsd:element name="Id" type="n0:char20" />
    <xsd:element name="Number" type="n0:numeric3" />
    <xsd:element name="Message" type="n0:char220" />
    <xsd:element name="LogNo" type="n0:char20" />
    <xsd:element name="LogMsgNo" type="n0:numeric6" />
    <xsd:element name="MessageV1" type="n0:char50" />
    <xsd:element name="MessageV2" type="n0:char50" />
    <xsd:element name="MessageV3" type="n0:char50" />
    <xsd:element name="MessageV4" type="n0:char50" />
    <xsd:element name="Parameter" type="n0:char32" />
    <xsd:element name="Row" type="xsd:int" />
    <xsd:element name="Field" type="n0:char30" />
    <xsd:element name="System" type="n0:char10" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:complexType name="TableOfZvoucher">
    - <xsd:sequence>
    <xsd:element name="item" type="tns:Zvoucher" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:complexType name="TableOfBapiret2">
    - <xsd:sequence>
    <xsd:element name="item" type="tns:Bapiret2" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    - <xsd:element name="ZVoucherUpload">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element name="Msg" type="tns:TableOfBapiret2" />
    <xsd:element name="Zvoucher" type="tns:TableOfZvoucher" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    - <xsd:element name="ZVoucherUploadResponse">
    - <xsd:complexType>
    - <xsd:sequence>
    <xsd:element name="Msg" type="tns:TableOfBapiret2" />
    <xsd:element name="Zvoucher" type="tns:TableOfZvoucher" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    </wsdl:types>
    - <wsdl:message name="ZVoucherUpload">
    <wsdl:part name="parameters" element="tns:ZVoucherUpload" />
    </wsdl:message>
    - <wsdl:message name="ZVoucherUploadResponse">
    <wsdl:part name="parameter" element="tns:ZVoucherUploadResponse" />
    </wsdl:message>
    - <wsdl:portType name="Z_VOUCHER_UPLOAD">
    - <wsp:Policy>
    <wsp:PolicyReference URI="#IF_Z_VOUCHER_UPLOAD" />
    </wsp:Policy>
    - <wsdl:operation name="ZVoucherUpload">
    - <wsp:Policy>
    <wsp:PolicyReference URI="#OP_ZVoucherUpload" />
    </wsp:Policy>
    <wsdl:input message="tns:ZVoucherUpload" />
    <wsdl:output message="tns:ZVoucherUploadResponse" />
    </wsdl:operation>
    </wsdl:portType>
    </wsdl:definitions>

  • Consuming a Webservice is extremly slow

    Hi
    I would like to use a Webservice to communicate with a
    server. For test purposes I wrote a small java webservice which
    adds to numbers using the following 2 classes.
    == Class Calculator ==
    package de.theserverside.webservice.service;
    import javax.jws.WebService;
    import javax.jws.soap.SOAPBinding;
    import javax.jws.soap.SOAPBinding.Style;
    @WebService
    @SOAPBinding(style=Style.RPC)
    public class Calculator
    public long addValues(int val1, int val2) {
    return val1 + val2;
    == Class CalculatorServer ==
    package de.theserverside.webservice.service;
    import javax.xml.ws.Endpoint;
    import de.theserverside.webservice.service.Calculator;
    public class CalculatorServer {
    public static void main (String args[]) {
    Calculator server = new Calculator();
    Endpoint endpoint =Endpoint.publish("
    http://<IP Adresse>/calculator?wsdl",
    server);
    In Coldfusion I tested both methods to consume this
    Webservice:
    <cfinvoke webservice="
    http://<IP Adresse>/calculator?wsdl"
    method="addValues" returnvariable="aString">
    <cfinvokeargument name="arg0" value="1"/>
    <cfinvokeargument name="arg1" value="6"/>
    </cfinvoke>
    <cfoutput>#aString#</cfoutput>
    == mit cfskript ==
    <cfscript>
    ws = createObject("webservice","
    http://<IP
    Adresse>/calculator?wsdl");
    xlatstring = ws.addValues(2,9);
    </cfscript>
    <cfoutput>#xlatstring#</cfoutput>
    The Webservice works with both methods but it takes between 5
    and 6 Minutes to get a result.
    I also wrote a java client to test the webservice which
    returned the result within 1 second.
    Whats the problem here with CF?
    I am using CF 8

    I found a third way to call a webservice using chttp. But now
    I have the problem that I cant pass paramaters to my method.
    I wrote a simple hello world method without any paramater and
    it worked within 1 sec.
    When I try to use the addValues method I get this Error:
    ns2:Serverjava.lang.IllegalArgumentException
    here is the CF Code
    <cfsavecontent variable="soap">
    <soapenv:Envelope xmlns:soapenv="
    http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:ser="
    http://service.webservice.theserverside.de/">
    <soapenv:Header/>
    <soapenv:Body>
    <ser:addValues>
    <arg0>6</arg0>
    <arg1>34</arg1>
    </ser:addValues>
    </soapenv:Body>
    </soapenv:Envelope>
    </cfsavecontent>
    <cfhttp url="
    http://<IP>/calculator?wsdl"
    method="post">
    <cfhttpparam type="header" name="content-type"
    value="text/xml">
    <cfhttpparam type="header" name="SOAPAction" value="">
    <cfhttpparam type="header" name="content-length"
    value="#len(soap)#">
    <cfhttpparam type="header" name="charset"
    value="utf-8">
    <cfhttpparam type="xml" name="message"
    value="#trim(soap)#">
    </cfhttp>
    <!--- Dump out a nice representation of the SOAP response
    --->
    <cfoutput>#cfhttp.FileContent#</cfoutput>
    <cfdump var="#xmlParse(cfhttp.FileContent)#">

  • 401 Unauthorized error when calling a webservice

    Have ColdFusion 11 installed, I have created a hello web service and I am trying to call it.  Each time I try to call the web service I get an error 401 Unauthorized.  I am not sure if I need to configure something more on the ColdFusion server, IIS or something else.
    <cfcomponent displayname="Hello">
    <cffunction name="helloWorld" returntype="string" access="remote">
         <cfreturn "Hello World!">
        </cffunction>
    </cfcomponent>
    <cfinvoke
      webservice="http://MyServer/Hello.cfc?wsdl"
      method="helloWorld"
      returnvariable="ws" refreshwsdl="yes">
    </cfinvoke>
    <cfdump var="#ws#">

    It appears that you have inadvertently enforced HTTP authentication. If so, you will have to include the attributes, username="your_username" and password="your_password" in the cfinvoke tag.

  • How  to get soap request in webservices (WSDL in java)

    hi ,,
    i did one helloworld app using soap protocol. In that , one soap client invokes the webservices(old java class with WSDL ).Now i want to get the soap document in the web service for to process the soap envelope and parsing and generating the o/p and append to the response then create the soap document for response. plz let me know how to do?
    Thanks in advance.

    Let me see whether I understand. Are you attempting to achieve something like this:
    test.cfc
    <cfcomponent output="no">
    <cffunction name="testFunction" returntype="any" access="remote">
    <cfargument name="soapInput">
    <cfset var inputXML = arguments.soapInput>
    <cfset var soapBodyText="">
    <cfset var noBodyTextError="">
    <cftry>
        <cfset soapBodyText = xmlSearch(inputXML,"//soapenv:Body/text()")[1].xmlValue>
        <cfsavecontent variable="noBodyTextError"><?xml version="1.0" encoding="utf-8"?><soapenv:Envelope     xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>java.lang.Exception: Body not found.</faultstring></cfsavecontent>
        <cfif trim(soapBodyText) is "">
        <cfthrow>
        </cfif>
        <cfreturn inputXML>
    <cfcatch type="any">
    <cfreturn noBodyTextError>
    </cfcatch>
    </cftry>
    </cffunction>
    </cfcomponent>
    tester.cfm
    <cfxml variable="mydata">
            <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wor="https://www.worldmilesafrica.com">
       <soapenv:Header/>
       <soapenv:Body>
       </soapenv:Body>
    </soapenv:Envelope>
    </cfxml>
    <cfinvoke webservice = "http://127.0.0.1:8500/workspace/wsTest/test.cfc?wsdl"
              method = "testFunction"
               returnVariable = "result">
           <cfinvokeargument name="soapInput" value="#trim(mydata)#" >
    </cfinvoke>
    <cfdump var="#result#">

Maybe you are looking for