Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6119491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:33:32+00:00 2026-05-23T15:33:32+00:00

I’m having trouble implementing a service based off of a third-party wsdl. The third-party

  • 0

I’m having trouble implementing a service based off of a third-party wsdl. The third-party calls into my service and I can see the data in the trace, but my service parameters keep ending up null after deserialization.

As you can see from the trace, the alertXML node contains a XML document as a string. In the service code, this alertXML string is always null. Is there some special processing I need to do to handle this XML-as-a-string scenario?

Barring that, is there any way for me to just get a hold of the whole envelope so that I can parse the thing out?

Thanks

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent">
<System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system">
    <EventID>0</EventID>
    <Type>3</Type>
    <SubType Name="Information">0</SubType>
    <Level>8</Level>
    <TimeCreated SystemTime="2011-07-08T17:46:14.7804786Z" />
    <Source Name="System.ServiceModel.MessageLogging" />
    <Correlation ActivityID="{54a3d088-5393-45a7-ae97-0bcd636f1750}" />
    <Execution ProcessName="w3wp" ProcessID="3468" ThreadID="17" />
    <Channel/>
    <Computer>COMPUTER</Computer>
</System>
<ApplicationData>
    <TraceData>
        <DataItem>
            <MessageLogTraceRecord Time="2011-07-08T13:46:14.7804786-04:00" Source="TransportReceive" Type="System.ServiceModel.Channels.BufferedMessage" xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
                <HttpRequest>
                    <Method>POST</Method>
                    <QueryString></QueryString>
                    <WebHeaders>
                        <Content-Length>1807</Content-Length>
                        <Content-Type>text/xml; charset=utf-8</Content-Type>
                        <Expect>100-continue</Expect>
                        <Host>host</Host>
                        <User-Agent>Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3623)</User-Agent>
                        <SOAPAction>"http://www.xyz.com/wsdl/ProcessXML"</SOAPAction>
                    </WebHeaders>
                </HttpRequest>
                <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">
                    <soap:Body>
                        <ProcessXML xmlns="http://www.xyz.com/wsdl/">
                            <alertXml>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;XMLOutgoing&gt;MORE XML STRING&lt;/XMLOutgoing&gt;</alertXml>
                        </ProcessXML>
                    </soap:Body>
                </soap:Envelope>
            </MessageLogTraceRecord>
        </DataItem>
    </TraceData>
</ApplicationData>

