473,395 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sending multi-part MIME package via HTTP-POST

This has got me somewhat stumped, so I'll throw it up here in hopes
that someone has ran into this before. I'm trying to send a MIME
package to Esko Backstage. I'm a bit confused as to how to send this
to the server in a manner that it'll be able to get and de-code the
MIME package in a valid way.

The big question is does this entire mime package belong in the
headers section of an HTTP request? If not, what is the best Pythonic
way to send this thing. I'm using 2.5's email package to create the
package and was trying to use its as_string() method to pump this
through httplib, but I'm getting a very vague server error message
that seems to indicate a malformed package. Here is the broken code:

hcon = httplib.HTTPConnection(JMF_GATEWAY)
hcon.putrequest('POST', JMF_GATEWAY_PATH)
hcon.endheaders()
hcon.send(msg.as_string())

I've pasted the string representation of the MIME package I'm trying
to send below. Any ideas would be greatly appreciated.

Content-Type: multipart/related;
boundary="===============1845688244=="
MIME-Version: 1.0
start: cid:beginning

--===============1845688244==
Content-Type: application/vnd.cip4-jmf+xml
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-ID: beginning

<?xml version="1.0" ?><JMF SenderID="QMon" Version="1.2"><Command
ID="Link1290_5" Type="SubmitQueueEntry"><QueueSubmissionParams
Hold="false" Priority="50" URL="cid:aJDF_1"/></Command></JMF>
--===============1845688244==
Content-Type: application/vnd.cip4-jdf+xml
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-ID: aJDF_1

<?xml version="1.0" ?>
<JDF DescriptiveName="StepRepeatTab and RIP" ID="n0001"
Status="Waiting" Type="ProcessGroup" Version="1.2" xmlns="http://
www.CIP4.org/JDFSchema_1_1" xmlns:eg="http://www.esko-graphics.com/
EGschema1_0">
<ResourcePool>
<RunList Class="Parameter" DescriptiveName="1-up"
ID="SourceFileList" PartIDKeys="Run" Status="Available">
<RunList Run="Run0001">
<LayoutElement>
<FileSpec URL="/archive/49297
PEPPINOS/49297-1 DMT-20.pdf"/>
</LayoutElement>
</RunList>
</RunList>
</ResourcePool>
<JDF DescriptiveName="RIP1up" ID="n0003" Status="Waiting"
Type="eg:BackStageTask" Version="1.2" xmlns="http://www.CIP4.org/
JDFSchema_1_1" xmlns:eg="http://www.esko-graphics.com/EGschema1_0">
<NodeInfo JobPriority="50"/>
<ResourcePool>
<eg:BackStageTaskParams Class="Parameter"
ID="TaskParamLink" Status="Available" eg:Hold="false" eg:TicketName="/
fripfile_s.file_sModel1.grx/XXXPROOFTICKETXXX"/>
</ResourcePool>
<ResourceLinkPool>
<eg:BackStageTaskParamsLink Usage="Input"
rRef="TaskParamLink"/>
<RunListLink Usage="Input"
rRef="SourceFileList"/>
<RunListLink Usage="Output" rRef="TIFFList"/>
</ResourceLinkPool>
</JDF>
</JDF>

--===============1845688244==--

Oct 13 '08 #1
6 3297
In message
<62**********************************@m3g2000hsc.g ooglegroups.com>,
sq***********@gmail.com wrote:
... but I'm getting a very vague server error message ...
Which is?

Oct 15 '08 #2
Lawrence D'Oliveiro wrote:
In message
<62**********************************@m3g2000hsc.g ooglegroups.com>,
sq***********@gmail.com wrote:
>... but I'm getting a very vague server error message ...

Which is?
very vague ...
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Oct 15 '08 #3
On Oct 15, 2:42*am, Lawrence D'Oliveiro <l...@geek-
central.gen.new_zealandwrote:
In message
<62b84106-6f26-4e40-a9bf-95a193b6a...@m3g2000hsc.googlegroups.com>,

squishywaf...@gmail.com wrote:
... but I'm getting a very vague server error message ...

Which is?
In this case it's not really something that will be readily recognized
here, nor is it extremely helpful diagnostic-wise. This is the only
debug output I can get from the logs or stdout:

"Failed to parse content as JDF."
Oct 15 '08 #4
In message
<0d**********************************@q9g2000hsb.g ooglegroups.com>,
sq***********@gmail.com wrote:
On Oct 15, 2:42Â*am, Lawrence D'Oliveiro <l...@geek-
central.gen.new_zealandwrote:
>In message
<62b84106-6f26-4e40-a9bf-95a193b6a...@m3g2000hsc.googlegroups.com>,

squishywaf...@gmail.com wrote:
... but I'm getting a very vague server error message ...

Which is?

In this case it's not really something that will be readily recognized
here, nor is it extremely helpful diagnostic-wise. This is the only
debug output I can get from the logs or stdout:

"Failed to parse content as JDF."
I may not recognize it, but I can Google:
<http://www.cip4.org/overview/what_is_jdf.html>.

Does the server log contain any more information? If not, is it possible to
increase the log verbosity level in the server?
Oct 17 '08 #5
Sadly, there is no way to increase the log verbosity.

On Oct 17, 2:42*am, Lawrence D'Oliveiro <l...@geek-
central.gen.new_zealandwrote:
In message
<0dfd122f-6cc6-47c5-9a7d-5c43ab7f4...@q9g2000hsb.googlegroups.com>,

squishywaf...@gmail.com wrote:
On Oct 15, 2:42*am, Lawrence D'Oliveiro <l...@geek-
central.gen.new_zealandwrote:
In message
<62b84106-6f26-4e40-a9bf-95a193b6a...@m3g2000hsc.googlegroups.com>,
squishywaf...@gmail.com wrote:
... but I'm getting a very vague server error message ...
Which is?
In this case it's not really something that will be readily recognized
here, nor is it extremely helpful diagnostic-wise. This is the only
debug output I can get from the logs or stdout:
"Failed to parse content as JDF."

I may not recognize it, but I can Google:
<http://www.cip4.org/overview/what_is_jdf.html>.

Does the server log contain any more information? If not, is it possible to
increase the log verbosity level in the server?
Nov 4 '08 #6
have you tried using the

def request(self, method, url, body=None, headers={})

method instead of putrequest, endheaders, send methods?

where body is

--===============1845688244==
Content-Type: application/vnd.cip4-jmf+xml
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-ID: beginning
<?xml version="1.0" ?><JMF SenderID="QMon" Version="1.2"><Command
....
</JDF>
</JDF>
--===============1845688244==--

Nov 5 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Anthony Baxter | last post by:
On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.3.1 (final). Python 2.3.1 is a pure bug fix release of Python 2.3, released in...
1
by: Tim Black | last post by:
My application requires sending a large piece (~2MB) of data to several devices on a network via TCP sockets. I have experimented with different methods for doing this and this has raised some...
3
by: Jason | last post by:
Hi, I am working on a project to move my mailing tool to support Multi Languages including Chinese and Hebrew. To do this I have added the following code to the Message object...
2
by: Norman Fritag | last post by:
Hi there are there any issues with sending multiple emails via GroupWise ver. 6??? please comment. Regards Norman
2
by: Del | last post by:
I have two question on sending email messages from MS Access (Versio 2000, 2002, and 2003). I have a form with a command button to send an email message, the code behide the button is as follows;...
2
by: Geir Baardsen | last post by:
Hi! From a listbox I'd like to send only selected items to a report. Items will include: OrderNr,Date,EmployeeNr from tblOrders ZipCode,City from tblZipCodes Name,Adr,ZipID from...
9
by: Mike | last post by:
Hello, How do I send an array from a form to another php page?I want to bundle up some data from form fields in an array and send them together like that. I must be missing something? Thanks Mike
0
by: zig158 | last post by:
My application will use a multicast channel for contacting peers on the network running the application, like mDNS. I have some sample code that works great on my local machine, but have a question...
8
by: Frank Millman | last post by:
Hi all This is not strictly a Python question, but as the system to which relates is written in Python, hopefully it is not too off-topic. I have an accounting/business application, written in...
0
by: misra | last post by:
Hi, I am using a C# code to call blat and send mail. When I send mails with long sentences, the mail automatically is send with multiple lines. However, certain times the body and format of the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.