SOAP Message with attachment

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jdyken
Forum Newbie
Posts: 3
Joined: Fri Dec 18, 2009 11:53 am

SOAP Message with attachment

Post by jdyken »

Does anyone know how to add an attachment to a SOAP message? Also - does anyone know how to read an attachment from the SOAP server? Does PHP natively support attachments within it's SOAP implementation?

Running PHP 5.2.8

A million thank yous!
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: SOAP Message with attachment

Post by JNettles »

What do you mean by attachment? Like an email attachment, as in a file?
jdyken
Forum Newbie
Posts: 3
Joined: Fri Dec 18, 2009 11:53 am

Re: SOAP Message with attachment

Post by jdyken »

Yes. Like an email MIME attachment.

<?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-instan ... s1:process soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:TripFlow"><message href="cid:2F09F494BA05FE2F4ECACEFC94C47E30" xsi:type="ns1:DataHandler"/></ns1:process></soapenv:Body></soapenv:Envelope>

Where the message references the attachment.
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: SOAP Message with attachment

Post by JNettles »

What sort of file are you trying to transfer? I always just read the entire file, ship it over SOAP and then reassemble on the other side.
jdyken
Forum Newbie
Posts: 3
Joined: Fri Dec 18, 2009 11:53 am

Re: SOAP Message with attachment

Post by jdyken »

Turns out that PHP 5 does not natively support SOAP attachments.

We're trying out NuSOAP for PHP 5.
http://code.google.com/p/nusoap-for-php5/

I'm optimistic!
Post Reply