<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: XMLStreamException while calling a SOAP webservice</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice</link><description>&lt;pre&gt;&lt;code&gt;I want to use a webservice, which I created in Inubit. The WSDL URL is [http://venus.zhaw.ch:8000/ibis/ws/Betreibungsregisterauszug_ws_Listener?wsdl][1]. When I test the service in [soapUI][2] everything works fine (see picture).
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img alt="alt text" src="/upfiles/picture1.png"&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;When I test the service in Xpert.ivy Designer 5.1.0 S6, I get the error javax.xml.stream.XMLStreamException: element text content may not contain START_ELEMENT. What could be the reason for this error?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img alt="alt text" src="/upfiles/picture2.png"&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="alt text" src="/upfiles/picture3.png"&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Here is the XML Request in soapUI:

POST http://venus.zhaw.ch:8000/ibis/ws/Betreibungsregisterauszug_ws_Listener HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "BetreibungsregisterauszugErhalten"
Content-Length: 352
Host: venus.zhaw.ch:8000
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bet="https://venus.zhaw.ch:8443/ibis/ws/1383213506125/Betreibungsregisterauszug_ws_Listener"&amp;gt;
   &amp;lt;soapenv:Header/&amp;gt;
   &amp;lt;soapenv:Body&amp;gt;
      &amp;lt;bet:BetreibungsregisterauszugErhalten&amp;gt;CH450234&amp;lt;/bet:BetreibungsregisterauszugErhalten&amp;gt;
   &amp;lt;/soapenv:Body&amp;gt;
&amp;lt;/soapenv:Envelope&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://youtu.be/HhWzQLEylII?hd=1"&gt;Link to screencast explaining the problem (german only)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://youtu.be/uKkJFXZ98P0?hd=1"&gt;Link to 2nd screencast with new findings&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.dropbox.com/s/6zxd079rdh8ih3p/TEMPTestWebservice.iar"&gt;Link to Xpert.ivy project (iar-file)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><atom:link href="https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 10 Dec 2013 16:56:13 -0500</lastBuildDate><item><title>Answer by Daniel Oechslin</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice/193</link><description>&lt;p&gt;I found the error on your soap request. But I can't show you the solution in Xpert-Ivy.
Your error is due to a missing START_ELEMENT means: the SOAP-request is missing the name of your webservice.&lt;/p&gt;
&lt;p&gt;What you send: &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bet="https://venus.zhaw.ch:8443/ibis/ws/1383213506125/Betreibungsregisterauszug_ws_Listener"&amp;gt;
   &amp;lt;soapenv:Header/&amp;gt;
   &amp;lt;soapenv:Body&amp;gt;
      &amp;lt;bet:BetreibungsregisterauszugErhalten&amp;gt;CH450234&amp;lt;/bet:BetreibungsregisterauszugErhalten&amp;gt;      
&amp;lt;/soapenv:Body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and what it should be:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bet="https://venus.zhaw.ch:8443/ibis/ws/1383213506125/Betreibungsregisterauszug_ws_Listener"&amp;gt;
   &amp;lt;soapenv:Header/&amp;gt;
   &amp;lt;soapenv:Body&amp;gt;
&amp;lt;unk:betreibungsregisterauszugerhalten&amp;gt;
      &amp;lt;bet:BetreibungsregisterauszugErhalten&amp;gt;CH450234&amp;lt;/bet:BetreibungsregisterauszugErhalten&amp;gt;      
&amp;lt;/unk:betreibungsregisterauszugerhalten&amp;gt;
 &amp;lt;/soapenv:Body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The difference is the unk:betreibungsregisterauszugerhalten-tag in the SOAP-request. The tag specifies the name of the webservice which should handle your request. It is nescessary to know the name of the webservice, because there can be several webservices where your request may fit.&lt;/p&gt;
&lt;p&gt;Where the first part: unk stays for the package name. unk= unknown in this case.
The second part: betreibungsregisterauszugerhalten is the method name, defined in your top-level-interface. Like betreibungsregisterauszugerhalten().&lt;/p&gt;
&lt;p&gt;If this doesn't help you, please provide a full code example.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Tue, 10 Dec 2013 16:56:13 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice/193</guid></item><item><title>Answer by Daniel Oechslin</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice/176</link><description>&lt;p&gt;You sent a single string instead of a valid xml. You need to send a valid XML-object. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt; @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "contentType", propOrder = {
    "senderPerson"   
})


public class ContentType{
        @XmlElement(required = true)
        protected String senderPerson;

        /**
         * Returns the senderPerson.
         * @return the senderPerson
         */
        public String getSenderPerson() {
            return senderPerson;
        }

        /**
         * Sets the sender person.
         * @param senderPerson the senderPerson to set
         */
        public void setSenderPerson(String senderPerson) {
            this.senderPerson = senderPerson;
        }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this you create a valid response. Change the senderPerson to your field of choice and your fine.&lt;/p&gt;
&lt;p&gt;First you need to specify how your request looks. So Ivy understands the incoming request and can validate the fields. You can create such specification in creating a plain java class inserting the code above. The first line defines the name of the request in this case contentType. Followed by properties. You add them in correct order separated by comma. I added a single field called senderPerson. &lt;/p&gt;
&lt;p&gt;The Java class itself maps the xmltype field to Java fields and provides getter and Setters.&lt;/p&gt;
&lt;p&gt;You can use this class now as Parameter type in your webservice call.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Fri, 06 Dec 2013 14:28:18 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice/176</guid></item></channel></rss>