- see footer for list info -<
Stephen, thanks for the reply.
That thread looked messy, so I found a pure java implementation and ported it to cfscript:


function new(classname){
           return createobject("java",arguments.classname);
       }
mf = new("javax.xml.soap.MessageFactory").newInstance(); smsg = mf.createMessage();
       sp = smsg.getSOAPPart();
       se = sp.getEnvelope();
       body = se.getBody();
//Add a namespace declaration to the envelope se.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance";); bodyName = se.createName("checkVat", "nsg", "http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl";);
       bodyElement = body.addBodyElement(bodyName);
childName = se.createName("vatNumber");
       stateNm = bodyElement.addChildElement(childName);
       stateNm.addTextNode("1234");
childName = se.createName("countryCode");
       stateNm = bodyElement.addChildElement(childName);
       stateNm.addTextNode("GB");
//Save the message
       smsg.saveChanges();
conn = new("javax.xml.soap.SOAPConnectionFactory").newInstance().createConnection(); response = conn.call(smsg, "http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl";); tFact = new("javax.xml.transform.TransformerFactory").newInstance();
       transformer = tFact.newTransformer();
       src = response.getSOAPPart().getContent();
result = new("javax.xml.transform.stream.StreamResult").init(getPageContext().getOut());
       transformer.transform(src, result);


Hey Macrobe! Would that have been so hard?



Jim wrote:
- see footer for list info -<
Hi All,

I am trying to use this webservice:

http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl

After a quick glance at the wsdl, I thought this would do it:

<cfinvoke webservice="http://ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl";
             method="checkVat"
             returnvariable="wsresult"
             timeout="20">
                         <cfinvokeargument name="countryCode" value="GB">
       <cfinvokeargument name="vatNumber" value="12345">
                  </cfinvoke>

No joy, the parameters arent right, so I tried passing a struct of the values, still no joy.

Can anyone help with reading the webservice and determining what parameters it wants?

BTW, I can only get this far using my CF 7 install, my CF 6.1 install doesnt even want to generate a stub object for the wsdl.

Thanks,
Jim
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<



_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
- Hosting provided by www.cfmxhosting.co.uk -<
- Forum provided by www.fusetalk.com -<
- DHTML Menus provided by www.APYCOM.com -<
- Lists hosted by www.Gradwell.com -<
- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to