- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 05:01 AM
Hello All,
I have the static WSDL defined. Also I have the scripted webservice defined. Can some one give a example where some body developed integration using the scripted webservices and Static wsdl.
I created one but I am not sure I am doing it correctly.
I created a execute scripted web services. And in the static added more methods like insert, Update, Delete. But when I post a transaction the response is not received. Also I am doing a mistake.
Can some one reply back with an example..
Introduction to Static WSDLs in ServiceNow | John Andersen
I looked into this got few of the things.. But since I am trying this new I need you help to get this completed.
Please respond.
REgards
Param
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2017 06:33 AM
Thanks. I just managed to send the response in the Advanced Scripting of the Scripted web services section and I got the response.
Regards
Param
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 05:24 AM
John Anderson, Chuck.. Kindly reply back.
Attached is the static wsdl content on top of the main scripted webservice link.
<wsdl:definitions targetNamespace="http://www.service-now.com/ucmdbsnow" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.service-now.com/ucmdbsnow" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<wsdl:types>
<xsd:schema elementFormDefault="unqualified" targetNamespace="http://www.service-now.com/ucmdbsnow">
<xsd:element name="execute">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
<xsd:element name="executeResponse">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
<xsd:element name="get">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="sys_id" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="ipaddress" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="Name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>a
<xsd:element name="delete">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="sys_id" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="deleteResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="count" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="update">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="Name" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="ipaddress" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="updateResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="sys_id" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="insert">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="ipaddress" type="xsd:string"/>
<xsd:element maxOccurs="1" minOccurs="0" name="Name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="insertResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" name="sys_id" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="executeSoapIn">
<wsdl:part name="ucmdbsnow" element="tns:execute"/>
</wsdl:message>
<wsdl:message name="executeSoapOut">
<wsdl:part name="ucmdbsnow" element="tns:executeResponse"/>
</wsdl:message>
<wsdl:message name="deleteSoapIn">
<wsdl:part name="ucmdbsnowdelete" element="tns:delete"/>
</wsdl:message>
<wsdl:message name="deleteSoapOut">
<wsdl:part name="ucmdbsnowdelete" element="tns:deleteResponse"/>
</wsdl:message>
<wsdl:message name="getSoapOut">
<wsdl:part name="ucmdbsnowget" element="tns:getResponse"/>
</wsdl:message>
<wsdl:message name="getSoapIn">
<wsdl:part name="ucmdbsnowget" element="tns:get"/>
</wsdl:message>
<wsdl:message name="insertSoapOut">
<wsdl:part name="ucmdbsnowinsert" element="tns:insertResponse"/>
</wsdl:message>
<wsdl:message name="insertSoapIn">
<wsdl:part name="ucmdbsnowinsert" element="tns:insert"/>
</wsdl:message>
<wsdl:message name="updateSoapIn">
<wsdl:part name="ucmdbsnowupdate" element="tns:update"/>
</wsdl:message>
<wsdl:message name="updateSoapOut">
<wsdl:part name="ucmdbsnowupdate" element="tns:updateResponse"/>
</wsdl:message>
<wsdl:portType name="ServiceNowSoap">
<wsdl:operation name="execute">
<wsdl:input message="tns:executeSoapIn"/>
<wsdl:output message="tns:executeSoapOut"/>
</wsdl:operation>
<wsdl:operation name="delete">
<wsdl:input message="tns:deleteSoapIn"/>
<wsdl:output message="tns:deleteSoapOut"/>
</wsdl:operation>
<wsdl:operation name="get">
<wsdl:input message="tns:getSoapIn"/>
<wsdl:output message="tns:getSoapOut"/>
</wsdl:operation>
<wsdl:operation name="insert">
<wsdl:input message="tns:insertSoapIn"/>
<wsdl:output message="tns:insertSoapOut"/>
</wsdl:operation>
<wsdl:operation name="update">
<wsdl:input message="tns:updateSoapIn"/>
<wsdl:output message="tns:updateSoapOut"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceNowSoap" type="tns:ServiceNowSoap">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="execute">
<soap:operation soapAction="http://www.service-now.com/ucmdbsnow/execute" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="delete">
<soap:operation soapAction="http://www.service-now.com/ucmdbsnow/delete" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="get">
<soap:operation soapAction="http://www.service-now.com/ucmdbsnow/get" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="insert">
<soap:operation soapAction="http://www.service-now.com/ucmdbsnow/insert" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="update">
<soap:operation soapAction="http://www.service-now.com/ucmdbsnow/update" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ServiceNow_ucmdbsnow">
<wsdl:port name="ServiceNowSoap" binding="tns:ServiceNowSoap">
<soap:address location="https://dev13006.service-now.com/ucmdbsnow.do?SOAP"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I added many methods like get,getresponse,Insert,insertresponse, update, update response.
Also the main scripted webservice is a standard execute method. Kindly let me know in case you need more information.
Regards
param
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 05:47 AM
Param,
The problem may not have to do with your WSDL at all. Have you tried this in a tool such as SOAP-UI? Does the function execute on the server, but does the client just not receive the response? What kind client client are you using? SOAP-UI, .NET, Java code?
Once common problem is that by Default ServiceNow generates WSDLs with elementFormDefault being unqualified which will prevent code-based clients from receiving a response. I recommend trying the steps in this article to see if it helps your situation: Compatibility for clients generated from WSDL
Since this is a Static WSDL, however, you may have to either regnerate the WSDL from scratch, or edit it manually to get it in the right format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 07:07 AM
Thanks again for your response.
1. I am using the Soap UI to push a transaction.
2. Attached above was the static wsdl where the initial method was defined in the scripted soap web services. On top I added all the others like get,getresponse, insert,insertresponse,update,updateresponse and so on as needed.
3. The fake execute is just a straight forward one.
4. As per your example I did not add a script include but sure if it is needed in my requirement.
5. Finally when I post thru the soap UI. I don't see the below.
-no response
-and the record is not added.
Also I got a response of 200..
Also a note. When I try to create standalone scripted webservices and try to push a record it succeeds and I get a response back.
If you would like I can give you the user name password of my dev instance so that you can have a look. Thanks for your replies again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2017 07:10 AM