How to use outbound SOAP? I have URL pulling wsdl data . I want to use those data in my custom application.

syedfarhan
Kilo Sage

How to use outbound SOAP? I have URL pulling   wsdl data . I want to use those data in   my custom application and   How we can pass and save those data...

can anybody guide me. Should I have a script include to store and pass those parameters. Help me

7 REPLIES 7

Brad Tilton
ServiceNow Employee
ServiceNow Employee

When you create your soap message function in ServiceNow there should be be a related link called Preview script usage that will show you how to use it in a servicenow script. If it's something you're going to be calling from multiple places it might be better to go in a script include.



Outbound SOAP Web Service - ServiceNow Wiki


Scripting Outbound SOAP - ServiceNow Wiki  


HI Brad Tilton Thanks . But i tired creating script include and passed the value but I'm not getting the value . can you check my code.



These are my log messages:


test<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Sender</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to read request. ---&gt; System.InvalidOperationException: There is an error in XML document (5, 48). ---&gt; System.InvalidOperationException: Instance validation error: '1' is not a valid value for Currency.


at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read1_Currency(String s)


at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2_ConversionRate()


at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader)


at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)


--- End of inner exception stack trace ---


at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)


at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()


--- End of inner exception stack trace ---


at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()


at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>


In the log I see a coded response, need to get passed that first:


Instance validation error: '1' is not a valid value for Currency.



Is one of the parameters you are passing 'Currency'? and if so, check the WSDL schema or documentation to find out what they are expecting that string to contain.


From Currency and TO Currency are my two parameters , How do i pass those two parameters in script include?