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 9204667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:45:51+00:00 2026-06-17T23:45:51+00:00

I have a soap body which I need to populate with the correct elements

  • 0

I have a soap body which I need to populate with the correct elements according to this wsdl definition.

<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://DEA.Web.Service.MasterCalendar.API/">
<s:element name="GetEvents">
 <s:complexType>
  <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="userName" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string"/>
    <s:element minOccurs="1" maxOccurs="1" name="startDate" type="s:dateTime"/>
    <s:element minOccurs="1" maxOccurs="1" name="endDate" type="s:dateTime"/>
    <s:element minOccurs="0" maxOccurs="1" name="eventName" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="location" type="s:string"/>
    <s:element minOccurs="0" maxOccurs="1" name="calendars" type="tns:ArrayOfInt"/>
    <s:element minOccurs="0" maxOccurs="1" name="eventTypes" type="tns:ArrayOfInt"/>
    <s:element minOccurs="0" maxOccurs="1" name="udqAnswer" type="s:string"/>
  </s:sequence>
 </s:complexType>
</s:element>
<s:complexType name="ArrayOfInt">
  <s:sequence>
    <s:element minOccurs="0" maxOccurs="unbounded" name="int" type="s:int"/>
  </s:sequence>
</s:complexType>
</s:schema>
</wsdl:types>

the code to populate the element is:

SOAPElement username  = bodyElement.addChildElement(sf.createName("userName","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
username.addTextNode("username");
SOAPElement password  = bodyElement.addChildElement(sf.createName("password","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
password.addTextNode("password");

SOAPElement startdate  = bodyElement.addChildElement(sf.createName("StartDate","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
SOAPElement endate  = bodyElement.addChildElement(sf.createName("EndDate","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
startdate.addTextNode("2013-02-01");
endate.addTextNode("2013-02-10");
SOAPElement eventName  = bodyElement.addChildElement(sf.createName("EventName","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
eventName.addTextNode("rock");
SOAPElement location  = bodyElement.addChildElement(sf.createName("location","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
location.addTextNode("The Well");

SOAPElement calendars  = bodyElement.addChildElement(sf.createName("calendars","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
SOAPElement calendarId  = calendars.addChildElement(sf.createName("int","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
calendarId.addTextNode("47");

SOAPElement eventTypes  = bodyElement.addChildElement(sf.createName("eventTypes","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
SOAPElement eventId  = eventTypes.addChildElement(sf.createName("int","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
eventId.addTextNode("37");
//SOAPElement eventId2  = eventTypes.addChildElement(sf.createName("int","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));

SOAPElement udqAnswer  = bodyElement.addChildElement(sf.createName("udqAnswer","SOAP-ENV","http://DEA.Web.Service.MasterCalendar.API/"));
udqAnswer.addTextNode("");

The request prior to being sent looks like this:

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header/><env:Body>
<SOAP-ENV:GetEvents xmlns:SOAP-ENV="http://DEA.Web.Service.MasterCalendar.API/">
  <SOAP-ENV:userName>username</SOAP-ENV:userName>
  <SOAP-ENV:password>password</SOAP-ENV:password>
  <SOAP-ENV:StartDate>2013-02-01</SOAP-ENV:StartDate>
  <SOAP-ENV:EndDate>2013-02-10</SOAP-ENV:EndDate>
  <SOAP-ENV:EventName>rock</SOAP-ENV:EventName>
  <SOAP-ENV:location>The Well</SOAP-ENV:location>
  <SOAP-ENV:calendars>
     <SOAP-ENV:int>47</SOAP-ENV:int>
  </SOAP-ENV:calendars>
  <SOAP-ENV:eventTypes>
    <SOAP-ENV:int>37</SOAP-ENV:int>
  </SOAP-ENV:eventTypes>
  <SOAP-ENV:udqAnswer/>
  </SOAP-ENV:GetEvents>
 </env:Body></env:Envelope>

Unfortuantely the servers response is vague and just says An error occured attempting to execute the command against the database. I can query other calls to the server just not this one, I think it has to do with the udqAnswer being not properly closed?

Bottom line is
I am lacking experince with to soap to spot where the populating of the element differs from the wsdl definition. Where is it wrong?

  • 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-06-17T23:45:53+00:00Added an answer on June 17, 2026 at 11:45 pm

    Try using SoapUI to just send several xml messages, and see if you can generate message for which you will get correct response.

    http://www.soapui.org

    Second try removing udqAnswer. I had issues with web services when I was sending empty tag because it was translated as null and there were issues about that 😐

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a SOAP request which looks like this: <soapenv:Body> <getItemsForProject> <token>
I have an xml string such as this: <s:Envelope xmlns:s=http://schemas.xmlsoap.org/soap/envelope/> <s:Body> <ExecuteResponse xmlns=http://schemas.microsoft.com/xrm/2011/Contracts/Services> <ExecuteResult
I have some WSDL from which I need to generate a web service implementation.
I have this response: <soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/> <soap:Body> <ns2:SurfaceElementListResponse xmlns:ns2=http://isiows.isiom.fr/schema/DmdCreation xmlns:ns3=http://isiows.isiom.fr/schema/Error xmlns:ns4=http://isiows.isiom.fr/schema/DmdDetail> <SurfaceElementListResult> <idSurfaceElement>9482</idSurfaceElement> <name>R04-</name>
I need to have this node in my SOAP Request (using 1.1): <CredentialsHeader xmlns=http://www.url.com/Services/P24ListingService11
I have an XML to which i need to apply a XSL to transform
I have an object which I serialize nicely into this: <?xml version=1.0 encoding=utf-8 ?>
I have been struggling for hours trying to build the correct SOAP request using
I have a known working web service which is configured as a SOAP and
I have a relatively simple Soap response message XML which I'd like to modify

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.