• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1054
  • Last Modified:

vbscript posting SOAP

Hello -

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

WSDL: https://api-ameri007.pulsedashboard.net/PulseLeadService.svc?wsdl

Posting to: https://api-ameri007.pulsedashboard.net/PulseLeadService.svc

Code snipped from WSH vbscript:

strXMLString = "<?xml version=""1.0"" encoding=""UTF-8""?><SOAP-ENV:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:soapenc=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/wsdl/soap/"" xmlns:tns=""http://tempuri.org/"" xmlns:wsaw=""http://www.w3.org/2006/05/addressing/wsdl"" xmlns:wsam=""http://www.w3.org/2007/05/addressing/metadata"" xmlns:wsa=""http://schemas.xmlsoap.org/ws/2004/08/addressing"" xmlns:msc=""http://schemas.microsoft.com/ws/2005/12/wsdl/contract"" xmlns:wsap=""http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"" xmlns:wsp=""http://schemas.xmlsoap.org/ws/2004/09/policy"" xmlns:wsu=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"" xmlns:soap12=""http://schemas.xmlsoap.org/wsdl/soap12/"" xmlns:wsx=""http://schemas.xmlsoap.org/ws/2004/09/mex"" xmlns:wsa10=""http://www.w3.org/2005/08/addressing"" xmlns:wsdl=""http://schemas.xmlsoap.org/wsdl/"" xmlns:SOAP-ENV=""http://www.w3.org/2003/05/soap-envelope""><SOAP-ENV:Body><tns:PostLead xmlns:tns=""https://tempuri.org/""><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>testing@yahoo.com</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="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value>a:DestinationUnreachable</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<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>
</s:Reason>
</s:Fault>
</s:Body>
</s:Envelope>

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.


0
enjama
Asked:
enjama
  • 2
1 Solution
 
enjamaAuthor Commented:
Just got them to send me their endpoint mapping from their web.config

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

Shouldn't there be something where the address goes?
0
 
regevhaCommented:
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="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://tempuri.org/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:foc="http://schemas.datacontract.org/2004/07/FocusIT.Pulse">
	<SOAP-ENV:Header>
		<wsa10:Action SOAP-ENV:mustUnderstand="1">http://tempuri.org/IPulseLeadService/PostLead</wsa10:Action>
		<wsa10:MessageID>urn:uuid:0386dfc4-2271-49e1-8e08-7323dc4f8a15</wsa10:MessageID>
		<ActivityId CorrelationId="f389a13a-5932-43e1-988d-c49666cddb44" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">2e2fe96c-9837-44be-8c88-03d3f1fc815c</ActivityId>
		<wsa10:ReplyTo>
			<wsa10:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa10:Address>
		</wsa10:ReplyTo>
		<wsa10:To SOAP-ENV:mustUnderstand="1">https://api-ameri007.pulsedashboard.net/PulseLeadService.svc</wsa10:To>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body>
		<tns:PostLead>
			<tns:req>
				<foc:BorrowerFirstName>Testy</foc:BorrowerFirstName>
				<foc:BorrowerLastName>Tester</foc:BorrowerLastName>
				<foc:BranchName>Aliso Viejo</foc:BranchName>
				<foc:BusinessPhone/>
				<foc:CellPhone>8184802340</foc:CellPhone>
				<foc:CreditRanking>Excellent</foc:CreditRanking>
				<foc:Email>testing@yahoo.com</foc:Email>
				<foc:HomePhone>8659820680</foc:HomePhone>
				<foc:LoanAmount>315000</foc:LoanAmount>
				<foc:LoanOfficerFirstName/>
				<foc:LoanOfficerLastName/>
				<foc:LoanProgram>30 Year Fixed Rate</foc:LoanProgram>
				<foc:OccupancyType>PrimaryResidence</foc:OccupancyType>
				<foc:PreferredContactMethod>Email</foc:PreferredContactMethod>
				<foc:PropertyValue>375000</foc:PropertyValue>
				<foc:Property_City>Maryville</foc:Property_City>
				<foc:Property_State>TN</foc:Property_State>
				<foc:Property_Street>42 Timbercreek Dr.</foc:Property_Street>
				<foc:Property_Zip>37803</foc:Property_Zip>
				<foc:PurposeOfLoan>Refinance_Cashout</foc:PurposeOfLoan>
				<foc:RequestHeader>
					<foc:SecurityToken>*strSecurityToken*</foc:SecurityToken>
				</foc:RequestHeader>
			</tns:req>
		</tns:PostLead>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

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.
0
 
enjamaAuthor Commented:
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!!!!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now