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).

alt text

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?

alt text

alt text

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)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bet="https://venus.zhaw.ch:8443/ibis/ws/1383213506125/Betreibungsregisterauszug_ws_Listener">
   <soapenv:Header/>
   <soapenv:Body>
      <bet:BetreibungsregisterauszugErhalten>CH450234</bet:BetreibungsregisterauszugErhalten>
   </soapenv:Body>
</soapenv:Envelope>

asked 06.12.2013 at 14:03

Bj%C3%B6rn's gravatar image

Björn
368913
accept rate: 100%

edited 11.12.2013 at 10:28

PS: Your WSDL is not valid to ppl outside the ZHAW Network.

(06.12.2013 at 14:38) Daniel Oechslin Daniel%20Oechslin's gravatar image

I'm using the service now outside the ZHAW Network and it works in soapUI. Why do you mean, it isn't valid?

(06.12.2013 at 14:46) Björn Bj%C3%B6rn's gravatar image

because we can't see venus.zhaw.ch:8000 outside the zhaw Network.

http://s30.postimg.org/5hfvjzo3h/cmd.jpg
(06.12.2013 at 14:53) Daniel Oechslin Daniel%20Oechslin's gravatar image

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

(06.12.2013 at 15:08) Björn Bj%C3%B6rn's gravatar image

Off topic: May I ask, where you work?

(06.12.2013 at 16:15) Björn Bj%C3%B6rn's gravatar image

sent you an E-Mail

(13.12.2013 at 07:28) Daniel Oechslin Daniel%20Oechslin's gravatar image
showing 5 of 6 show 1 more comments

You sent a single string instead of a valid xml. You need to send a valid XML-object.

 @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;
        }

With this you create a valid response. Change the senderPerson to your field of choice and your fine.

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.

The Java class itself maps the xmltype field to Java fields and provides getter and Setters.

You can use this class now as Parameter type in your webservice call.

link

answered 06.12.2013 at 14:28

Daniel%20Oechslin's gravatar image

Daniel Oechslin
45771121
accept rate: 36%

edited 06.12.2013 at 15:06

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.

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?

(06.12.2013 at 14:43) Björn Bj%C3%B6rn's gravatar image

Could you add a picture of a SoapUI generated XML-request?

(06.12.2013 at 14:47) Daniel Oechslin Daniel%20Oechslin's gravatar image

I've added the raw XML request at the end of my question.

(06.12.2013 at 14:53) Björn Bj%C3%B6rn's gravatar image

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.

(10.12.2013 at 15:55) Björn Bj%C3%B6rn's gravatar image

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.

(12.12.2013 at 15:13) Reguel Werme... ♦♦ Reguel%20Wermelinger's gravatar image

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?

(12.12.2013 at 16:49) Björn Bj%C3%B6rn's gravatar image
showing 5 of 6 show 1 more comments

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.

What you send:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bet="https://venus.zhaw.ch:8443/ibis/ws/1383213506125/Betreibungsregisterauszug_ws_Listener">
   <soapenv:Header/>
   <soapenv:Body>
      <bet:BetreibungsregisterauszugErhalten>CH450234</bet:BetreibungsregisterauszugErhalten>      
</soapenv:Body>

and what it should be:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bet="https://venus.zhaw.ch:8443/ibis/ws/1383213506125/Betreibungsregisterauszug_ws_Listener">
   <soapenv:Header/>
   <soapenv:Body>
<unk:betreibungsregisterauszugerhalten>
      <bet:BetreibungsregisterauszugErhalten>CH450234</bet:BetreibungsregisterauszugErhalten>      
</unk:betreibungsregisterauszugerhalten>
 </soapenv:Body>

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.

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().

If this doesn't help you, please provide a full code example.

link

answered 10.12.2013 at 16:56

Daniel%20Oechslin's gravatar image

Daniel Oechslin
45771121
accept rate: 36%

edited 11.12.2013 at 08:28

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.

(11.12.2013 at 09:32) Björn Bj%C3%B6rn's gravatar image

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.

(11.12.2013 at 10:09) Daniel Oechslin Daniel%20Oechslin's gravatar image

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).

(11.12.2013 at 10:28) Björn Bj%C3%B6rn's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×37
×4

Asked: 06.12.2013 at 14:03

Seen: 10,432 times

Last updated: 13.12.2013 at 07:28