cancel
Showing results for 
Search instead for 
Did you mean: 

REST to SOAP: Invalid number of elements in URL "/"

Former Member
0 Kudos

Hi,

So having read the great blog series by Alexander Bundschuh and I decided to try and set up my first scenario using the REST adapter in the same vain as .

When I come to test the service from SOAPUI I get a 404 error with the message "Invalid number of elements in URL "/". 3 expected, 0 received."

As you can see it is hitting the correct sender communication channel as the response comes back with the channel name "RESTSenderMyService".

The Channel has been set up as follows:

  • Input and output format = XML
  • Channel selection = MyService   (The 'Specify Endpoint' flag is ticked)
  • There is no limit set for the HTTP operation.
  • Everything else is left unchanged....left as their default values

Also I've tried adding the full URL in SOAPUI in the endpoint field - the attached screenshot shows when I tried moving the /RESTAdapter/MyService into the Resource field.

I've also fiddled with the media type of the payload from text/xml to application/xml.

So the mystery is what does the error message refer to and what are the 3 elements it's expecting?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Peter,

This has happened because you have not defined the values for the url pattern you have defined in the REST sender channel (I am talking about Service resource and id).

Provide them in the resource section and you will get the message through.

eg- /RESTAdapter/MyService/service/resource/id

Thanks,

Vikas Singh


Former Member
0 Kudos

Brilliant Vikas!!

Yea, I left the URL pattern defaulted when actually I wanted it to be custom then set the value to '/'.

I did that and it worked great.

Thanks again.

Answers (0)