I thought I had settled on a good process for building the SOAP Service client portlets. Development was just getting to the point of being routine--dump the WSDL URL into the NetBeans Web Service Client wizard, adjust the sample HTML query form to make it a dynamic JSP page for the portlet view mode, and then use NetBeans code completion to figure out what parameters the web service calls required. Coordinate Parse, Country Names and Geoid Height (single and multiple) were finished and posted to the virtual server to be viewable over the Internet. That brought me approximately to the place I had been when the services were hosted on a different server and I had first built the portlets.
But then I tackled Geonames Service, which had not been available the first time I was on this task. It appeared to be straighforward like the others. There was a WSDL and a sample HTML query form. The query form had 4 different submit buttons for 4 different cases so I had to make a decision on whether or not to break out the 4 into separate portlets like I had done with the 2 different Geoid Height input forms. I opted instead to use one portlet with one form, but added to the form a pulldown for the 4 different options. There are a couple of extra fields required for 2 of the 4 queries so at some point I will need to figure out how to dynamically change the HTML so that it displays the extra fields when the user selects one of the pulldown options where those fields are required.
To get something up and running quickly I decided to use the defaults for entry parameters and just make sure I could return and display the same thing as the sample query form. I then realized that even the sample was not returning data in a couple of the cases. Contacting the developor gave the explanation that the backend database of the web service had only a small sampling of data loaded. He gave some guidance on which query parameters would be most likely to yield data. Unfortunately, when I finally got to the point of being ready to do the initial basic query through the portlet I ran into a new snag.
The client was returning an exception:
com.sun.xml.internal.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/html;charset=utf-8 Supported ones are: [text/xml]
Putting the client in Debug mode showed that the service and port calls were successful and the input parameter was being loaded with all the necessary data. But then the call to the actual operation itself caused the exception. And it was the same exception regardless of which of the 4 operations were used.
I googled the text of the exception but it didn't help me figure out the source of the problem or how to solve it. Some suggestions were to examine the server log, but that isn't an option since I have no access to the server that's hosting the service. Someone suggested using SOAPUI to see what is being returned by the server, but I'm not sure how to do that. I don't understand enough about the flow of the messages between the browser and the service to know where to look into what's going on. I even tried to simplify things by leaving the portlet, portlet container, servlet container, etc out of the picture and just building a basic Java application client to make the query. But the same thing happens--the service returns the exception as soon as the call to the operation is made. And I don't know how to use the debugger to dig any further into what happens during the call.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment