Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating my first soap request
    text
    copied!<p>I'm fairly new to web services/api calls</p> <p>I've been given a wsdl for development.</p> <p><a href="http://bogus.com/SM/7/ServiceCatalogAPI.wsdl" rel="nofollow">http://bogus.com/SM/7/ServiceCatalogAPI.wsdl</a></p> <p>I've added a service reference to the wsdl using Visual Studio 2010 c# .net 4.0</p> <p>I've been given a username/password (basic authentication)</p> <p>I'm looking for guidance on how to do the request. Am I on the right path?</p> <p>I have the following, but I'm receiving 'Cannot implicitly convert type 'string' to 'SM9.ServiceReference1.StringType' </p> <pre><code>protected void Button1_Click(object sender, EventArgs e) { try { ServiceReference1.CreateCartRequest createCart = new ServiceReference1.CreateCartRequest(); string result = createCart.model.instance.BriefDescription = "Testing SM9"; Label1.Text = result.ToString(); } catch (System.Exception ex) { Label1.Text = ex.Message; } } </code></pre> <p><strong>SOAP Request</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;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" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:ns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common"&gt; &lt;soap:Body&gt; &lt;ns:CreateCartRequest&gt; &lt;ns:model&gt; &lt;ns:keys/&gt; &lt;ns:instance&gt; &lt;ns:BriefDescription type=""&gt;Brief Description&lt;/ns:BriefDescription&gt; &lt;ns:Description type=""&gt; &lt;ns:Description type=""&gt;description 1&lt;/ns:Description&gt; &lt;ns:Description type=""&gt;description 2&lt;/ns:Description&gt; &lt;/ns:Description&gt; &lt;/ns:instance&gt; &lt;/ns:model&gt; &lt;/ns:CreateCartRequest&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p><strong>SOAP Response</strong></p> <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;SOAP-ENV:Body&gt; &lt;CreateCartResponse message="Success" returnCode="0" schemaRevisionDate="2012-09-12" schemaRevisionLevel="0" status="SUCCESS" xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.hp.com/SM/7 http://SE104636.devfg.RBC.com:12700/SM/7/Cart.xsd"&gt; &lt;model&gt; &lt;keys&gt; &lt;CartID type="Decimal"&gt;11&lt;/CartID&gt; &lt;/keys&gt; &lt;instance recordid="11" uniquequery="cartId=11"&gt; &lt;CartID type="Decimal"&gt;11&lt;/CartID&gt; &lt;Completed type="Boolean"&gt;false&lt;/Completed&gt; &lt;BriefDescription type="String"&gt;Brief Description&lt;/BriefDescription&gt; &lt;Owner type="String"&gt;SOAP USER&lt;/Owner&gt; &lt;Description type="Array"&gt; &lt;Description type="String"&gt;description 1&lt;/Description&gt; &lt;Description type="String"&gt;description 2&lt;/Description&gt; &lt;/Description&gt; &lt;Cost type="Decimal"&gt;0&lt;/Cost&gt; &lt;/instance&gt; &lt;/model&gt; &lt;messages&gt; &lt;cmn:message&gt;svcCart record added.&lt;/cmn:message&gt; &lt;/messages&gt; &lt;/CreateCartResponse&gt; &lt;/SOAP-ENV:Body&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload