As you have SoapUI, I'd say you're in good shape.

Use TCPMonitor to compare your cfhttp request, with the one sent from within
SoapUI.

TCPMonitor:
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_19352

Cheers

On Thu, Mar 19, 2009 at 6:42 PM, Darren Tracey <[email protected]> wrote:

>
> Thanks for that so far.
> We're getting closer, but still not there yet.
>
> We can generate a request that works using SOAPUI. Here is the raw
> request from it.
>
> POST http://vbnejdfwls4001:16400/easyimage/services/EasyImageService
> HTTP/0.9<http://vbnejdfwls4001:16400/easyimage/services/EasyImageService%0AHTTP/0.9>
> SOAPAction: "urn:suncorp-com-au:service:easyimage:2007:05:storeImage"
> Content-Type: multipart/related; type="text/xml";
> start="<[email protected]>"; boundary="----
> =_Part_38_196453.1237444713062"
> MIME-Version: 1.0
> Authorization: Basic Q3VzdG9tZXJUZXN0LVN0b3JlcjplYXN5aW1hZ2Uy
> User-Agent: Jakarta Commons-HttpClient/3.1
> Host: vbnejdfwls4001:16400
> Content-Length: 2901
>
>
> ------=_Part_38_196453.1237444713062
> Content-Type: text/xml; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Content-ID: <[email protected]>
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
> envelope/ <http://schemas.xmlsoap.org/soap/%0Aenvelope/>"
> xmlns:urn="urn:suncorp-com-au:service:easyimage:2007:05">
>   <soapenv:Header/>
>   <soapenv:Body>
>      <urn:StoreImageRequest>
>         <urn:logicalRepository>CustomerTest</urn:logicalRepository>
>         <urn:image>
>
>            <urn:imageData>cid:691309939620</urn:imageData>
>
>         </urn:image>
>      </urn:StoreImageRequest>
>   </soapenv:Body>
> </soapenv:Envelope>
> ------=_Part_38_196453.1237444713062
> Content-Type: image/jpeg
> Content-Transfer-Encoding: binary
> Content-ID: <691309939620>
>
> ÿØÿà
> ------=_Part_38_196453.1237444713062--
>
> The question is still, how do we get CF8 to do the same.
>
> When we use the code you supplied below, with a header cfhttpparam we
> get:
> File Content:
> Error Detail:
> Status Code: 500 Internal Server Error
> Mime Type:text/xml
>
> When I remove the cfhttpparam header we get:
> File Content:
>
>
>
> Error 500--Internal Server Error
> From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
> 10.5.1 500 Internal Server Error
> The server encountered an unexpected condition which prevented it from
> fulfilling the request.
>
> Error Detail:
> Status Code: 500 Internal Server Error
> Mime Type:text/html
>
> I have an interface contract document that I can supply to you off
> list if you'd like.
>
> Regards, and thank you so much for this help.
>
> Darren Tracey
>
>
> On Mar 18, 11:09 pm, MrBuzzy <[email protected]> wrote:
> > I'm back, feeling just a teeny bit more learned :)
> > If you are indeed using 'soap with attachments' [ref:
> http://www.w3.org/TR/SOAP-attachments] then you need to create a 'soap
> > message package'.
> >
> > A soap message package is a mime multi-part request that encapsulates the
> > soap xml and one ore more 'attachments'.
> >
> > Getting to cfhttp... unfortunately the http request content type has to
> be
> > "Multipart/Related", so you can't use cfhttp mutipart="true".
> >
> > It may work like this;
> >
> > <cfhttp url="http://localhost:8300/receiver.cfm";
> > method="post" resolveurl="no" redirect="yes" charset="utf-8">
> >
> >     <cfhttpparam type="header" name="Content-type"
> value='Multipart/Related;
> > boundary=MIME_boundary; type=text/xml; start="<
> http://mrbuzzy.org/example.xml>"' />
> >
> >     <cfhttpparam type="body" value="#myBody#" />
> >
> > </cfhttp>
> >
> > Note the 'body' of the request is binary (yeah, it seems cfhttp will
> allow
> > it).
> >
> > It's going to be tricky to create the muti-part body (but maybe not
> > impossible), like dis...
> >
> > <cfsavecontent variable="myText">
> > --MIME_boundary
> > Content-Type: text/xml; charset=UTF-8
> > Content-Transfer-Encoding: 8bit
> > Content-ID: <http://mrbuzzy.org/example.xml>
> >
> > <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
> > envelope/">
> >   <SOAP-ENV:Header/>
> >   <SOAP-ENV:Body>
> >      <StoreImageRequest xmlns:urn="urn:company-com-
> > au:service:easyimage:2007:05">
> >         <logicalRepository>CustomerTest</logicalRepository>
> >         <image>
> >            <urn:imageData>cid:827370646852</urn:imageData>
> >            <imageData>Bluehills.jpg</imageData>
> >         </image>
> >      </StoreImageRequest>
> >   </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > --MIME_boundary
> > Content-Type: image/jpeg
> > Content-Transfer-Encoding: binary
> > Content-ID: <http://mrbuzzy.org/Bluehills.jpg>
> >
> > </cfsavecontent>
> >
> > <cffile action="write" file="#expandpath('/myTemp.dat')#" output="">
> > <cffile action="readbinary" file="#expandpath('/Bluehills.jpg')#"
> > variable="myImage">
> > <cffile action="append" file="#expandpath('/myTemp.dat')#"
> > output="#myText#">
> > <cffile action="append" file="#expandpath('/myTemp.dat')#"
> > output="#myImage#">
> > <cffile action="append" file="#expandpath('/myTemp.dat')#"
> > output="--MIME_boundary--">
> > <cffile action="readbinary" file="#expandpath('/myTemp.dat')#"
> > variable="myBody">
> >
> > This is completely untested. I couldn't find a web service to try it on
> and
> > it would be a pain to debug the body format. But it might work too ;)
> >
> > Cheers.
> >
> >
> >
> > On Wed, Mar 18, 2009 at 6:58 PM, MrBuzzy <[email protected]> wrote:
> > > Hi Darren,
> >
> > > Soap with attachments has been on my 'to get my head around' list for
> > > a while. I've done similar things but not that exactly.
> >
> > > I assume you have tried cfinvoke and it didn't work, which is why
> > > you're using cfhttp?
> >
> > > Can you look at the wsdl to work out what type of data is expected by
> > > the service? Perhaps you can post a snippet.
> >
> > > (I can't recall if soap attachments expects the binary data encoded to
> > > a string, or if you can post the file 'raw' like you're doing)
> >
> > > If noone else provides the answer, I'm happy to try it out myself for
> fun.
> >
> > > Cheers.
> >
> > > On 18/03/2009, Darren Tracey <[email protected]> wrote:
> >
> > > > We need to call an existing software service here from our CF8 and
> > > > Flex app, and we need to access it (to submit a file for storage) via
> > > > "SOAP with Attachments".
> > > > We can't see how to do this from within CF and haven't had much luck
> > > > with Google.
> > > > If you try to mix the request content types in the SOAP call, you get
> > > > a CF error.
> >
> > > > Here's the code:
> >
> > >
> ---------------------------------------------------------------------------­--
> > > > <cfxml variable="theXML">
> > > >  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/
> > > > envelope/">
> > > >    <SOAP-ENV:Header/>
> > > >    <SOAP-ENV:Body>
> > > >       <StoreImageRequest xmlns:urn="urn:company-com-
> > > > au:service:easyimage:2007:05">
> > > >          <logicalRepository>CustomerTest</logicalRepository>
> > > >          <image>
> > > >             <!--- <urn:imageData>cid:827370646852</urn:imageData>
> --->
> >
> > > > <imageData>Bluehills.jpg</imageData>
> > > >          </image>
> > > >       </StoreImageRequest>
> > > >    </SOAP-ENV:Body>
> > > > </SOAP-ENV:Envelope>
> > > > </cfxml>
> >
> > > > <cfhttp url="http://servername:16400/easyimage/services/
> > > > EasyImageService" username="username" password="password"
> > > > method="post" resolveurl="no" redirect="yes" charset="utf-8"> --->
> > > >                 <cfhttpparam type="xml" value="#theXML#" />
> > > >     <cfhttpparam type="file" file="Bluehills.jpg"
> > > > name="Bluehills.jpg" />
> > > > </cfhttp>
> >
> > >
> ---------------------------------------------------------------------------­-----------------
> >
> > > > Here's the error:
> > > > You may not mix the use of cfhttpparam tags of type FILE or FORMFIELD
> > > > with cfhttpparam tags of type BODY or XML.
> >
> > > > The error occurred in E:\euc_smallapps\_test\cfml\Fred_SOAP1.cfm:
> line
> > > > 45
> > > > 43 : <!--- <cfhttpparam type="" type="header" name="SOAPAction" value
> > > > = "getProductInfoXML"> --->
> > > > 44 :    <cfhttpparam type="xml" value="#theXML#" />
> > > > 45 :     <cfhttpparam type="file" file="Bluehills.jpg"
> > > > name="Bluehills.jpg" />
> > > > 46 : </cfhttp>
> > > > 47 :
> >
> > > > Has anyone ever been able to get this to work?
> > > > Does anyone have any suggestions?
> >
> > > > Regards
> > > > Darren Tracey
> >
> > > --
> > > Sent from my mobile device- Hide quoted text -
> >
> > - Show quoted text -
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to