Kevin G Scott

Greenhorn
+ Follow
since Jan 24, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kevin G Scott

Hello all,
I am attempting to write Java clients against a .Net service that uses WSE 1.0. I can't seem to get any of toolkits I have tried to work with this service. Unfortunately, I do not own the service, so I cannot upgrade it to WSE 2.0 or some other modern SOAP library. The problem seems to be that the WSE 1.0 expects namespaces from the July 2002 version of WS-Security, while all the libraries I have tried (JWSDP, Oracle Web Service Wizard, etc) use the oasis namespace from January 2004.

Can anyone suggest an alternative solution to make this work? Is there a way to set the namespace sent in XWS-Security? I think this might solve the problem...

Thanks,
KS
16 years ago
The following seems to work.

KeyStore ks = KeyStore.getInstance("PKCS12");
FileInputStream fis = new FileInputStream("certFileName");
ks.load(fis, "password".toCharArray());

Enumeration aliasEnum = ks.aliases();

Key key = null;
Certificate cert = null;

while(aliasEnum.hasMoreElements()){
String keyName = (String)aliasEnum.nextElement();
key = ks.getKey(keyName,"password".toCharArray());
cert = ks.getCertificate(keyName);
}

KeyPair kp = new KeyPair(cert.getPublicKey(),(PrivateKey)key);
16 years ago
Hello,
Can anyone share code on how to read a keypair from a PKCS12 file into a java KeyPair object?

Thanks,
KS
16 years ago
Hello,
I am working to develop a high-volume Web Service. Most requests of this service will need a HttpURLConnection to another service to make a HTTP request. Are there any best practices for managing a large number of HTTP Connections? I guess what I am looking for is basically connection pooling for HTTP Connections, but it looks like that's not possible. So can anyone suggest the best way to manage these connections so I can save the time of opening a new connection each time?

Thanks,
KS
16 years ago
Hello all,
I have a Web Service that uses a datasource from my J2EE container. I had a very strange error this morning. The first error that I received was like this:
java.sql.SQLException: Io exception: Software caused connection abort: recv failed
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:286)
at oracle.jdbc.driver.T4CStatement.execute_for_rows(T4CStatement.java:497)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1109)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1560)
at com.evermind.sql.FilterStatement.executeUpdate(FilterStatement.java:61)
at com.evermind.sql.FilterStatement.executeUpdate(FilterStatement.java:61)
at com.evermind.sql.StatementBCELProxy.executeUpdate(StatementBCELProxy.java:53)

After this error occurs, every request that tries to pull a connection from the pool receives the following error when it tries to use the connection:
java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:239)
at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:728)
at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:702)
at com.evermind.sql.FilterConnection.createStatement(FilterConnection.java:279)
at com.evermind.sql.FilterConnection.createStatement(FilterConnection.java:279)
at com.evermind.sql.ConnectionBCELProxy.createStatement(ConnectionBCELProxy.java:40)

I restarted the container to refresh the Datasources, and that seems to have resolved the issue, but I want to ensure that It doesn't occur again. Does anyone have any ideas what could have caused this issue?

Thanks in advance!
So does that mean that the wrapped paradigm isn't fully interoperable?
16 years ago
Hello,
I was playing a little with the wscompile tool that comes with the JWSDP 1.5 and working on generating a client for a WSDL. When I specify the f:wsi option, all my message signatures seem to pick up the wrapped element names as types, so that I get operations like MethodNameResponse methodName(MethodNameRequest). When I leave this flag off I get the correct signature. I don't why this happens and the only thing in the document for this flag is that it "enable(s) WSI-Basic Profile features." Can anyone explain this observed behavior?

Thanks in advance!
16 years ago

Originally posted by Tim West:
Hmm, it's legal according to WSDL 1.1, and it's worked for me in Weblogic 8.1.

Good luck though ...and compatibility across different toolkits is still a bit of a pain, hey?


-Tim



Just for the sake of information sharing, I tried this again using the Oracle JDeveloper 10.1.3 Preview (the only edition that supports JAX-RPC) and the wscompile tool in JWSDP 1.5, and neither seems to support this. The wcompile tool returns the following error

"error: parts "parameters" not found in the message "TestWebService1SEI_getTest",wrong WSDL"

Thanks again for the feedback,
KS
17 years ago

Originally posted by Tim West:
I've not tried to do an empty request, but an empty response can be achieved by having no "parts" in the <message> declaration, viz:



If I were you, I'd try this on the message used for the request.

