- Sub test()
-
Dim myHTTP As MSXML2.xmlhttp
-
Dim myDom As MSXML2.DOMDocument
-
Dim orderno, errormsg, lineerr, lineerrmsg As MSXML2.IXMLDOMNode
-
Dim myxml As String
-
-
boundary = "-----------------------------29772313742745"
-
-
-
myxml = "--" & boundary & vbCrLf & _
-
"<?xml version=""1.0"" encoding=""UTF-8""?>" & _
-
"<OnlineCheck>" & _
-
"<Header>" & _
-
"<BuyerAccountId></BuyerAccountId>" & _
-
"<AuthCode></AuthCode>" & _
-
"<Type>Full</Type>" & _
-
"</Header>" & _
-
"<Item line=""1"">" & _
-
"<ManufacturerItemIdentifier/>" & _
-
"<DistributorItemIdentifier>1088963</DistributorItemIdentifier>" & _
-
"<Quantity>1</Quantity>" & _
-
"</Item>" & _
-
"</OnlineCheck>" & vbCrLf & vbCrLf & boundary & "--"
-
-
Set myHTTP = CreateObject("msxml2.xmlhttp")
-
Set myDom = CreateObject("MSXML2.DOMDocument")
-
myDom.async = False
-
myDom.Load (myxml)
-
myHTTP.Open "POST", "", False
-
myHTTP.setRequestHeader "Content-Type", "multipart/form-data; boundary=" & boundary
-
myHTTP.setRequestHeader "Content-Disposition", "form-data; name=""xmlmsg"""
-
myHTTP.setRequestHeader "Content-Length", Len(myxml)
-
-
myHTTP.send (myDom.xml)
-
-
MsgBox myHTTP.responseText
-
-
End Sub
Can anyone spot anything obviously wrong with this code?
M'kay.
I have to send the xml (myxml) to a website via POST.
It has to be multipart/form-data, and has to have a name of 'xmlmsg'.
Don't ask me why, it's the way they've set it up.
I have the exact same code working for another of our suppliers; with the one difference being the setRequestHeade r lines. None of our other suppliers require these; which leads me to think that's the problem.
When I ommit all the headers, I get a message saying basically 'wrong format, form name must be xmlmsg'. When I add the content-type header, this changes to <error>-3</error>.
I know, helpful right?
The company doesn't know what the error means, and haven't got an error code list. I don't know what's happened to whoever set the system up for them.
We use Access2003 and I'd prefer not to have to make a webpage to do this.
Thanks for any help/guidance you can give =)
Mandi
3 2349
I've tried the code without the boundarys in 'myxml'.
I've tried it with the headers declared in the posted data rather than using setRequestHeade rs.
I've tried everything I can think of and I swear I'm just going backwards.
I think I just need to set the name to xmlmsg, but I can't figure out how.
I know in html it would be <form name="xmlmsg"> but in vba....
I've tried -
SetRequestHeader="Content-Disposition", "form-data: name=""xmlmsg"""
-
SetRequestHeader="Content-Disposition", "name=""xmlmsg"""
-
SetRequestHeader="Content-Disposition", "name='xmlmsg'"
-
SetRequestHeader="Content-Disposition", "name=xmlmsg"
-
SetRequestHeader="ContentDisposition", "name=""xmlmsg"""
-
SetRequestHeader="name", "xmlmsg"
(Not all at once though, obviously)
Nothing seems to work.
Does anyone know how to set that?
Thanks
Mandi
I suspect you are trying the wrong property here; I think CONTENT-TYPE would be more appropriate,
-Stewart
Thanks for the reply.
I'm using content type too; and I know that one works as when I don't use it I get an error about using the wrong type. When I do use it, I just get -3.
Because I didn't get a reply in over a week, I started a similar thread in the HTML forums in case they knew anything more. But to be quite honest, I'm not sure who I should be asking about this.
I'm getting frustrated by this so I think I'll let it lie for a while and do something else. Knowing my luck it'll end up being something really obvious that I've over looked because I've been overthinking it.
Mandi
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Andy Jacobs |
last post by:
Hi All
I've tried as many combinations as I can think of but I'm not getting any
where. This is what I have:
<?
$menu = 'menus/' . $HTTP_GET_VARS . '.inc';
echo $menu;
?>
|
by: DD |
last post by:
Hello,
Could anyone please help me??
Is there somebody who could explain me how to make a connection to a access
database with a python cgi script.
I would like to use common sql commands in my python scripts as I can with
MySQLdb.
But I cannot even connect to the access database (see below).
Could anyone explain it to me as simple as possible please. I'm using
Windows XP, ActivePython 2.3.2 build 230 and Microsoft access(XP?)
|
by: Darren |
last post by:
I'm trying to bound a custom object to a combobox using DataSource
property. The code works correctly however when the user selects a
different value I get a runtime error of NullReferenceException -
Object reference not set to an instance of an object. I've posted a
snippet of the code below: I think it maybe something to do with
CopyTo or SyncRoot as I don't understand what these are. Any please
will be appreciated.
Thanks,
Darren.
|
by: Aaron Fude |
last post by:
I have this
<img src="a.jpg" onClick=this.src="b.jpg\"">
and it works. But I like obeying rules so I change it to
<img src="a.jpg" onClick="this.src=\"b.jpg\"">
and it no longer works.
|
by: kirill_uk |
last post by:
Help with extracting please folks.!
Hi. I have this:
a variable like: <a href="http://www.some_html.com/text.html" >some
text</a><br>
I heed to extract the "http://www.some_html.com/text.html " and put
it in var "link"
And extract "some text" and put it var "text",.
So basically extract all between <a href=" and " >
| |
by: Jai |
last post by:
Hi,
Somebody please tell me how to bind(two way) a checkboxlist with
objectdatasource if the checkboxlist is inside a formview.....
Code of FormView is like this::---
<asp:FormView ID="FormView1" runat="server"
DataSourceID="ObjectDataSource1">
<EditItemTemplate>
|
by: sandyw |
last post by:
I need help in two areas:
Both are at the bottom of my program where a client has two choice to make,
1. When the client enter "Y" it takes him to the begin of the program. I would like to know what this is done ie maybe at the part where it ask you do you want to enter a new product.
2. If the client enters the wrong value or then "Y" or "N" then they are prompted with "error - Please try again" for some reason my no matter what I enter I...
|
by: =?Utf-8?B?RW1tYSBIb3Bl?= |
last post by:
Hi All,
I have VB & SQL 2005 Express but i'm afraid i am a newbie, my background is
in MS Access so please if you can give me any advice, please take my
inexperience into consideration.
I have two tables, i won't detail all the fields but just those that are
relevant.
Table 1
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |