Consuming .Net Webservice with CFInvoke

Ask a Question related to Coldfusion Component Development, Design and Development.

  1. #1

    Default Consuming .Net Webservice with CFInvoke

    I am trying to consume a .Net Webservice and am having a problem. The
    webservice takes an array of string objects as a parameter, but when I try to
    pass an array into the service, I receive the following error:

    Could not perform web service invocation "getInfo" because
    java.lang.IllegalArgumentException: argument type mismatch
    Anyone have any idea how to pass an array of strings into a service?

    Code:

    <cfset accts = ArrayNew(1)>
    <cfset accts[1] = "1111111111111111">
    <cfset accts[2] = "2222222222222222">
    <cfset accts[3] = "3333333333333333">

    <cfinvoke
    webservice="http://localhost/WebService/Service1.asmx?WSDL"
    method="getInfo"
    returnvariable="aArrayOfAccts">
    <cfinvokeargument name="accts" value="#accts#"/>
    </cfinvoke>

    Rob_E_Mann Guest

  2. Similar Questions and Discussions

    1. Error Consuming Webservice
      We are attempting to consume a webservice that passes faxed documents back and forth. When we try to send or retrieve a ducment through the...
    2. Consuming MapPoint Webservice with MX 7
      Hi, I want to use Microsofts MapPoint Webservice, wich is username/password - Protected, with MX7. I tried with the following: <cfinvoke...
    3. Consuming webservice problem
      I have created the sample webservice HelloWorld when I try to instantiate it from either a console app or a windows forms app I get the following...
    4. Consuming Coldfusion Webservice
      I am trying to consume a coldfusion webservice that has been implemented as CFC. My calling program resides in Weblogic 8.1 (Java Program). I used...
    5. Consuming Controls from a Webservice
      Whatever you are returning from WebMethod shd be serializable. For that what you can do is store cotrol name & properties as XML DataSet and...
  3. #2

    Default Re: Consuming .Net Webservice with CFInvoke

    I have a work around for this. Had the same issue trying to pass an array of
    strings to .NET. Look for this in your cfmx directory
    org/tempuri/arrayOfStrings.class, I forgot how this is generated, or how I
    generated it, but if you can't find it I will email it to you.
    [email]byron@hostmysite.com[/email] Take that and put it in the cfmx class path somewhere.
    Then use this code snippet as an example. The java class I guess is a native
    array of strings and .NET likes this much better. ary = ArrayNew(1);
    ary[1] = '1111111'; ws = createObject ('webservice',
    'https://....//asmx?WSDL'); aofs = createObject ('java',
    'org.tempuri.ArrayOfString').init(); aofs.setString(ary); ret =
    ws.getInfo (accts=aofs);

    byron1021 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139