<?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>Fri, 13 Dec 2013 07:28:30 -0500</lastBuildDate><item><title>Comment by Daniel Oechslin on Björn's question</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#200</link><description>&lt;p&gt;sent you an E-Mail&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Fri, 13 Dec 2013 07:28:30 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#200</guid></item><item><title>Comment by Björn on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#198</link><description>&lt;p&gt;Hi Reguel. Thank you very much for your offer to help. But as it is now too late for the students to implement a solution, I told them that they should ignore for now. But in the long-term I would like to get a solution to this. May I contact you in January 2014 for a netviewer session, so we can investigate this directly on my computer?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Thu, 12 Dec 2013 16:49:15 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#198</guid></item><item><title>Comment by Reguel Wermelinger on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#197</link><description>&lt;p&gt;can you share a soap UI project with the mocked service and sample answer as well? else I'm not able to reproduce this issue - as the schema is not available from my network.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Thu, 12 Dec 2013 15:13:32 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#197</guid></item><item><title>Comment by Björn on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#196</link><description>&lt;p&gt;Thanks for your comment. I tried what you said, but it don't work.
One of the students groups was able to at least partially test the webservice call, so I looked, what they are doing else than me. It seems, that the input string is the problem. I made another very short video to explain my findings until now (see link at the end of the initial question).&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Wed, 11 Dec 2013 10:28:59 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#196</guid></item><item><title>Comment by Daniel Oechslin on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#195</link><description>&lt;p&gt;it looks like you simply need to map the return value in the result tab of your webservice. There is an empty testwebserviceresponse. This missing xml could trigger the not found exception because there is no valid XML in an empty response.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Wed, 11 Dec 2013 10:09:00 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#195</guid></item><item><title>Comment by Björn on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#194</link><description>&lt;p&gt;Thank you very much for your 2nd answer. I'm still not able to solve the problem, but I believe coming closer to the problem. I recorded a short screencast, where I show the structure of the webservice in Inubit and my attempt to use the service in Xpert.ivy (screencast is in german only, sorry). Also I exported the Xpert.ivy project shown in the screencast to an IAR-file for further investigation.
The links to the screencast and iar-file are at the end of my initial question.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Wed, 11 Dec 2013 09:32:04 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#194</guid></item><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>Comment by Björn on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#192</link><description>&lt;p&gt;It would be nice, if I get further support, since I don't know how to implement the answer (see my comment of 06.12 at 14:43). The answer makes no sense to me.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Tue, 10 Dec 2013 15:55:47 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#192</guid></item><item><title>Comment by Björn on Björn's question</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#191</link><description>&lt;p&gt;Off topic: May I ask, where you work?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Fri, 06 Dec 2013 16:15:46 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#191</guid></item><item><title>Comment by Björn on Björn's question</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#188</link><description>&lt;p&gt;Probably your firewall is blocking venus.zhaw.ch, because it has not a valid SSL certificate. But when you check venus.zhaw.ch with port 8000 outside of the Soreco Network, it is open: see ping.eu/port-chk&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Fri, 06 Dec 2013 15:08:20 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#188</guid></item><item><title>Comment by Björn on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#187</link><description>&lt;p&gt;I've added the raw XML request at the end of my question.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Fri, 06 Dec 2013 14:53:48 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#187</guid></item><item><title>Comment by Daniel Oechslin on Björn's question</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#186</link><description>&lt;p&gt;because we can't see venus.zhaw.ch:8000 outside the zhaw Network.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;http://s30.postimg.org/5hfvjzo3h/cmd.jpg
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Daniel Oechslin</dc:creator><pubDate>Fri, 06 Dec 2013 14:53:30 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#186</guid></item><item><title>Comment by Daniel Oechslin on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#184</link><description>&lt;p&gt;Could you add a picture of a SoapUI generated XML-request?&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:47:52 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#184</guid></item><item><title>Comment by Björn on Björn's question</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#183</link><description>&lt;p&gt;I'm using the service now outside the ZHAW Network and it works in soapUI. Why do you mean, it isn't valid?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Fri, 06 Dec 2013 14:46:58 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#183</guid></item><item><title>Comment by Björn on Daniel Oechslin's answer</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#182</link><description>&lt;p&gt;Wow, this is definitely not straight forward. I hoped, that Xpert.ivy does the String-To-XMLparsing job for me, as I am used to from using Inubit.&lt;/p&gt;
&lt;p&gt;I need more information to get your answer to work for me. Where to put your code - in a script step or somewhere else? And what do you mean with "field of choice" - is this the name of an data class attribute of the type ch.ivyteam.ivy.scripting.objects.Xml?&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Fri, 06 Dec 2013 14:43:48 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#182</guid></item><item><title>Comment by Daniel Oechslin on Björn's question</title><link>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#180</link><description>&lt;p&gt;PS: Your WSDL is not valid to ppl outside the ZHAW Network.&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:38:42 -0500</pubDate><guid>https://answers.axonivy.com/questions/172/xmlstreamexception-while-calling-a-soap-webservice#180</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>