Note that ultimately the form of the Java interface (and hence number of paramters in a Java sense) is dependent upon two things (1) the WSDL content, and (2) how the Java - WSDL mapping tool (Axis, JWSDP, Weblogic wsdl2service etc) interprets the WSDL. So, although you can control (1), it may be difficult to ensure a particular interpretation (that is, producing a method with no parameters) among all the different mapping tools.


-Tim



Tim,
Thanks for your response. This is an interesting idea, but I would be very concerned about the tool support. I think I tried this once and got an error, but I need to try again.

Thanks,
KS
17 years ago
Hi,
I am hoping to get some ideas from some of the Web Services gurus on here. My scenario is that I am designing a Web Service which contains a method with no parameters. I would like to write the WSDL in such a way that's it's clear that no data is required. However, the best way I have thought of to accomplish this is something like:

<xsd:complexType name="getMethod">
<xsd:sequence/>
</xsd:complexType>

<xsd:element name="request" type="ns1:getMethod" />

However, when I generate a client for this using JAX-RPC, it generates the method in the proxy as getMethod(String str) where string is basically useless. My question is, is there a better way to specify a method that does not require any input, or am I stuck with just telling clients to feed junk into the string parameter?

Thanks for any feedback,
KS
17 years ago
I am not sure if this will eliminate all the apache imports, but I would think that the best way to free yourself of properitery libraries is the use the wscompile program which is included as part of the JWSDP

KS
17 years ago
Just in the interest of others who might see something similiar. I found the issue was that the security software had a maximum size for messages, and so it was refusing the response from the web service, and then trying to pass null, which of course didn't meet WS-I standards.
17 years ago
Hello all,
I have a Web Service deployed behind some security software (Actional) that performs WS-I validation on messages as they pass back and forth. We deployed a new method to an existing web service, and I started getting error message from the WS-I validator about that only HTTP 1.0 and 1.1 were supported by WS-I. I did some checking and found that it seems to trigger only when the XML being passed is larger than 1MB in size. Is there a maximum message size defined for HTTP? I looked around and all I found was that most servers let you set this, and many seemed to have higher settings than this!

Also, does anyone have any other ideas why a large message would violate HTTP protocol?

Thanks,
KS
17 years ago
Hello all,
I am working with a UDDI registry that doesn't seem to play nice with JAXR implementations. The problem seems to be that the UDDI registry does not place a xml:lang attribute in the services, so that when the JAXR client searches, it places a xml:lang="en" attribute in the search, so that the return does not include all the services. So anyway, I decided to attempt to write a wrapper service so that I could strip this attribute from the requests and transform the return so that the JAXR client can understand it. I have this written this service and checked the tcp trace, and the return going back to the client looks good, and I checked it against the UDDI v2 schema and it looks good. However, I get the following error:

java.lang.IllegalArgumentException
at com.sun.xml.registry.uddi.bindings_v2.impl.runtime.UnmarshallerImpl.unmarshal(Unknown Source)
at com.sun.xml.registry.common.util.MarshallerUtil.jaxbUnmarshalObject(Unknown Source)
at com.sun.xml.registry.uddi.Processor.processResponseJAXB(Unknown Source)
at com.sun.xml.registry.uddi.Processor.processRequestJAXB(Unknown Source)
at com.sun.xml.registry.uddi.UDDIMapper.findServices(Unknown Source)
at com.sun.xml.registry.uddi.BusinessQueryManagerImpl.findServices(Unknown Source)

So here are my questions:
1) Does anyone have a better idea to accomplish this wrapping, or am I at least going down the correct path?
2) I placed the XML that I am returning into the MarshallerUtil and the Unmarshaller and it is able to unmarshall it properly. I also checked the JAXB API and this error is apparently caused by a null source being passed into the unmarshall method. Any ideas on where this source is being set to null in the interim?
3) Is there a way to get a hold of the source of the objects written above, so I can check out what's going on?
17 years ago
Hello,
I am updating client Web Services which are currently using J2EE 1.3 and processing raw XML. I want to move these to JAX-RPC. My first thought was to leave the current code to draw the XML out of the database and then bind it to a JAXB object. This is where my brilliant idea beached itself against reality. The problem is that classes generated from a Schema by JAXB make use of classes that JAX-RPC can't deal with. Most of these classes are Collections. So here is my question: Can I make JAX-RPC deal with objects in a standardized, interoperable way OR can I make JAXB use only constructs that JAX-RPC likes.
Thanks!
17 years ago