Soap how to encode a message as xml php nusoap
The length and type of attached data are defined in a few simple header fields.
DIME is designed to be a fast and efficient protocol to parse. Even attaching an XML document or fragment to a SOAP message can pose problems, especially if the documents do not use the same character encoding as the primary SOAP message.ĭIME allows you to send attachments of various types along with your SOAP message, even when the attachments in question do not fit conveniently or efficiently into an XML format. Including binary files in SOAP messages using standard base64 encoding can also be tricky when the binary files are digitally signed. Now you can begin to see how it's possible to run into some processor performance-related issues when you start sending really large binary files, such as JPEG image files or even digital sound and video files. Naturally, this requires an encoding or decoding step at each end of the process. The trick, of course, to sending binary data in a SOAP message is to use base64 encoding. Now that applications are able to communicate with each other in a platform-agnostic fashion using XML, the next question for application designers is how to use SOAP to send other important non-XML stuff, like binaries. But what happens if the attachments are very large or digitally signed? What if you want to send XML fragments within a SOAP message that has a different character encoding? These are just a few of the instances when a solution based on DIME can greatly simplify your life.Īs you know, SOAP provides a flexible and extensible way to send highly structured and typed XML data across the wire. You might encode the binary attachments as base64 XML and include them in the body of the SOAP message. With currently available Internet protocols, you could certainly rig such a service. For example, suppose that you are designing an XML Web Service that sends large media files to a requesting client.
Like SOAP, DIME messages are sent using standard transport protocols, such as HTTP and TCP. Along the way, I'll discuss why it was necessary to add another standard to the rapidly crowding world of Web Services specs, and review how DIME relates to other technologies like SOAP and Web Services Description Language (WSDL).ĭIME is based on a specification recently submitted to the Internet Engineering Task Force (IETF), which details a method for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages. This article will expand upon the current draft specifications for DIME in an attempt to demystify this technology and show you how DIME can be used. As you might have guessed from its name, DIME is similar to MIME for Web Services, but there are some key differences between the two specifications. If you've been keeping up on the latest innovations in the rapidly changing world of XML Web Services, you may have stumbled across a new specification called DIME (Direct Internet Message Encapsulation). A detailed description of the message format and how it is parsed, as well as working with SOAP and extending it with WSDL, is also included. In this article, the author explains what DIME is and how it differs from MIME encapsulation. This article assumes you're familiar with SOAP, XML, and WSDLĭirect Internet Message Encapsulation (DIME) is a new specification for sending and receiving SOAP messages along with additional attachments, like binary files, XML fragments, and even other SOAP messages, using standard transport protocols like HTTP. Sending Files, Attachments, and SOAP Messages Via Direct Internet Message Encapsulation