Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm trying to call a web service in an Excel Macro:

Set objHTTP = New MSXML.XMLHTTPRequest
objHTTP.Open "post", "https://www.server.com/EIDEServer/EIDEService.asmx"
objHTTP.setRequestHeader "Content-Type", "text/xml"
objHTTP.setRequestHeader "SOAPAction", "PutSchedule"
objHTTP.send strXML      

And I get back the following response:

  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
      <soap:Fault>
        <faultcode>soap:Client</faultcode>
        <faultstring>Server did not recognize the value of HTTP Header SOAPAction: PutSchedule.</faultstring>
        <detail />
      </soap:Fault>
    </soap:Body>
  </soap:Envelope> 

Anybody out there done something like this before?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
973 views
Welcome To Ask or Share your Answers For Others

1 Answer

You SOAP action should also include namespace of the method e.g.

"http://tempri.org/PutSchedule"

Find out what the namespace of your Service and add it in front of the method name PutSchedule.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...