vb.net - Posting MIME encoded attachment to Ariba Supplier Network "Premature end of file" -
my problem response after posting string ariba network. had @ similiar question, don't found answer:
codesnippet:
' check -> no request send if chkcheckonly.checked = false dim bytearray byte() = encoding.utf8.getbytes(strrequestfile) dim request webrequest = webrequest.create(txtaspserver.text) dim intlength integer = bytearray.length request .timeout = val(strtimeout) .method = "post" .contenttype = "multipart/related;boundary=" & strboundary & ";type=""text/xml"";start=""<part1.pc@ganter-interior.com""" .credentials = credentialcache.defaultcredentials .contentlength = bytearray.length end ' create stream data dim datastream system.io.stream datastream = request.getrequeststream() datastream.write(bytearray, 0, bytearray.length) datastream.close() dim response webresponse = request.getresponse ' stream containing content returned server datastream = response.getresponsestream() ' open stream using streamreader dim reader new streamreader(datastream) ' read content. dim responsefromserver string = reader.readtoend() ' display content. console.writeline(responsefromserver) txtresponse = responsefromserver txtresponsebox.text = responsefromserver ' clean streams. reader.close() datastream.close() response.close() end if
strrequestfile content:
--8d407adf5972fa0 content-type: text/xml; charset=utf-8 content-id:<part1.pc@ganter-interior.com> <?xml version="1.0" encoding="utf-8"?> <!doctype cxml system "http://xml.cxml.org/schemas/cxml/1.2.023/cxml.dtd"> <cxml payloadid="1478164614672-129894812347729669@216.109.111.68" timestamp="2016-11-08t08:05:19"> <header> <from> <credential domain="networkid"> <identity>an01047299320-t</identity> </credential> </from> <to> <credential domain="networkid"> <identity>an01007225001-t</identity> </credential> </to> <sender> <credential domain="networkid"> <identity>an01047299320-t</identity> <sharedsecret>#gan_ariba_2016</sharedsecret> </credential> <useragent>gansap-ariba</useragent> </sender> </header> <request> <cataloguploadrequest operation="new"> <catalogname xml:lang="en">europe_burberry_ganter_ssp</catalogname> <description xml:lang="en">this can long text further description of catalog.</description> <attachment> <url>cid: europe_burberry_ganter_ssp.cif</url> </attachment> <commodities> <commoditycode>52</commoditycode> </commodities> <autopublish enabled="false" /> <notification> <email>schneider@ganter-interior.com</email> </notification> </cataloguploadrequest> </request> </cxml> --8d407adf5972fa0 content-type: text/plain; charset=utf-8 content-disposition: attachment; filename=europe_burberry_ganter_ssp.cif content-id:<europe_burberry_ganter_ssp.cif> content-length: 777 cif_i_v3.0 charset: loadmode: f codeformat: unspsc currency: eur supplierid_domain: an01047299320-t itemcount: 1 timestamp:2016-11-08 unuom: true comments:this can long text further description of catalog. fieldnames: supplier id,supplier part id,manufacturer part id,item description,spsc code,unit price,unit of measure,lead time,manufacturer name,supplier url,manufacturer url,market price,supplier part auxiliary id,language,currency,short name,image ,thumbnail ,effective date,expiration date,ispartial data an01047299320,ho00gl5c0106,,"glasses, set of 6",spsc code,8.00,sat,,,,,0.00,,en_gb,eur,"glasses, set of 6",http:\\ganter-interior.com\ariba images\catalogs\burberry-europe-ssp\ho00gl5c0106.jpg,,0000-00-00,0000-00-00,false endofdata --8d407adf5972fa0--
the error response get:
<cxml timestamp="2016-11-08t02:27:01-08:00" payloadid="1478600821812-5460675132676933267@216.109.111.19"> <response> <status code="406" text="not acceptable">the document not parsed: premature end of file. (line -1, column -1) [ancls-128435011]</status> </response> </cxml>
i hope, can me?
best regards ralf
Comments
Post a Comment