EDIT:
The wsdl is:

    <?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                  xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                  xmlns:tns="http://www.xyz.com/wsdl/"
                  xmlns:s="http://www.w3.org/2001/XMLSchema"
                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                  targetNamespace="http://www.xyz.com/wsdl/"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="http://www.xyz.com/wsdl/">
      <s:element name="ProcessXML">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="alertXml" type="s:string"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ProcessXMLResponse">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="ProcessXMLResult">
              <s:complexType mixed="true">
                <s:sequence>
                  <s:any/>
                </s:sequence>
              </s:complexType>
            </s:element>
          </s:sequence>
        </s:complexType>
      </s:element>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="ProcessXMLSoapIn">
    <wsdl:part name="parameters" element="tns:ProcessXML"/>
  </wsdl:message>
  <wsdl:message name="ProcessXMLSoapOut">
    <wsdl:part name="parameters" element="tns:ProcessXMLResponse"/>
  </wsdl:message>
  <wsdl:message name="ProcessXMLHttpGetIn">
    <wsdl:part name="alertXml" type="s:string"/>
  </wsdl:message>
  <wsdl:message name="ProcessXMLHttpGetOut">
    <wsdl:part name="Body"/>
  </wsdl:message>
  <wsdl:message name="ProcessXMLHttpPostIn">
    <wsdl:part name="alertXml" type="s:string"/>
  </wsdl:message>
  <wsdl:message name="ProcessXMLHttpPostOut">
    <wsdl:part name="Body"/>
  </wsdl:message>
  <wsdl:portType name="GenericServiceSoap">
    <wsdl:operation name="ProcessXML">
      <wsdl:input message="tns:ProcessXMLSoapIn"/>
      <wsdl:output message="tns:ProcessXMLSoapOut"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:portType name="GenericServiceHttpGet">
    <wsdl:operation name="ProcessXML">
      <wsdl:input message="tns:ProcessXMLHttpGetIn"/>
      <wsdl:output message="tns:ProcessXMLHttpGetOut"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:portType name="GenericServiceHttpPost">
    <wsdl:operation name="ProcessXML">
      <wsdl:input message="tns:ProcessXMLHttpPostIn"/>
      <wsdl:output message="tns:ProcessXMLHttpPostOut"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="GenericServiceSoap" type="tns:GenericServiceSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="ProcessXML">
      <soap:operation soapAction="http://www.xyz.com/wsdl/ProcessXML" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="GenericServiceSoap12" type="tns:GenericServiceSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="ProcessXML">
      <soap12:operation soapAction="http://www.xyz.com/wsdl/ProcessXML" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="GenericServiceHttpGet" type="tns:GenericServiceHttpGet">
    <http:binding verb="GET"/>
    <wsdl:operation name="ProcessXML">
      <http:operation location="/ProcessXML"/>
      <wsdl:input>
        <http:urlEncoded/>
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="GenericServiceHttpPost" type="tns:GenericServiceHttpPost">
    <http:binding verb="POST"/>
    <wsdl:operation name="ProcessXML">
      <http:operation location="/ProcessXML"/>
      <wsdl:input>
        <mime:content type="application/x-www-form-urlencoded"/>
      </wsdl:input>
      <wsdl:output>
        <mime:content part="Body" type="text/xml"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="GenericService">
  </wsdl:service>
</wsdl:definitions>

The skeleton of the service code is:

Public Function ProcessXML(request As ProcessXMLRequest) As ProcessXMLResponse Implements GenericServiceSoap.ProcessXML
    'request.Body is a non-null object but request.Body.alertXml is null
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:33:33+00:00Added an answer on May 23, 2026 at 3:33 pm

    To send XML as a parameter or a property in a DataContract in WCF you need to use XmlElement for the .NET type of the parameter or property. Based on the WSDL in the question, the alertXml will be serialized as a string not XML by WCF. Here is what the WSDL for an XML operation parameter would look like:

    <xs:element name="alertXml" nillable="true" minOccurs="0">
        <xs:complexType>
            <xs:sequence>
                <xs:any minOccurs="0" processContents="lax"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    

    To see what all the WSDL should look like, implement a service like this:

    [ServiceContract]
    public interface IService1
    {
    
        [OperationContract]
        string ProcessXml(XmlElement alertXml);
    
        [OperationContract]
        string ProcessSomeXml(ProcessXMLRequest xmlRequest);
    }
    
    [DataContract]
    public class ProcessXMLRequest
    {
        public XmlElement someXml { get; set; }
    }
    
    //Service implementation
    public class Service1 : IService1
    {
        public string ProcessXml(XmlElement alertXml)
        {
            XmlNode xmlToProcess = GetXmlToProcess(alertXml);
    
            return string.Format("You entered: {0}", xmlToProcess.InnerText);
        }
    
        public string ProcessSomeXml(ProcessXMLRequest xmlRequest)
        {
            XmlNode xmlToProcess = GetXmlToProcess(xmlRequest.someXml);
    
            return string.Format("You entered some: {0}", xmlToProcess.InnerText);
        }
    
        private XmlNode GetXmlToProcess(XmlElement alertXml)
        {
            var xmlToProcess = alertXml as XmlNode;
    
            if (xmlToProcess == null)
            {
                var x = new XmlDocument();
                x.LoadXml("<root>XML was null</root>");
                xmlToProcess = x;
            }
            return xmlToProcess;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.