Last modified by Matthew Taylor on 2008/09/13 12:25

From version 2.1
edited by smmccraw
on 2007/07/08 09:46
Change comment: There is no comment for this version
To version 4.1
edited by Matthew Taylor
on 2008/09/13 12:25
Change comment: added info about https to wikibook by mistake, now adding it here.

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Programming__WebObjects-Web Services-Common Pitfalls and Troubleshooting
1 +Web Services-Common Pitfalls and Troubleshooting
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.smmccraw
1 +XWiki.matt
Content
... ... @@ -1,26 +1,72 @@
1 -== NullPointerException calling WebService with Axis ==
1 +== NullPointerException calling WebService with Axis ==
2 2  
3 3  If you get an exception like the following:
4 4  
5 5  {{panel}}
6 6  
7 - Caused by: java.lang.NullPointerException
8 - at java.util.Hashtable.put(Hashtable.java:396)
9 - at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:395)
10 - at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:246)
11 - at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
12 - at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
13 - at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
14 - at org.apache.axis.client.Call.invoke(Call.java:2553)
15 - at org.apache.axis.client.Call.invoke(Call.java:2248)
16 - ... 5 more
7 +Caused by: java.lang.NullPointerException
8 +at java.util.Hashtable.put(Hashtable.java:396)
9 +at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:395)
10 +at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:246)
11 +at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
12 +at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
13 +at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
14 +at org.apache.axis.client.Call.invoke(Call.java:2553)
15 +at org.apache.axis.client.Call.invoke(Call.java:2248)
16 +... 5 more
17 17  
18 18  {{/panel}}
19 19  
20 20  It's most likely because you are using Java 1.5 with Axis 1.1. If you want your client to run on Java 1.5, you will need to upgrade to Axis 1.2RC2.
21 21  
22 -== Losing Session with Axis Client ==
22 +== Losing Session with Axis Client ==
23 23  
24 -For more information about cookie-based sessions with Axis clients, read the [[Consuming with Axis in Java>>Programming__WebObjects-Web_Services-Web_Service_Provider||anchor="Consuming_with_Axis_in_Java"]] section.
24 +For more information about cookie-based sessions with Axis clients, read the [[Consuming with Axis in Java>>WO:Programming__WebObjects-Web_Services-Web_Service_Provider||anchor="Consuming_with_Axis_in_Java"]] section.
25 25  
26 -Category:WebObjects
26 +== SAXParseException only when clients use https ==
27 +
28 +If, in WebObjects 5.4.x, your web services work normally over insecure http connections, but fail with the following exception when connecting via HTTPS to Apache (using the WebObjects apache adaptor):
29 +
30 +{{panel}}
31 +
32 + org.xml.sax.SAXParseException: Premature end of file.
33 + at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source
34 + at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
35 + at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
36 + at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
37 + at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source))
38 + ... more
39 +
40 +{{/panel}}
41 +
42 +You will need to add additional information to the file server.wsdd to tell Apache AXIS what to do when it believes the transport mechanism is 'https.' AXIS will make the transport mechanism determination based on the HTTP header information sent to your application by the Apache WebObjects adaptor (which may include: HTTPS:on and SERVER//PORT:443). If no entry is made to tell AXIS how to handle 'https', it will assume the incoming data from the adaptor is encrypted via SSL, even though the communication between the adaptor and the instance is actually in the clear. To change the behavior of AXIS to handle these cases in the same way as http connections, change the file server.wsdd from~://
43 +
44 +{{panel}}
45 +
46 + <transport name="http">
47 + <requestFlow>
48 + <handler type="HTTPActionHandler"/>
49 + <handler type="URLMapper"/>
50 + </requestFlow>
51 + </transport>
52 +
53 +{{/panel}}
54 +
55 +To:
56 +
57 +{{panel}}
58 +
59 + <transport name="http">
60 + <requestFlow>
61 + <handler type="HTTPActionHandler"/>
62 + <handler type="URLMapper"/>
63 + </requestFlow>
64 + </transport>
65 + <transport name="https">
66 + <requestFlow>
67 + <handler type="HTTPActionHandler"/>
68 + <handler type="URLMapper"/>
69 + </requestFlow>
70 + </transport>
71 +
72 +{{/panel}}