JAX-RPC, Spring web services, and UnsupportedOperationCallException
I have a JAX-RPC web service that I am attempting to consume using Spring. This is my first time using Spring to consume a web service, so right now I'm just trying to get it to integrate with the JAX-RPC web service as a test.
The web service has several dozen operations in it, but for right now I only care about one. Here are the interfaces I've created on the Spring/client side:
public interface WSClient {
public boolean userExists(int userid);
}
public interface WSService {
//this method matches the method signature of the Web Service
public com.company.data.User getUser(int userid);
}
And here is my applicationContext.xml:
<bean id="WSClient" class="com.company.ws.test.WSClientImpl">
<property name="service" ref="myWebService"></property>
</bean>
<bean id="myWebService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean">
<property name="serviceInterface" value="com.company.ws.test.WSService"/>
<property name="endpointAddress" value="http://1.2.3.4/web-service/data"/>
<property name="namespaceUri" value="http://www.company.com/wdsl"/>
<property name="serviceName" value="CompanyWebService"/>
<property name="username" value="username"/>
<property name="password" value="password"/>
<property name="maintainSession" value="true"/>
</bean>
Using this configuration of JaxRpcPortProxyFactoryBean
, invoking the Service returns the following exception:
org.springframework.remoting.RemoteProxyFailureException: Invalid JAX-RPC call configuration; nested exception is operation style: "rpc" not supported
I've never fully understood the difference between RPC and document-style web services; however, I believe this web service is using RPC-style - so this exception confuses me.
Second, I'm confused on which properties I should be setting with JaxRpcPortProxyFactoryBean
:
- If I set the
wsdlDocumentUrl
property, I end up getting a HTTP 401 error as this web service sits behind HTTP Basic Authentication, and it seems Spring does not use the username/password properties when fetching the WSDL. - If I specify a
PortInterface
property (with a value ofCompanyWebServiceInterfacePort
), then I get a different Exception stating:Failed to initialize service for JAX-RPC port [{http://www.company.com/wdsl}CompanyWebServiceInterfacePort]; nested exception is WSDL data missing, this operation is not available
In other words, it's telling me that the WSDL is missing - which I can't set since Spring won't use the username/password to fetch it from the server!
I'm not sure if any of this makes any sense, but in essence what I'm unsure of is:
- For a JAX-RPC service, do I need to set the PortInterface property? Is this the path I should be going down?
- Similiarly, does Spring need me to set the
wsdlDocumentUrl
property? If so, is there any way I can tell Spring which WSDL and get around the authentication problem?
Asked by: Carlos255 | Posted: 28-01-2022
Answer 1
I eventually solved this by saving a copy of the WSDL file locally, and, since JaxRpcPortProxyFactoryBean expects a java.net.URL
for the wsdlDocumentUrl
property, had to set it with a path like file:///c:/.../blah.wsdl
.
This isn't really all that desireable, I would hate to have to put a file:///
URI in a Spring context file that might be deployed on a server, especially on a different platform - seems odd that this class behaves this way.
I'm guessing most people aren't using Spring aren't using JAX-RPC anyway.
Answered by: Alfred748 | Posted: 01-03-2022Similar questions
Java: Why does calling `remove()` on a List throw UnsupportedOperation exception?
For some reason, I'm getting an UnsupportedOpeationException with the following code. Examining it in the debugger, it looks like the object I'm calling remove() on is a list.
// to optimize, remove totalSize. After taking an item from lowest, if lowest is empty, remove it from `lists`
// lists are sorted to begin with
public static <T extends Comparable<? super T>> Lis...
java - Android - Can't create simple rectangle shape... UnsupportedOperationException?
I'm having trouble creating a simple rounded rectangle using XML. Every time I try to add the "corners" element to the custom shape I get:
java.lang.UnsupportedOperationException
at
android.graphics.Path.addRoundRect(Path.java:514)
at
android.graphics.drawable.GradientDrawable.draw(GradientDrawable.java:314)
at
android.view.View.draw(View.java:6520)
...
...
java - Android -- Simple path, use of arcTo causes "UnsupportedOperationException?"
I'm trying to create a simple path in the onDraw method of a SurfaceView object I've created and the layout editor keeps giving me "UnsupportedOperationException: null" whenever I add an arcTo command to the path.
How do I fix this?
Thanks,
Ryan
public class myView extends SurfaceView
{
private Path myPath;
public myView(Context context, AttributeSet attrs) {
super(c...
Java: set-size List issue UnsupportedOperationException thrown
I am having a problem changing a List that has a set-size in Java.
I understand that I can't add or remove from this list but why can't I use set?
When I use set the UnsupportedOperationException is thrown as well as when I use add and remove which is expected.
set
public Object set(int index,
Object element)
Replaces the element at the specified position in this li...
java - UnsupportedOperationException on Collection
While studying the Collection API, we find that some methods (add, remove,...) may throw a java.lang.UnsupportedOperationException if the current implementation of the Collection does not support those functionalities.
Is there,actually, in the JDK, a concrete Collection that does not support those methods ?
Thanks a lot for your answers.
...
java - What would be the first thing that someone would check to resolve the UnsupportedOperationException in OC4J 10.1.3.5?
What would be the first thing that someone would check to resolve the UnsupportedOperationException in OC4J 10.1.3.5? This happen during logging out. We have two identical (from coding and classpath perspective) applications - one log out correctly, another one throws UnsupportedOperationException.
10/06/11 10:58:07 ERROR: Error during SSO logout
10/06/11 10:58:07 java.lang.UnsupportedOperationException
10...
java - Lucene - search works, but gives "UnsupportedOperationException" when deployed to Tomcat. Why?
The code under works when I run it as a java application locally, but "reader.directory()" gives "UnsupportedOperationException: This reader does not support this method." Someone have an idea why?
public ExternalSearch() {
System.out.println("Initialize Lucene-Search");
analyzer = new StandardAnalyzer(Version.LUCENE_20);
File file = new File("index");
try {
Directory dir = FSDirectory.open(file...
java - parseInt and parseLong throwing an UnsupportedOperationException
Integer.parseInt("5") and Long.parseLong("5") are throwing an UnsupportedOperationException in the Eclipse Expressions Window.
I think this is also the Exception I'm getting at runtime, but being new to Eclipse, I'm not sure how to find the type of e within a debug session...
java - Problem by refreshing listView: UnsupportedOperationException
why I am not able to refresh/reload my ListView?
I' ve written an app, which read out html-websites, saves the information in a String-Array an present it in my ListView.
But every time I close and re-open the app the new content append to the existing content.
In the first run I get, e. g., "1 2 3 4" and in the second run "1 2 3 4 1 2 3 4" and then " 1 2 3 4 1 2 3 4 1 2 3 4" and so on.
I google a lot and find the methods ...
Java List.add() UnsupportedOperationException
I try to add objects to a List<String> instance but it throws an UnsupportedOperationException.
Does anyone know why?
My Java code:
String[] membersArray = request.getParameterValues('members');
List<String> membersList = Arrays.asList(membersArray);
for (String member : membersList) {
Person person = Dao.findByName(member);
List<String> seeAlso;
...
Still can't find your answer? Check out these amazing Java communities for help...
Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)