I've only had to consume 1 .net webservice (eu vat validation)
I can't remember the exact problem, but I do know that CF wouldnt do it
using the standard createobject("webservice"

Here's my code (slightly modified to protect the guilty) which does work,
maybe you can extract a few clues out of it...


<cfscript>

var call = structnew();
var response = 0;

try{

    call.mf = 
createobject("java","javax.xml.soap.MessageFactory").newInstance();

       call.smsg = call.mf.createMessage();
       call.sp = call.smsg.getSOAPPart();
       call.se = call.sp.getEnvelope();
       call.body = call.se.getBody();

       //Add a namespace declaration to the envelope
       call.se.addNamespaceDeclaration("xsi", "
http://www.w3.org/2001/XMLSchema-instance";);

    //method and wsdl
    call.bodyName = call.se.createName("checkVat", "nsg", arguments.vatWSDL
);
       call.bodyElement = call.body.addBodyElement(call.bodyName);

    //arguments
       call.childName = call.se.createName("vatNumber");
       call.stateNm = call.bodyElement.addChildElement(call.childName);
       call.stateNm.addTextNode(arguments.vatNumber);

    call.childName2 = call.se.createName("countryCode");
       call.stateNm2 = call.bodyElement.addChildElement(call.childName2);
       call.stateNm2.addTextNode(trim(arguments.ISOAlpha2));

       //Save the message
       call.smsg.saveChanges();

       call.conn = createobject("java","javax.xml.soap.SOAPConnectionFactory
").newInstance().createConnection();

    //get the
       call.response = call.conn.call(call.smsg, arguments.vatWSDL);

    call.responseXML = xmlparse(call.response.getSOAPPart().getAsString());

    response = call.responseXML
['soapenv:Envelope']['soapenv:Body']['checkVatResponse']['valid']['xmltext'];

    if(comparenocase(trim(response),"true") eq 0){
        response = 1;
    }else{
        response = 0;
    }

}catch (Any Err){
    response = 0;
}

</cfscript>



> -----Original Message-----
> From: Tom Chiverton [mailto:[EMAIL PROTECTED]
> Sent: 18 January 2007 13:09
> To: CF-Talk
> Subject: Re: Calling a .NET web service
>
> On Thursday 18 January 2007 12:45, Robertson-Ravo, Neil (RX) wrote:
> > CreateObject (or cfinvoke) the WS and call that method it states it
> isn't
> > found?!
>
> Are there arguments to the method ? Do the types match ?
>
> -


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:266882
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to