vbscript posting SOAP

Posted on 2011-10-12
Last Modified: 2012-05-12
Hello -

I am posting using WSH 5.6 on a W2k3 server to an outside server hosting a WCF web service.


Posting to:

Code snipped from WSH vbscript:

strXMLString = "<?xml version=""1.0"" encoding=""UTF-8""?><SOAP-ENV:Envelope xmlns:xsi="""" xmlns:soapenc="""" xmlns:xsd="""" xmlns:soap="""" xmlns:tns="""" xmlns:wsaw="""" xmlns:wsam="""" xmlns:wsa="""" xmlns:msc="""" xmlns:wsap="""" xmlns:wsp="""" xmlns:wsu="""" xmlns:soap12="""" xmlns:wsx="""" xmlns:wsa10="""" xmlns:wsdl="""" xmlns:SOAP-ENV=""""><SOAP-ENV:Body><tns:PostLead xmlns:tns=""""><tns:req><tns:BorrowerFirstName>Testy</tns:BorrowerFirstName><tns:BorrowerLastName>Tester</tns:BorrowerLastName><tns:BranchName>Aliso Viejo</tns:BranchName><tns:BusinessPhone></tns:BusinessPhone><tns:CellPhone>8184802340</tns:CellPhone><tns:CreditRanking>Excellent</tns:CreditRanking><tns:Email></tns:Email><tns:HomePhone>8659820680</tns:HomePhone><tns:LoanAmount>315000</tns:LoanAmount><tns:LoanOfficerFirstName></tns:LoanOfficerFirstName><tns:LoanOfficerLastName></tns:LoanOfficerLastName><tns:LoanProgram>30 Year Fixed Rate</tns:LoanProgram><tns:OccupancyType>PrimaryResidence</tns:OccupancyType><tns:PreferredContactMethod>Email</tns:PreferredContactMethod><tns:PropertyValue>375000</tns:PropertyValue><tns:Property_City>Maryville</tns:Property_City><tns:Property_State>TN</tns:Property_State><tns:Property_Street>42 Timbercreek Dr.</tns:Property_Street><tns:Property_Zip>37803</tns:Property_Zip><tns:PurposeOfLoan>Refinance_Cashout</tns:PurposeOfLoan><tns:RequestHeader><tns:SecurityToken>" & strSecurityToken & "</tns:SecurityToken></tns:RequestHeader></tns:req></tns:PostLead></SOAP-ENV:Body></SOAP-ENV:Envelope>"

Set oXMLhttpObject = CreateObject("MSXML2.ServerXMLHTTP.6.0")
with oXMLhttpObject
      .setOption 2, 13056
      .Open "POST",strHTTP_TRANSACTION_URL,false
      .setRequestHeader "Content-type", "application/soap+xml; charset=utf-8" ';charset=utf-8
      .setRequestHeader "Content-Length", Len(strXMLString)
      .setRequestHeader "SecurityToken",strSecurityToken
end with
' Send XML
oXMLhttpObject.send strXMLString

Here's the puzzler:

Response Status: 500

Response Text :
<s:Envelope xmlns:s="" xmlns:a="">
<a:Action s:mustUnderstand="1"></a:Action>
<s:Text xml:lang="en-US">The message with To '' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver's EndpointAddresses agree.</s:Text>

Any ideas?  I've got an email chain 45 messages long with the people who set up the service, they are saying it's a certificate issue.  I don't see that at all.  HELP.

Question by:enjama

    Author Comment

    Just got them to send me their endpoint mapping from their web.config

    <endpoint address="" binding="wsHttpBinding" contract="FocusIT.Pulse.IPulseLeadService" bindingConfiguration="TransportSecurity">

    Shouldn't there be something where the address goes?
    LVL 6

    Accepted Solution

    This WCF service requires a WS-Addressing SOAP header and the error you get is because this header is missing (header required according to the policy documented in the service WSDL).

    Try sending the following SOAP message (with a valid security token) and attach the exact response you get from the service.

    <SOAP-ENV:Envelope xmlns:xsi="" xmlns:soapenc="" xmlns:xsd="" xmlns:soap="" xmlns:tns="" xmlns:wsaw="" xmlns:wsam="" xmlns:wsa="" xmlns:msc="" xmlns:wsap="" xmlns:wsp="" xmlns:wsu="" xmlns:soap12="" xmlns:wsx="" xmlns:wsa10="" xmlns:wsdl="" xmlns:SOAP-ENV="" xmlns:foc="">
    		<wsa10:Action SOAP-ENV:mustUnderstand="1"></wsa10:Action>
    		<ActivityId CorrelationId="f389a13a-5932-43e1-988d-c49666cddb44" xmlns="">2e2fe96c-9837-44be-8c88-03d3f1fc815c</ActivityId>
    		<wsa10:To SOAP-ENV:mustUnderstand="1"></wsa10:To>
    				<foc:BranchName>Aliso Viejo</foc:BranchName>
    				<foc:LoanProgram>30 Year Fixed Rate</foc:LoanProgram>
    				<foc:Property_Street>42 Timbercreek Dr.</foc:Property_Street>

    Open in new window

    You may consider asking the people who provide the service for a .NET WCF client code that access the service correctly. It will be helpful to look at the code and the app.config file in order to sort out any additional issues. Trace log of the SOAP request and response will be helpful as well.

    Author Closing Comment

    I had messed around with the WS-Addressing SOAP header earlier, and hadn't gotten it into proper syntax - Thank you for your guidance!  This wraps up a month of head banging for me.  I REALLY REALLY appreciate your solution!!!!

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
    Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  ( Here (http…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now