<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Error when using getProfileSoap</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=1374878" />
  <subtitle>Error when using getProfileSoap</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=1374878</id>
  <updated>2013-05-20T19:44:27Z</updated>
  <dc:date>2013-05-20T19:44:27Z</dc:date>
  <entry>
    <title>RE: Error when using getProfileSoap</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2187304" />
    <author>
      <name>Tim M</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2187304</id>
    <updated>2010-05-18T01:22:49Z</updated>
    <published>2010-05-18T01:22:49Z</published>
    <summary type="html">I thought I'd post a working C# version too(C#.net 3.5 on cisco7.0):
 

System.Net.HttpWebRequest req = (System.Net.HttpWebRequest)WebRequest.Create("https://&lt;yourip&gt;:8443/webdialer/services/WebdialerSoapService");
        req.ContentType = "text/xml;charset=\"utf-8\"";
        req.Accept = "text/xml";
        req.Method = "POST";
        req.Headers.Add ("SOAPAction: http://localhost:8373/");
        StreamWriter sw = new StreamWriter(req.GetRequestStream());
 
        System.Text.StringBuilder soapRequest = new System.Text.StringBuilder();
        soapRequest.Append("&lt;?xml version=\"1.0\" ?&gt;");
        soapRequest.Append("&lt;soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:tns=\"urn:WebdialerSoap\" xmlns:types=\"urn:WebdialerSoap/encodedTypes\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"&gt;");
        soapRequest.Append("&lt;soap:Header/&gt;&lt;soap:Body soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"&gt;");
        soapRequest.Append("&lt;tns:getProfileSoap&gt;");
        soapRequest.Append("&lt;cred href=\"#id1\" /&gt;");
        soapRequest.Append("&lt;userid xsi:type=\"xsd:string\"&gt;123&lt;/userid&gt;");
        soapRequest.Append("&lt;/tns:getProfileSoap&gt;&lt;tns:Credential id=\"id1\" xsi:type=\"tns:Credential\"&gt;");
        soapRequest.Append("&lt;userID xsi:type=\"xsd:string\"&gt;123&lt;/userID&gt;&lt;password xsi:type=\"xsd:string\"&gt;123&lt;/password&gt;");
        soapRequest.Append("&lt;/tns:Credential&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;");
 
        sw.Write(soapRequest.ToString());
 
        sw.Close();
        WebResponse resp = req.GetResponse();
        StreamReader sr = new StreamReader(resp.GetResponseStream());
        Response.ContentType = "text/xml";
        Response.Write(sr.ReadToEnd());</summary>
    <dc:creator>Tim M</dc:creator>
    <dc:date>2010-05-18T01:22:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Error when using getProfileSoap</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2010867" />
    <author>
      <name>Stephan Steiner</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=2010867</id>
    <updated>2010-03-03T15:40:00Z</updated>
    <published>2010-03-03T15:40:00Z</published>
    <summary type="html">And here's the WSDL side solution that requires no manual interaction: http://developer.cisco.com/web/webdialer/forums/-/message_boards/message/1777772</summary>
    <dc:creator>Stephan Steiner</dc:creator>
    <dc:date>2010-03-03T15:40:00Z</dc:date>
  </entry>
  <entry>
    <title>RE: Error when using getProfileSoap</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1643171" />
    <author>
      <name>Bryan Johnson</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1643171</id>
    <updated>2009-09-25T01:01:22Z</updated>
    <published>2009-09-25T01:01:22Z</published>
    <summary type="html">David, thanks for the direction.  If anyone needs the .NET solution for this, I wrote the following class to handle it:
 
 &lt;System.Diagnostics.DebuggerStepThroughAttribute(), _
 System.ComponentModel.DesignerCategoryAttribute("code"), _
 System.Web.Services.WebServiceBindingAttribute(Name:="WebDialerSoapBinding", _
                                        [Namespace]:="urn:WD70")&gt; _
Public Class WebDialerSoapService
    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol
    Public Sub New(ByVal Url As String)
        MyBase.New()
        Me.Url = Url
        Net.ServicePointManager.ServerCertificateValidationCallback = New Net.Security.RemoteCertificateValidationCallback(AddressOf CustomCertificateValidation)
    End Sub
    Public Function getProfileSoap(ByVal in0 As WebDialer71.Credential, ByVal in1 As String) As WebDialer71.GetConfigResponse
        Dim webc As New Net.WebClient
        Dim resp As String
        Dim oCfgResp As New WebDialer71.GetConfigResponse
        webc.BaseAddress = Me.Url
        webc.Headers.Add(Net.HttpRequestHeader.ContentType, "text/xml")
        webc.Headers.Add(Net.HttpRequestHeader.AcceptCharset, "utf-8")
        webc.Headers.Add(Net.HttpRequestHeader.Accept, "*/*")
        webc.Headers.Add(Net.HttpRequestHeader.UserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3082)")
        webc.Headers.Add("SOAPACTION", "")
        resp = webc.UploadString(Me.Url, getProfileSoap_BuildRequest(in0, in1))
        Dim XMLDoc As New Xml.XmlDocument
        XMLDoc.LoadXml(resp)
        'Description
        oCfgResp.description = XMLDoc.GetElementsByTagName("description")(0).InnerText
        'Response Code
        Dim RcHref As String = Replace(XMLDoc.GetElementsByTagName("responseCode")(0).Attributes("href").Value, "#", "")
        For Each xNode As Xml.XmlNode In XMLDoc.GetElementsByTagName("multiRef")
            If xNode.Attributes("id").Value = RcHref Then
                oCfgResp.responseCode = xNode.InnerText
            End If
        Next
        'Devices
        Dim oDeviceArray As New ArrayList
        For Each xNode As Xml.XmlNode In XMLDoc.GetElementsByTagName("deviceInfoList")(0).ChildNodes
            Dim DiHref As String = Replace(xNode.Attributes("href").Value, "#", "")
            For Each dNode As Xml.XmlNode In XMLDoc.GetElementsByTagName("multiRef")
                If dNode.Attributes("id").Value = DiHref Then
                    Dim dInfo As New WebDialer71.WDDeviceInfo
                    'Device Name
                    dInfo.deviceName = dNode.ChildNodes(0).InnerText
                    'Lines
                    Dim lNode As Xml.XmlNode = dNode.ChildNodes(1)
                    Dim sLineArray As String = ""
                    For Each item As Xml.XmlNode In lNode.ChildNodes
                        sLineArray &amp;= (item.InnerText) &amp; ","
                    Next
                    If Right(sLineArray, 1) = "," Then sLineArray = Mid(sLineArray, 1, Len(sLineArray) - 1)
                    dInfo.lines = sLineArray
                    oDeviceArray.Add(dInfo)
                End If
            Next
        Next
        oCfgResp.deviceInfoList = oDeviceArray.ToArray(GetType(WebDialer71.WDDeviceInfo))
        Return oCfgResp
    End Function
    Private Function CustomCertificateValidation(ByVal sender As Object, ByVal cert As Security.Cryptography.X509Certificates.X509Certificate, ByVal chain As Security.Cryptography.X509Certificates.X509Chain, ByVal Errors As Net.Security.SslPolicyErrors) As Boolean
        Return True
    End Function
    Private Function getProfileSoap_BuildRequest(ByVal in0 As WebDialer71.Credential, ByVal in1 As String) As String
        getProfileSoap_BuildRequest = ""
        getProfileSoap_BuildRequest &amp;= "&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;soap:Envelope xmlns:soap=""&lt;a&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/a&gt;]"""
        getProfileSoap_BuildRequest &amp;= " xmlns:soapenc=""&lt;a&gt;http://schemas.xmlsoap.org/soap/encoding/&lt;/a&gt;]"""
        getProfileSoap_BuildRequest &amp;= " xmlns:tns=""urn:WD70"""
        getProfileSoap_BuildRequest &amp;= " xmlns:types=""urn:WD70/encodedTypes"""
        getProfileSoap_BuildRequest &amp;= " xmlns:xsi=""&lt;a&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;]"""
        getProfileSoap_BuildRequest &amp;= " xmlns:xsd=""&lt;a&gt;http://www.w3.org/2001/XMLSchema&lt;/a&gt;]""&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;soap:Body soap:encodingStyle=""&lt;a&gt;http://schemas.xmlsoap.org/soap/encoding/&lt;/a&gt;]""&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;tns:getProfileSoap&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;in0 href=""#id1"" /&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;in1 xsi:type=""xsd:string""&gt;" &amp; in1 &amp; "&lt;/in1&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;/tns:getProfileSoap&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;tns:Credential id=""id1"" xsi:type=""tns:Credential""&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;userID xsi:type=""xsd:string""&gt;" &amp; in0.userID &amp; "&lt;/userID&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;password xsi:type=""xsd:string""&gt;" &amp; in0.password &amp; "&lt;/password&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;/tns:Credential&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;/soap:Body&gt;"
        getProfileSoap_BuildRequest &amp;= "&lt;/soap:Envelope&gt;"
    End Function
End Class</summary>
    <dc:creator>Bryan Johnson</dc:creator>
    <dc:date>2009-09-25T01:01:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: Error when using getProfileSoap</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1640208" />
    <author>
      <name>David Staudt</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1640208</id>
    <updated>2009-09-24T04:16:17Z</updated>
    <published>2009-09-24T04:16:17Z</published>
    <summary type="html">I believe this issue has to do with the XML response generated by UCM (using Java Axis WSDL generated code), and the .NET WSDL generated code you are using - the .NET code is not able to handle the 'multiref' structures.  This article has a detailed discussion: http://www.ibm.com/developerworks/webservices/library/ws-tip-j2eenet1/
 
Workaround would be to 'manually' use XML DOM to walk the XML response object.</summary>
    <dc:creator>David Staudt</dc:creator>
    <dc:date>2009-09-24T04:16:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Error when using getProfileSoap</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1637317" />
    <author>
      <name>Darren Parkinson</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1637317</id>
    <updated>2009-09-23T20:11:17Z</updated>
    <published>2009-09-23T20:11:17Z</published>
    <summary type="html">Hi,
 
I'm afraid not, I think I just worked around it in the end using the bits that did work.  Sorry I can't provide any further assistance... If you do get it working though, you'll have to let us know.
 
Thanks,
D.</summary>
    <dc:creator>Darren Parkinson</dc:creator>
    <dc:date>2009-09-23T20:11:17Z</dc:date>
  </entry>
  <entry>
    <title>RE: Error when using getProfileSoap</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1636995" />
    <author>
      <name>Bryan Johnson</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1636995</id>
    <updated>2009-09-23T18:41:27Z</updated>
    <published>2009-09-23T18:41:27Z</published>
    <summary type="html">I am having the same issue, and have not been able to resolve it.
 
I can use the getProfileDetailSoap fine, but that doesn't allow me to present different login credentials.
 
Were you able to find a solution?</summary>
    <dc:creator>Bryan Johnson</dc:creator>
    <dc:date>2009-09-23T18:41:27Z</dc:date>
  </entry>
  <entry>
    <title>Error when using getProfileSoap</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1374877" />
    <author>
      <name>Darren Parkinson</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=1374877</id>
    <updated>2009-05-15T04:20:52Z</updated>
    <published>2009-05-15T04:20:04Z</published>
    <summary type="html">When using getProfileSoap, I get an error "Error in deserializing body of reply message for operation 'getProfileSoap'" and if I edit my app.config with:
 
&lt;system.diagnostics&gt;
    &lt;switches&gt;
      &lt;add name="XmlSerialization.Compilation" value="1" /&gt;
    &lt;/switches&gt;
  &lt;/system.diagnostics&gt;
 
I get a bit more detail from the Cisco "XmlSerializationWriterWDSoapInterface" -- looks to be from the "object Read7_GetConfigResponse()" method?
 
It's an "InvalidOperationException was unhandled by user code":
The specified type was not recognized: name='WDDeviceInfo', namespace='urn:WebdialerSoap', at &lt;deviceInfoList xmlns=''&gt;.
 
Anyway, I'm wondering what I'm doing wrong?
 
Fiddler2 actually shows the call as being a success and I get some XML in the trace as below, but it's not putting that into my GetConfigResponse as expected?
 
Any thoughts?
 
Thanks in advance, 
D.
 
 
&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;soapenv:Envelope xmlns:soapenv="[url=http://schemas.xmlsoap.org/soap/envelope/]http://schemas.xmlsoap.org/soap/envelope/[/url]" xmlns:xsd="[url=http://www.w3.org/2001/XMLSchema]http://www.w3.org/2001/XMLSchema[/url]" xmlns:xsi="[url=http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;soapenv:Body&gt;&lt;ns1:getProfileSoapResponse]http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;soapenv:Body&gt;&lt;ns1:getProfileSoapResponse[/url] soapenv:encodingStyle="[url=http://schemas.xmlsoap.org/soap/encoding/]http://schemas.xmlsoap.org/soap/encoding/[/url]" xmlns:ns1="urn:WD70"&gt;&lt;getProfileSoapReturn href="#id0"/&gt;&lt;/ns1:getProfileSoapResponse&gt;&lt;multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="[url=http://schemas.xmlsoap.org/soap/encoding/]http://schemas.xmlsoap.org/soap/encoding/[/url]" xsi:type="ns2:GetConfigResponse" xmlns:soapenc="[url=http://schemas.xmlsoap.org/soap/encoding/]http://schemas.xmlsoap.org/soap/encoding/[/url]" xmlns:ns2="urn:WD70"&gt;&lt;description xsi:type="xsd:string"&gt;[b]Success[/b]&lt;/description&gt;&lt;deviceInfoList soapenc:arrayType="ns3:WDDeviceInfo[2]" xsi:type="soapenc:Array" xmlns:ns3="urn:WebdialerSoap"&gt;&lt;item href="#id1"/&gt;&lt;item href="#id2"/&gt;&lt;/deviceInfoList&gt;&lt;responseCode href="#id3"/&gt;&lt;/multiRef&gt;&lt;multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="[url=http://schemas.xmlsoap.org/soap/encoding/]http://schemas.xmlsoap.org/soap/encoding/[/url]" xsi:type="xsd:int" xmlns:soapenc="[url=http://schemas.xmlsoap.org/soap/encoding/"&gt;0&lt;/multiRef&gt;&lt;multiRef]http://schemas.xmlsoap.org/soap/encoding/"&gt;0&lt;/multiRef&gt;&lt;multiRef[/url] id="id1" soapenc:root="0" soapenv:encodingStyle="[url=http://schemas.xmlsoap.org/soap/encoding/]http://schemas.xmlsoap.org/soap/encoding/[/url]" xsi:type="ns4:WDDeviceInfo" xmlns:ns4="urn:WebdialerSoap" xmlns:soapenc="[url=http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;deviceName]http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;deviceName[/url] xsi:type="xsd:string"&gt;SEP0019AAAA3DF3&lt;/deviceName&gt;&lt;lines soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array"&gt;&lt;item xsi:type="xsd:string"&gt;74271 ; DemoLab-PT&lt;/item&gt;&lt;item xsi:type="xsd:string"&gt;15002 ; DemoLab-PT&lt;/item&gt;&lt;/lines&gt;&lt;/multiRef&gt;&lt;multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="[url=http://schemas.xmlsoap.org/soap/encoding/]http://schemas.xmlsoap.org/soap/encoding/[/url]" xsi:type="ns5:WDDeviceInfo" xmlns:ns5="urn:WebdialerSoap" xmlns:soapenc="[url=http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;deviceName]http://schemas.xmlsoap.org/soap/encoding/"&gt;&lt;deviceName[/url] xsi:type="xsd:string"&gt;SEP0019AAAA3DF3&lt;/deviceName&gt;&lt;lines soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array"&gt;&lt;item xsi:type="xsd:string"&gt;74271 ; DemoLab-PT&lt;/item&gt;&lt;item xsi:type="xsd:string"&gt;15002 ; DemoLab-PT&lt;/item&gt;&lt;/lines&gt;&lt;/multiRef&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</summary>
    <dc:creator>Darren Parkinson</dc:creator>
    <dc:date>2009-05-15T04:20:04Z</dc:date>
  </entry>
</feed>

